For the complete documentation index, see llms.txt. This page is also available as Markdown.

POST /v2/runs

Start Run

post

Start a run of a project version and return its current persisted state.

How to use

Send project_id and singular input. A 201 creates a run but does not mean it succeeded. Persist data.run_id, then poll with analytics.read. Omitted/null project_version selects published, -1 selects draft, and a nonnegative integer pins a snapshot. A 500 can occur after execution starts; reconcile instead of automatically 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.

{
  "project_id": "YOUR_PROJECT_ID",
  "input": {
    "in-0": "Summarize our refund policy"
  },
  "project_version": 1
}
Authorizations
AuthorizationstringRequired

Personal API key (sk_...) or supported user access JWT. See Authentication and authorization for endpoint restrictions and scopes. Use exactly one Authorization header.

Body

Body for starting a project run.

project_idstringRequired
project_versioninteger · min: -1 · nullableOptional

Project version to run. Omit or use null for the current published version, use -1 for the current draft, or use a non-negative version for an exact snapshot.

Responses
201

Run created. Execution is asynchronous; poll the Location URL for progress.

application/json
response_codestring · nullableOptional

Machine-readable response code, when provided.

post/v2/runs
curl
curl --fail-with-body -sS \
  "$STACKAI_BASE_URL/v2/runs" \
  -H "Authorization: Bearer $STACKAI_API_KEY" \
  -H 'Content-Type: application/json' \
  --data-binary @request.json
{
  "data": {
    "run_id": "5f4c3b2a-1111-4111-8111-123456789abc",
    "project_id": "YOUR_PROJECT_ID",
    "project_version": 1,
    "status": "queued",
    "error": null,
    "created_at": "2026-10-05T12:00:00Z",
    "started_at": null,
    "completed_at": null,
    "run_type": "api",
    "created_by": null,
    "usage": {
      "total_tokens": 0,
      "details": []
    },
    "parent_run_id": null,
    "parent_project_id": null,
    "input": {
      "in-0": "Summarize our refund policy"
    },
    "output": null,
    "citations": null,
    "pending_input": null
  }
}

Last updated

Was this helpful?