Skip to content
v1

Reference Operations

Operations

Observe an accepted asynchronous action and request cancellation safely.

Follow an accepted action

These operations are part of API v1. Keep the returned op_ id and read GET /v1/operations/{id} using the same integration and selected team. The current key must still be authorized for the original action. A rotated key of that integration can read the operation while it retains that permission.

queued and running are pending. succeeded carries a minimal action-specific receipt; failed carries a closed error code. outcome_unknown means completion is uncertain: reconcile the existing operation before starting another action. Repeated observation never executes the action again.

POST /v1/operations/{id}/cancel, with an empty JSON object, cancels queued work. For running work it records a request; cancellation cannot undo an effect that already committed. A final cancelled status confirms cancellation. Each record is retained for up to 48 hours before asynchronous deletion; retain the necessary result in your own system.

Get an operation

GET /v1/operations/{id}

Returns one operation owned by this integration and selected team. The caller must still hold the original operation’s scope and current execution authority; an empty catalogue scope never grants access by itself.

Rate limit
Read

Path parameters

  • id string Required ID prefix op_…

    The operation's public id.

Headers

  • Totem-Team string Conditional ID prefix team_…

    The team to read, as a team_… id. Omit it when the key reads one team; it is required when the key reads several (400 team_required). When you send it, it must name a team the key reads: a malformed id gets 400 invalid_request, and a team outside the key gets 404 team_not_accessible, as does a request without it once the key reads no team at all.

Returns

Returns an Operation object.

Errors

+ 12 common errors

GET /v1/operations/{id}
curl 'https://api.totemstudio.ai/v1/operations/op_m3yGe1tkVy6hn3m9LH9m7e640wg0O' \
  -H "Authorization: Bearer $TOTEM_API_KEY" \
  -H "Totem-Team: $TOTEM_TEAM_ID"
Response · 200JSON
{
  "object": "operation",
  "id": "op_m3yGe1tkVy6hn3m9LH9m7e640wg0O",
  "status": "queued",
  "endpoint": "tasks.create",
  "created_at": "2026-10-01T09:30:00.000Z",
  "updated_at": "2026-10-01T09:30:00.000Z",
  "result": null,
  "error": null
}

Cancel an operation before its effect

POST /v1/operations/{id}/cancel

Requests cancellation of this integration’s operation in the selected team, subject to its original current scope and authority. Cancellation prevents an effect only before it begins; a running effect may already have happened. Repeating the request is safe.

Rate limit
write

Path parameters

  • id string Required ID prefix op_…

    The operation's public id.

Headers

  • Totem-Team string Conditional ID prefix team_…

    The team to read, as a team_… id. Omit it when the key reads one team; it is required when the key reads several (400 team_required). When you send it, it must name a team the key reads: a malformed id gets 400 invalid_request, and a team outside the key gets 404 team_not_accessible, as does a request without it once the key reads no team at all.

Returns

Returns an Operation object.

Errors

+ 12 common errors

POST /v1/operations/{id}/cancel
# Fictional fixtures: replace references and dates with current API values.
# Send consent or confirmation attestations only after the person confirms.
curl -X POST 'https://api.totemstudio.ai/v1/operations/op_m3yGe1tkVy6hn3m9LH9m7e640wg0O/cancel' \
  -H "Authorization: Bearer $TOTEM_API_KEY" \
  -H "Totem-Team: $TOTEM_TEAM_ID" \
  -H "Content-Type: application/json" \
  --data '{}'
Response · 200JSON
{
  "object": "operation",
  "id": "op_m3yGe1tkVy6hn3m9LH9m7e640wg0O",
  "status": "cancelled",
  "endpoint": "tasks.create",
  "created_at": "2026-10-01T09:30:00.000Z",
  "updated_at": "2026-10-01T09:30:01.000Z",
  "result": null,
  "error": null
}

The Operation object

Durable operation status, available only to its current authorized integration and team.

Attributes

  • object string

    Always operation.

  • id string ID prefix op_…

    Opaque durable operation id.

  • status string

    Durable operation state; outcome_unknown must be reconciled before repeating the effect.

    Possible values
    • queued
    • running
    • succeeded
    • failed
    • cancelled
    • outcome_unknown
  • endpoint string

    The original endpoint executed by this operation.

    Possible values
    • tasks.create
    • tasks.complete
    • notifications.create
    • decision_requests.create
    • decision_requests.cancel
    • bookings.create
  • created_at string Format date-time

    When this operation was accepted, in UTC.

  • updated_at string Format date-time

    When its current state was recorded, in UTC.

  • Minimal public resource receipt after success, otherwise null.

  • error object Nullable

    Safe failure information, or null.

Operation · exampleJSON
{
  "object": "operation",
  "id": "op_m3yGe1tkVy6hn3m9LH9m7e640wg0O",
  "status": "queued",
  "endpoint": "tasks.create",
  "created_at": "2026-10-01T09:30:00.000Z",
  "updated_at": "2026-10-01T09:30:00.000Z",
  "result": null,
  "error": null
}

API version 1.0.0