Strait Docs
API Reference

External event trigger management for durable waits

List event triggers for a project

GET
/v1/events

Query Parameters

project_id*string
status?string
Value in"waiting" | "received" | "timed_out" | "canceled"
workflow_run_id?string

Filter triggers by workflow run ID.

source_type?string

Filter triggers by source type.

Value in"workflow_step" | "job_run"
limit?integer
Default50
cursor?string
Formatdate-time

Response Body

application/json

curl -X GET "http://localhost:8080/v1/events?project_id=string"
{
  "data": [
    {
      "id": "string",
      "event_key": "string",
      "project_id": "string",
      "source_type": "workflow_step",
      "workflow_run_id": "string",
      "workflow_step_run_id": "string",
      "job_run_id": "string",
      "status": "waiting",
      "request_payload": {},
      "response_payload": {},
      "timeout_secs": 0,
      "requested_at": "2019-08-24T14:15:22Z",
      "received_at": "2019-08-24T14:15:22Z",
      "expires_at": "2019-08-24T14:15:22Z",
      "error": "string"
    }
  ],
  "has_more": true
}

Get event trigger statistics

GET
/v1/events/stats

Response Body

application/json

curl -X GET "http://localhost:8080/v1/events/stats"
{
  "total_count": 0,
  "waiting_count": 0,
  "received_count": 0,
  "timed_out_count": 0,
  "canceled_count": 0,
  "avg_wait_duration_secs": 0.1
}
Empty

Get event trigger by key

GET
/v1/events/{eventKey}

Path Parameters

eventKey*string

Response Body

application/json

curl -X GET "http://localhost:8080/v1/events/string"
{
  "id": "string",
  "event_key": "string",
  "project_id": "string",
  "source_type": "workflow_step",
  "workflow_run_id": "string",
  "workflow_step_run_id": "string",
  "job_run_id": "string",
  "status": "waiting",
  "request_payload": {},
  "response_payload": {},
  "timeout_secs": 0,
  "requested_at": "2019-08-24T14:15:22Z",
  "received_at": "2019-08-24T14:15:22Z",
  "expires_at": "2019-08-24T14:15:22Z",
  "error": "string"
}
Empty

Cancel a waiting event trigger

DELETE
/v1/events/{eventKey}

Path Parameters

eventKey*string

Response Body

application/json

curl -X DELETE "http://localhost:8080/v1/events/string"
{
  "id": "string",
  "event_key": "string",
  "project_id": "string",
  "source_type": "workflow_step",
  "workflow_run_id": "string",
  "workflow_step_run_id": "string",
  "job_run_id": "string",
  "status": "waiting",
  "request_payload": {},
  "response_payload": {},
  "timeout_secs": 0,
  "requested_at": "2019-08-24T14:15:22Z",
  "received_at": "2019-08-24T14:15:22Z",
  "expires_at": "2019-08-24T14:15:22Z",
  "error": "string"
}
Empty
Empty
Empty

Stream event trigger status updates via SSE

GET
/v1/events/{eventKey}/stream

Path Parameters

eventKey*string

Response Body

text/event-stream

curl -X GET "http://localhost:8080/v1/events/string/stream"
"string"
Empty

Send an event to a waiting trigger

POST
/v1/events/{eventKey}/send

Path Parameters

eventKey*string

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

application/json

curl -X POST "http://localhost:8080/v1/events/string/send" \  -H "Content-Type: application/json" \  -d '{}'
{
  "id": "string",
  "event_key": "string",
  "project_id": "string",
  "source_type": "workflow_step",
  "workflow_run_id": "string",
  "workflow_step_run_id": "string",
  "job_run_id": "string",
  "status": "waiting",
  "request_payload": {},
  "response_payload": {},
  "timeout_secs": 0,
  "requested_at": "2019-08-24T14:15:22Z",
  "received_at": "2019-08-24T14:15:22Z",
  "expires_at": "2019-08-24T14:15:22Z",
  "error": "string"
}
Empty
Empty

Send an event to all waiting triggers matching a prefix

POST
/v1/events/prefix/{prefix}/send

Path Parameters

prefix*string
Lengthlength <= 512

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

application/json

curl -X POST "http://localhost:8080/v1/events/prefix/string/send" \  -H "Content-Type: application/json" \  -d '{}'
{
  "resolved": 0,
  "triggers": [
    {
      "id": "string",
      "event_key": "string",
      "project_id": "string",
      "source_type": "workflow_step",
      "workflow_run_id": "string",
      "workflow_step_run_id": "string",
      "job_run_id": "string",
      "status": "waiting",
      "request_payload": {},
      "response_payload": {},
      "timeout_secs": 0,
      "requested_at": "2019-08-24T14:15:22Z",
      "received_at": "2019-08-24T14:15:22Z",
      "expires_at": "2019-08-24T14:15:22Z",
      "error": "string"
    }
  ]
}
Empty

Purge terminal event triggers

POST
/v1/events/purge

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

application/json

curl -X POST "http://localhost:8080/v1/events/purge" \  -H "Content-Type: application/json" \  -d '{    "older_than_days": 1  }'
{
  "deleted": 0,
  "dry_run": true,
  "would_delete": 0
}
Was this page helpful?