Skip to main content
Some requests start work that finishes later, such as a campaign send or a production enrollment. Polymorfa tracks that work as an operation. The request that starts it returns an operationId, and the operations routes of the Platform API report its progress:
Reads require operations:read. Cancellation requires operations:cancel. A team API key sees team-owned operations and the operations of every project in the team. A project token sees only its own project’s operations. When a project token asks for another project, or for an operation outside its project, the API returns 404. Each route also has a project form under /platform/projects/{projectId}/operations, which addresses exactly one project.

Operation fields

succeeded, failed, and cancelled are terminal. A terminal operation doesn’t change again.

List operations

List results come newest first. Filter by projectId, status, kind, resourceType with resourceId, since, and exclusive until:
A page holds at most 100 operations. When more remain, page.nextCursor is set. The cursor carries the filters and the project of the page that issued it, so send it with limit only. Adding a filter, or sending it with a different project, returns 400.

Wait for an operation

Add wait to hold the request open until something changes. wait accepts 0 to 30 seconds:
The API responds as soon as one of these is true:
  • the operation reaches a terminal status;
  • afterSequence is set and the operation’s sequence is greater than it; or
  • the wait ends.
The response is always the operation’s state at that moment, with status 200. Check status before you act: an expired wait returns a non-terminal operation. To follow each transition, send the last sequence you saw as afterSequence on the next request.

Read the transition history

GET /platform/operations/{operationId}/transitions lists every status change in ascending sequence order, with the progress, error, and action-required snapshot recorded at that transition.

Cancel an operation

Only running or action-required campaign and production-enrollment operations accept cancellation. Check capabilities.cancellable first, then send an Idempotency-Key:
The operation moves to cancelling and later reaches cancelled, or another terminal status if it finished first. Wait for it as shown above.

SDK, CLI, and MCP

  • The TypeScript SDK exposes client.operations.list, get, listTransitions, wait, and cancel. See SDKs.
  • The CLI provides polymorfa operation list, view, wait, watch, and cancel. wait and watch exit 0 when the operation succeeds, 1 when it fails or is cancelled, and 8 when --timeout ends first.
  • The MCP server provides operations_list, operations_get, and operations_wait. It doesn’t cancel operations.