Skip to main content
The /state endpoint is the primary way to read what an application is doing right now. It returns a SubstrateState — a flat JSON document containing every semantic state key the probe has extracted from the process’s runtime heap, along with the full action schema, navigational context, and probe diagnostics. You’ll call this endpoint before planning an agent action, after executing one, or any time you need the freshest possible view of a process.

Endpoint

Rate limit: 100 requests per second.

Parameters

pid
integer
required
The OS process ID of the target application. Get this value from the pid field in GET /apps.
fresh
boolean
default:"false"
When false (the default), the daemon returns the most recently cached state snapshot immediately — typically under 5 ms. When true, the daemon triggers a new probe cycle before responding. Fresh probes add 50 ms to 90 s of latency depending on the runtime and application size. Use fresh=true when you need to confirm the current state before a high-stakes action, or after an action has just completed.

Response Fields

The response is a flat JSON object. All SubstrateState fields are at the top level — there is no wrapper envelope.
capture_id
string
required
A UUIDv7 (time-ordered) identifier for this exact state snapshot. Use this value as the since parameter in GET /diff/{pid} to compute what changed between two captures.
app_id
string
required
Stable semantic identifier for the application, e.g. "gmail-chrome-12847".
app_name
string
required
Human-readable application name.
pid
integer
required
OS process ID at the time of capture. If the process has restarted since the capture, this may differ from the PID you requested.
runtime
string
required
Runtime kind: v8, jvm, clr, or native.
schema_version
string
required
Semantic schema version in semver format, e.g. "1.4.2". The schema version increments whenever the semantic engine updates its labeling model for this application, either automatically or via POST /learn/{pid}.
captured_at
datetime
required
ISO 8601 timestamp of when this snapshot was taken.
confidence
float
required
Overall probe quality score from 0.0 to 1.0. Values above 0.90 indicate reliable semantic labeling. If confidence is low, read the probe_metadata fields to diagnose which tier was used and whether the heap was partially filtered.
context
AppContext
required
Navigational context for the application.
objects
object
required
A flat map of dot-notation state keys to their current values. Keys use dot-notation for nested fields and bracket notation for array indices, e.g. "inbox.emails[0].subject". Values are primitives: strings, numbers, booleans, or null. This is the primary data structure your agent reads and reasons over.
actions
object
required
A map of action names to their ActionSchema definitions. Each entry describes how to call the action. See GET /schema/{pid} for the full field list with documentation.
probe_metadata
object
required
Internal probe diagnostics. Useful for performance tuning and debugging.

Examples

Example Response

Error Responses