Skip to content
HomeConsoleGet started

Durable wakeups.

All paths are relative to the API base URL (https://api.getrunstate.com) and require Authorization: Bearer <api key>. See the API overview for authentication, idempotency and the error envelope.

GET /v1/spaces/{spaceId}/timers

Read-only timer list with optional state filter.

  • Key permission: coordination_read

Path parameters

Name Type Notes
spaceId string (uuid) required

Responses

Status Meaning
200 Timers
curl -X GET "$RUNSTATE_BASE_URL/v1/spaces/$RUNSTATE_SPACE_ID/timers" \
-H "Authorization: Bearer $RUNSTATE_API_KEY"
POST /v1/spaces/{spaceId}/timers

Arm a durable wakeup.

  • Key permission: coordination_write
  • Idempotency-Key header: required
  • TypeScript SDK: run.timers.create()
  • Python SDK: run.timers.create()

Path parameters

Name Type Notes
spaceId string (uuid) required

Request body (JSON)

Field Type Required Notes
scopeId string (uuid) yes
at string (date-time) no
afterSeconds integer no min 0

Responses

Status Meaning
201 Timer id and fireAt
curl -X POST "$RUNSTATE_BASE_URL/v1/spaces/$RUNSTATE_SPACE_ID/timers" \
-H "Authorization: Bearer $RUNSTATE_API_KEY" \
-H "Idempotency-Key: $(uuidgen)" \
-H "Content-Type: application/json" \
-d '{"scopeId":"<run id>"}'
POST /v1/spaces/{spaceId}/timers/{id}/ack

Acknowledge firing (idempotent)

  • Key permission: coordination_write
  • TypeScript SDK: timer.wait() (acks when fired)
  • Python SDK: timer.wait() (acks when fired)

Path parameters

Name Type Notes
spaceId string (uuid) required
id string (uuid) required

Request body (JSON)

Field Type Required Notes
token string yes

Responses

Status Meaning
200 Acked
409 Error envelope {"error":{"code","message","requestId"}}
curl -X POST "$RUNSTATE_BASE_URL/v1/spaces/$RUNSTATE_SPACE_ID/timers/<id>/ack" \
-H "Authorization: Bearer $RUNSTATE_API_KEY" \
-H "Idempotency-Key: $(uuidgen)" \
-H "Content-Type: application/json" \
-d '{"token":"<lease token>"}'
POST /v1/spaces/{spaceId}/timers/{id}/cancel

Disarm before firing.

  • Key permission: coordination_write
  • TypeScript SDK: timer.cancel()
  • Python SDK: timer.cancel()

Path parameters

Name Type Notes
spaceId string (uuid) required
id string (uuid) required

Responses

Status Meaning
200 Cancelled
409 Error envelope {"error":{"code","message","requestId"}}
curl -X POST "$RUNSTATE_BASE_URL/v1/spaces/$RUNSTATE_SPACE_ID/timers/<id>/cancel" \
-H "Authorization: Bearer $RUNSTATE_API_KEY" \
-H "Idempotency-Key: $(uuidgen)"
POST /v1/spaces/{spaceId}/timers/poll

Pull-mode firing for customers without destinations.

  • Key permission: coordination_write
  • TypeScript SDK: timer.wait()
  • Python SDK: timer.wait()

Path parameters

Name Type Notes
spaceId string (uuid) required

Request body (JSON)

Field Type Required Notes
scopeId string (uuid) no

Responses

Status Meaning
200 FIRED timers with wakeup tokens
curl -X POST "$RUNSTATE_BASE_URL/v1/spaces/$RUNSTATE_SPACE_ID/timers/poll" \
-H "Authorization: Bearer $RUNSTATE_API_KEY" \
-H "Idempotency-Key: $(uuidgen)" \
-H "Content-Type: application/json" \
-d '{}'