POST /v2/runs/{run_id}/resume
Accept an asynchronous response to a paused ask-human step.
How to use
GET the paused run first, handle the human response, and send the issued resume token. Poll after 202. A 409 means state or pause/backend support is incompatible. On 500, usage may already have been charged; read current state before retrying.
Authentication and permissions
Required permissions: projects.run. Resource and owner access checks also apply.
Prepare request.json
Save the example body below as request.json for the curl sample. Replace example IDs, node keys, and dynamic configuration with values for your organization; these are illustrative, not pre-existing resources.
{
"resume_token": "TOKEN_FROM_PENDING_INPUT",
"response": "THE_HUMAN_ANSWER",
"response_type": "text"
}Personal API key (sk_...) or supported user access JWT. See Authentication and authorization for endpoint restrictions and scopes. Use exactly one Authorization header.
Body for resuming an ask-human pause.
Token issued for the paused ask-human step.
Human response to the paused step.
How to interpret the response; defaults to text when omitted.
Resume accepted. Poll the Location URL for the current run state.
Base response model for StackAI API endpoints.
Provides Pydantic validation and serialization with a helper method to convert to FastAPI's JSONResponse when needed.
Serialization contract: status_code never reaches the body (it only feeds
to_json_response), and response_code/meta are omitted when unset so
success bodies carry no filler. Error handlers that set them keep them.
Machine-readable response code, when provided.
Invalid or expired resume token, run ID or request body.
Authentication required.
Organization usage limit reached.
Project run permission or credential scope required, or run logging disabled.
Run not found or inaccessible.
Run is not resumable or requires an unsupported pause or backend.
Validation Error
Resume failed; usage may already have been charged.
curl --fail-with-body -sS \
"$STACKAI_BASE_URL/v2/runs/${RUN_ID}/resume" \
-H "Authorization: Bearer $STACKAI_API_KEY" \
-H 'Content-Type: application/json' \
--data-binary @request.json{
"response_code": "text",
"meta": {
"ANY_ADDITIONAL_PROPERTY": "anything"
}
}Last updated
Was this helpful?

