Skip to main content
The /action endpoint lets you call any action listed in an application’s state schema. NSP dispatches the call directly through the runtime probe for the target process. The response includes an optional post-action verification result and a state delta so you know exactly what changed.

Endpoint

Rate limit: 10 requests per second. Timeout: 120 seconds (extended from the standard 30 s to accommodate cold probe attachment, post-action state settlement, and verification polling).

Request Fields

pid
integer
OS process ID of the target application. Provide either pid or app_id — the daemon resolves the other automatically.
app_id
string
Stable app identifier from GET /apps. Provide either app_id or pid.
action
string
required
Name of the action to execute, exactly as it appears in the actions map returned by GET /state or GET /schema.
parameters
object
required
Key-value map of action parameters matching the action’s schema. Required parameters must be present; omitting optional parameters is allowed.
verify_expression
string
A JavaScript-style predicate evaluated against the post-action state, e.g. "inbox.sent_count > 0". Required for actions with reversibility: "irreversible_write". The daemon polls until the expression evaluates to true or verify_timeout_ms elapses. Maximum 2048 bytes.
verify_timeout_ms
integer
default:"5000"
How long to wait (in milliseconds) for verify_expression to become true. Accepted range: 100–30000 ms.
fresh_state
boolean
default:"false"
When true, the daemon captures a fresh state snapshot before dispatching the action. Use this if you need pre-action state in state_delta to reflect the very latest runtime values rather than the cached snapshot.

Response Fields

success
boolean
required
true if the action ran and — when a verify_expression was provided — the verification passed. false in all other cases.
action_id
string
required
UUIDv7 unique identifier for this execution. Use this for logging and correlation.
action
string
required
The action name that was executed.
executed
boolean
required
Whether the action itself was dispatched. This can be false if the action was rejected at the pre-flight safety gate before dispatch (e.g., missing verify_expression for an irreversible write).
runtime
string
required
The runtime used for execution (v8, jvm, clr, or native).
total_latency_ms
integer
required
Total wall time in milliseconds from receipt of the request to sending the response.
message
string
required
Human-readable status summary, e.g. "Action executed successfully" or "Verification failed after 5000ms".
verification
VerificationOutcome | null
Post-action verification result. Present only when a verify_expression was provided.
updated_state
SubstrateState | null
Full state snapshot captured after the action. Useful when you want the current state in one round-trip without a separate GET /state call.
state_delta
object | null
Field-level before/after diff of changed keys, e.g. { "inbox.sent_count": { "before": 14, "after": 15 } }.
raw_return
any | null
The raw return value from the method invocation. Populated for JVM and CLR runtime actions; null for V8 browser actions.

Action Safety Gates

NSP enforces three safety checks before dispatching any action: 1. Irreversible Write Gate — Actions with reversibility: "irreversible_write" (such as send_reply or delete_email) require a verify_expression. Requests without one are rejected with 400 missing_verify_expression. 2. Dangerous Name Heuristic — If the PID cannot be resolved and the action name contains any of delete, destroy, purge, wipe, reset, clear_all, terminate, shutdown, or kill, the request is rejected with 400 dangerous_action_unverified. 3. Expression Size Limitverify_expression is capped at 2048 bytes.

CDP Built-in Actions (V8 Apps)

For V8/browser apps, NSP exposes a set of built-in actions that map directly to Chrome DevTools Protocol commands:

Examples

Example Response

Error Responses