Strait Docs
API Reference

Endpoints called by job executors using run tokens

Pause a run to wait for an external event

POST
/sdk/v1/runs/{runID}/wait-for-event

Authorization

runToken
AuthorizationBearer <token>

JWT run token issued by the trigger response.

In: header

Path Parameters

runID*string

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

application/json

curl -X POST "http://localhost:8080/sdk/v1/runs/string/wait-for-event" \  -H "Content-Type: application/json" \  -d '{    "event_key": "string"  }'
{
  "status": "waiting",
  "event_key": "string",
  "expires_at": "2019-08-24T14:15:22Z",
  "trigger_id": "string"
}
Empty
Empty
Empty

Get run payload

GET
/sdk/v1/runs/{runID}/payload

Authorization

RunToken

Path Parameters

runID*string

Response Body

application/json

curl -X GET "http://localhost:8080/sdk/v1/runs/string/payload"
{}
Empty

Log an event

POST
/sdk/v1/runs/{runID}/log

Authorization

runToken
AuthorizationBearer <token>

JWT run token issued by the trigger response.

In: header

Path Parameters

runID*string

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

curl -X POST "http://localhost:8080/sdk/v1/runs/string/log" \  -H "Content-Type: application/json" \  -d '{}'
Empty

Report progress

POST
/sdk/v1/runs/{runID}/progress

Authorization

runToken
AuthorizationBearer <token>

JWT run token issued by the trigger response.

In: header

Path Parameters

runID*string

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

curl -X POST "http://localhost:8080/sdk/v1/runs/string/progress" \  -H "Content-Type: application/json" \  -d '{}'
Empty

Send heartbeat

POST
/sdk/v1/runs/{runID}/heartbeat

Authorization

runToken
AuthorizationBearer <token>

JWT run token issued by the trigger response.

In: header

Path Parameters

runID*string

Response Body

curl -X POST "http://localhost:8080/sdk/v1/runs/string/heartbeat"
Empty

Attach annotations

POST
/sdk/v1/runs/{runID}/annotate

Authorization

runToken
AuthorizationBearer <token>

JWT run token issued by the trigger response.

In: header

Path Parameters

runID*string

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

[key: string]?string

Response Body

curl -X POST "http://localhost:8080/sdk/v1/runs/string/annotate" \  -H "Content-Type: application/json" \  -d '{    "property1": "string",    "property2": "string"  }'
Empty

Save a checkpoint

POST
/sdk/v1/runs/{runID}/checkpoint

Authorization

runToken
AuthorizationBearer <token>

JWT run token issued by the trigger response.

In: header

Path Parameters

runID*string

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

curl -X POST "http://localhost:8080/sdk/v1/runs/string/checkpoint" \  -H "Content-Type: application/json" \  -d '{}'
Empty

Report AI model usage

POST
/sdk/v1/runs/{runID}/usage

Authorization

runToken
AuthorizationBearer <token>

JWT run token issued by the trigger response.

In: header

Path Parameters

runID*string

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

curl -X POST "http://localhost:8080/sdk/v1/runs/string/usage" \  -H "Content-Type: application/json" \  -d '{    "provider": "string",    "model": "string"  }'
Empty

Record a tool call

POST
/sdk/v1/runs/{runID}/tool-call

Authorization

runToken
AuthorizationBearer <token>

JWT run token issued by the trigger response.

In: header

Path Parameters

runID*string

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

curl -X POST "http://localhost:8080/sdk/v1/runs/string/tool-call" \  -H "Content-Type: application/json" \  -d '{}'
Empty

Upsert structured output

POST
/sdk/v1/runs/{runID}/output

Authorization

runToken
AuthorizationBearer <token>

JWT run token issued by the trigger response.

In: header

Path Parameters

runID*string

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

curl -X POST "http://localhost:8080/sdk/v1/runs/string/output" \  -H "Content-Type: application/json" \  -d '{}'
Empty

Mark run completed

POST
/sdk/v1/runs/{runID}/complete

Authorization

runToken
AuthorizationBearer <token>

JWT run token issued by the trigger response.

In: header

Path Parameters

runID*string

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

result?object

Response Body

curl -X POST "http://localhost:8080/sdk/v1/runs/string/complete" \  -H "Content-Type: application/json" \  -d '{}'
Empty

Mark run failed

POST
/sdk/v1/runs/{runID}/fail

Authorization

runToken
AuthorizationBearer <token>

JWT run token issued by the trigger response.

In: header

Path Parameters

runID*string

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

error?string

Response Body

curl -X POST "http://localhost:8080/sdk/v1/runs/string/fail" \  -H "Content-Type: application/json" \  -d '{}'
Empty

Spawn a child job run

POST
/sdk/v1/runs/{runID}/spawn

Authorization

runToken
AuthorizationBearer <token>

JWT run token issued by the trigger response.

In: header

Path Parameters

runID*string

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

application/json

curl -X POST "http://localhost:8080/sdk/v1/runs/string/spawn" \  -H "Content-Type: application/json" \  -d '{}'
{
  "id": "string",
  "job_id": "string",
  "project_id": "string",
  "status": "delayed",
  "attempt": 0,
  "payload": {},
  "result": {},
  "metadata": {
    "property1": "string",
    "property2": "string"
  },
  "error": "string",
  "triggered_by": "string",
  "scheduled_at": "2019-08-24T14:15:22Z",
  "started_at": "2019-08-24T14:15:22Z",
  "finished_at": "2019-08-24T14:15:22Z",
  "heartbeat_at": "2019-08-24T14:15:22Z",
  "next_retry_at": "2019-08-24T14:15:22Z",
  "expires_at": "2019-08-24T14:15:22Z",
  "parent_run_id": "string",
  "priority": 0,
  "idempotency_key": "string",
  "job_version": 0,
  "workflow_step_run_id": "string",
  "max_attempts_override": 0,
  "timeout_secs_override": 0,
  "retry_backoff": "string",
  "retry_initial_delay_secs": 0,
  "retry_max_delay_secs": 0,
  "execution_trace": {
    "queue_wait_ms": 0,
    "dequeue_ms": 0,
    "connect_ms": 0,
    "ttfb_ms": 0,
    "transfer_ms": 0,
    "total_ms": 0,
    "dispatch_ms": 0
  },
  "debug_mode": true,
  "continuation_of": "string",
  "lineage_depth": 0,
  "tags": {
    "property1": "string",
    "property2": "string"
  },
  "job_version_id": "string",
  "created_by": "string",
  "batch_id": "string",
  "concurrency_key": "string",
  "created_at": "2019-08-24T14:15:22Z"
}

Create a continuation run

POST
/sdk/v1/runs/{runID}/continue

Authorization

runToken
AuthorizationBearer <token>

JWT run token issued by the trigger response.

In: header

Path Parameters

runID*string

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

payload?object

Response Body

application/json

curl -X POST "http://localhost:8080/sdk/v1/runs/string/continue" \  -H "Content-Type: application/json" \  -d '{}'
{
  "id": "string",
  "job_id": "string",
  "project_id": "string",
  "status": "delayed",
  "attempt": 0,
  "payload": {},
  "result": {},
  "metadata": {
    "property1": "string",
    "property2": "string"
  },
  "error": "string",
  "triggered_by": "string",
  "scheduled_at": "2019-08-24T14:15:22Z",
  "started_at": "2019-08-24T14:15:22Z",
  "finished_at": "2019-08-24T14:15:22Z",
  "heartbeat_at": "2019-08-24T14:15:22Z",
  "next_retry_at": "2019-08-24T14:15:22Z",
  "expires_at": "2019-08-24T14:15:22Z",
  "parent_run_id": "string",
  "priority": 0,
  "idempotency_key": "string",
  "job_version": 0,
  "workflow_step_run_id": "string",
  "max_attempts_override": 0,
  "timeout_secs_override": 0,
  "retry_backoff": "string",
  "retry_initial_delay_secs": 0,
  "retry_max_delay_secs": 0,
  "execution_trace": {
    "queue_wait_ms": 0,
    "dequeue_ms": 0,
    "connect_ms": 0,
    "ttfb_ms": 0,
    "transfer_ms": 0,
    "total_ms": 0,
    "dispatch_ms": 0
  },
  "debug_mode": true,
  "continuation_of": "string",
  "lineage_depth": 0,
  "tags": {
    "property1": "string",
    "property2": "string"
  },
  "job_version_id": "string",
  "created_by": "string",
  "batch_id": "string",
  "concurrency_key": "string",
  "created_at": "2019-08-24T14:15:22Z"
}

List all run state keys

GET
/sdk/v1/runs/{runID}/state

Authorization

runToken
AuthorizationBearer <token>

JWT run token issued by the trigger response.

In: header

Path Parameters

runID*string

Response Body

curl -X GET "http://localhost:8080/sdk/v1/runs/string/state"
Empty

Set run state key

POST
/sdk/v1/runs/{runID}/state

Authorization

runToken
AuthorizationBearer <token>

JWT run token issued by the trigger response.

In: header

Path Parameters

runID*string

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

curl -X POST "http://localhost:8080/sdk/v1/runs/string/state" \  -H "Content-Type: application/json" \  -d '{}'
Empty

Get run state key

GET
/sdk/v1/runs/{runID}/state/{key}

Authorization

runToken
AuthorizationBearer <token>

JWT run token issued by the trigger response.

In: header

Path Parameters

runID*string
key*string

Response Body

curl -X GET "http://localhost:8080/sdk/v1/runs/string/state/string"
Empty

Delete run state key

DELETE
/sdk/v1/runs/{runID}/state/{key}

Authorization

runToken
AuthorizationBearer <token>

JWT run token issued by the trigger response.

In: header

Path Parameters

runID*string
key*string

Response Body

curl -X DELETE "http://localhost:8080/sdk/v1/runs/string/state/string"
Empty

Report in-container resource usage

POST
/sdk/v1/runs/{runID}/resources

Authorization

runToken
AuthorizationBearer <token>

JWT run token issued by the trigger response.

In: header

Path Parameters

runID*string

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

curl -X POST "http://localhost:8080/sdk/v1/runs/string/resources" \  -H "Content-Type: application/json" \  -d '{}'
Empty

Push LLM stream chunk

POST
/sdk/v1/runs/{runID}/stream

Authorization

runToken
AuthorizationBearer <token>

JWT run token issued by the trigger response.

In: header

Path Parameters

runID*string

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

curl -X POST "http://localhost:8080/sdk/v1/runs/string/stream" \  -H "Content-Type: application/json" \  -d '{}'
Empty
Was this page helpful?