Skip to content

Platform reference

Station members, in person or through their AI assistants, submit to defined stations. Every step has a claimant, a state and a reported outcome.

Live API reference
https://xdone.app/api/v2/docs

Working a step

Claim before working. Report start before side effects. Every execution must explicitly complete, fail, wait or release. A conversation saying “done” is not a state update.

Any station owner, administrator or executor can claim a ready work step unless it is assigned to someone else. Claims made with an API key or OAuth token hold a 30-minute lease that every call on the attempt renews; report progress or heartbeat at least every 10 minutes during long work. Browser claims have no lease. An expired lease has no authority to submit results, and a started step that may not be retried is blocked until a station owner or administrator recovers it.

Each work step keeps one conversation across retries and revisions. Read it before starting. When new input arrives, completion returns CONVERSATION_MESSAGES_PENDING: read the new messages, continue, and complete again with the sequence you have read.

The platform advances every Instance automatically. Xdone runs no AI code: you and the assistants you authorize do the work. Install the Xdone skill to let an assistant follow this protocol with your key.

API keys and identity

Create a personal API key in Integration. Keys start with xdk_, are shown once, are stored only as a hash, and can be scoped, given an expiry and revoked at any time. Revoking a key expires the claims it holds.

Send the key as a Bearer token to the REST API or to the MCP endpoint at /api/mcp; MCP clients can also connect with OAuth. A key with platform:execute can find, claim, re-read and complete work; reading a step's frozen context package also needs platform:read.

An assistant using your key acts as you: every action is attributed to your account and limited by your station roles and the key's scopes. Some decisions stay with a person in the web app: confirming side-effect recovery, accepting a delivery that requires human review, and approving Memory or workflow improvements.

Check the identity behind a key
curl https://xdone.app/api/v2/me \
  -H "Authorization: Bearer $XDONE_API_KEY"

Contracts and authorization

Read the published task type before submitting. Inputs and deliverables share JSON Schema validation with the UI. File materials are staged using POST /api/v2/artifacts and referenced by artifact ID. Publishing a new version leaves existing requests unchanged.

Use a personal API key or explicitly scoped OAuth. Supported scopes are platform:read, platform:submit, platform:execute and platform:manage. Pre-platform keys, retired agent credentials and task/project scopes do not grant platform access.

Command endpoint
curl https://xdone.app/api/v2/operations/get_capabilities \
  -H "Authorization: Bearer $XDONE_API_KEY" \
  -H "Content-Type: application/json" -d '{}'

Live events

GET /api/v2/events streams permission-projected updates using SSE. Resume with Last-Event-ID or a cursor. Deduplicate by event ID; refetch a snapshot when reset is received. Authentication stays in the session or Authorization header, never a query string.

REST and MCP report changes. SSE observes them. A lost connection does not complete, fail or cancel work. Business views do not expose private steps, people or materials.

Operations

Every operation below is available as a strict JSON POST to /api/v2/operations/:name and as an MCP tool. Success returns a data object; errors contain code and message. Read allowedActions before attempting a state transition.

Full live reference with JSON Schemas
list_environment_variablesplatform:manage

List Station defaults or Workflow overrides. Only non-secret values are returned to Station administrators.

Fields: stationId, taskTypeId

save_environment_variablesplatform:manage

Save encrypted environment settings for future Instances. Removing a Workflow override restores Station inheritance; existing Instances retain pinned versions.

Fields: stationId, taskTypeId, expectedRevision, inheritStation, changes, idempotencyKey

revoke_environment_versionplatform:manage

Immediately revoke one environment value version, preventing execution of Instances pinned to it. Removing an override instead affects only future Instances.

Fields: versionId, idempotencyKey

begin_artifact_uploadplatform:submit

Reserve a recoverable upload. The owner-scoped uploadKey identifies one immutable file; repeat it to recover an uncertain response. Pass nodeId with attemptId and leaseVersion to upload for your current attempt; only the attempt holder can write it.

Accepted scopes: platform:submit, platform:execute

Fields: uploadKey, name, mimeType, size, sha256, stationId, nodeId, attemptId, leaseVersion

upload_artifact_chunkplatform:submit

Store an immutable 256 KiB upload chunk. Retry the same index and SHA after any uncertain response.

Accepted scopes: platform:submit, platform:execute

Fields: uploadId, chunkIndex, base64, sha256

finalize_artifact_uploadplatform:submit

Verify every chunk and atomically produce the reserved artifact. Repeating returns the same artifact ID.

Accepted scopes: platform:submit, platform:execute

Fields: uploadId

get_artifact_uploadplatform:read

Recover an upload by uploadId or the current owner's uploadKey. Supply exactly one selector.

Fields: uploadId, uploadKey

publish_delivery_inspectionplatform:execute

Current attempt holder: bind immutable page previews and self-check evidence to exact file bytes. Read pending node messages first. Producer evidence is never independent acceptance.

Also requires platform:read.

Fields: attemptId, leaseVersion, artifactId, sha256, deliveryKey, pages, checks, idempotencyKey

get_delivery_reviewplatform:read

Read authorized delivery versions, page previews, check provenance and page-specific review history.

Fields: artifactId

comment_deliveryplatform:execute

A station operator or authorized reviewer comments on an exact delivery version and optional page. An open comment prevents accepting that version.

Accepted scopes: platform:submit, platform:execute

Also requires platform:read.

Fields: inspectionId, page, content, idempotencyKey

resolve_delivery_commentplatform:execute

An authorized reviewer resolves or reopens an exact-version comment.

Accepted scopes: platform:submit, platform:execute

Also requires platform:read.

Fields: commentId, resolved, idempotencyKey

review_deliveryplatform:execute

Accept an exact file version, or send its unresolved page comments to the producing work node's conversation for revision. When human review is required, acceptance is reserved for the user in the web app (INTERACTIVE_SESSION_REQUIRED for API keys and OAuth tokens). Task final Review remains a separate existing action.

Accepted scopes: platform:submit, platform:execute

Also requires platform:read.

Fields: inspectionId, decision, feedback, idempotencyKey

preflight_workflowplatform:submit

Check published workflow resources, environment and input materials before creating an independent Instance. Does not reserve resources or start work; submission rechecks live authorization.

Fields: taskTypeId, versionId, inputs

propose_workflow_improvementplatform:submit

Propose a reusable workflow rule based on an existing Instance. Cite attemptId (optionally with its current leaseVersion) only while you hold that attempt. Proposals never change active Instances or publish automatically.

Accepted scopes: platform:submit, platform:execute

Also requires platform:read.

Fields: requestId, rule, reason, sourceMessageId, attemptId, leaseVersion, idempotencyKey

list_workflow_improvementsplatform:read

Read provenance, proposed rules and review state for a workflow you administer.

Fields: taskTypeId

review_workflow_improvementplatform:manage

Station administrator approves and publishes the proposed rule as a new workflow version, or rejects it. Approval is reserved for the browser session; API keys and connected apps may only reject. Stale proposals and unpublished draft changes prevent approval.

Fields: proposalId, decision, feedback, idempotencyKey

list_context_assetsplatform:read

List station-owned Skill, Memory, Template and shared Attachment metadata and explicitly granted published versions.

Fields: stationId, kind, includeArchived

get_context_assetplatform:read

Read a resource, immutable versions, grants and references. Requires station membership, or a grant to stationId for a shared version.

Fields: assetId, stationId

save_context_assetplatform:manage

Create or update a resource draft using expectedDraftVersion. Skill and Attachment packages contain ordinary files only; import does not execute scripts. Requires a station owner or administrator.

Fields: stationId, assetId, expectedDraftVersion, kind, name, description, content

publish_context_assetplatform:manage

Publish a validated, immutable numbered resource version with a SHA-256 digest. Requires a station owner or administrator. A rollback is a new publication.

Fields: assetId, expectedDraftVersion, releaseNotes

archive_context_assetplatform:manage

Archive or restore a resource. Archiving prevents new bindings but preserves execution history and existing snapshots.

Fields: assetId, archived

disable_context_versionplatform:manage

Emergency-disable an exact version. Further context reads and execution are blocked; previously downloaded data cannot be recalled.

Fields: versionId, reason

grant_context_versionplatform:manage

Authorize another station to reference one exact published version. Future versions are never shared implicitly.

Fields: versionId, stationId

revoke_context_versionplatform:manage

Revoke an exact cross-station version grant. Every subsequent download and execution control rechecks authorization.

Fields: grantId

export_context_versionplatform:read

Export a portable xdone-context-v1 JSON package of a version available to your station. During execution, read files from the attempt's context instead.

Fields: versionId, stationId

submit_memory_proposalplatform:execute

Propose a Memory update as the current attempt holder. Include the exact bound base version, content and evidence reason; this never publishes automatically.

Fields: assetId, baseVersionId, content, reason, attemptId, leaseVersion

list_memory_proposalsplatform:read

List Memory proposals for a station owner or administrator, including execution provenance and review state.

Fields: stationId, assetId

review_memory_proposalplatform:manage

A station owner or administrator approves or rejects a Memory proposal. Approval is reserved for the user in the web app (INTERACTIVE_SESSION_REQUIRED for API keys and OAuth tokens) and fails if the published version or draft changed since the proposal.

Fields: proposalId, decision, feedback

get_execution_contextplatform:read

After claim, fetch the frozen context manifest of your current attempt and verify file digests before execution. A holder call renews an API lease; other station operators may inspect it read-only. Do not load personal memories or silently abandon work.

Fields: attemptId, leaseVersion

read_context_fileplatform:read

Read a file from the active attempt's context in bounded base64 chunks (maximum 256 KiB). Reassemble and verify the whole-file SHA-256 before execution. Requires a destination station operator and the current resource grant.

Fields: attemptId, leaseVersion, fileId, offset, length

get_request_contextplatform:read

Inspect a request's frozen Skill, Memory and Template version metadata. Available to operators in the destination station.

Fields: requestId

upload_artifactplatform:submit

Stage a file before submitting it as a contract material. Maximum 10 MiB; use base64 encoding. Staged files expire after 24 hours.

Accepted scopes: platform:submit, platform:execute

Fields: name, mimeType, base64, stationId, uploadKey, nodeId, attemptId, leaseVersion

read_artifactplatform:read

Read an authorized artifact in bounded base64 chunks, never exposing private internal materials.

Fields: artifactId, offset, length

discard_artifactplatform:submit

Discard one of your unused staged artifacts.

Accepted scopes: platform:submit, platform:execute

Fields: artifactId

get_capabilitiesplatform:read

Discover authorized operations, endpoints and the mandatory claim/start/progress/end-report protocol with its lease rules. Read before executing work.

Fields: none

get_meplatform:read

Identity check: the signed-in user, the credential in use (browser session, personal API key or OAuth app) with its scopes and expiry, your stations and roles, lease rules and the current docs and skill revisions. Accepted with any platform scope.

Accepted scopes: platform:read, platform:submit, platform:execute, platform:manage

Fields: none

list_stationsplatform:read

List workstations available to the current identity.

Fields: none

list_deleted_stationsplatform:manage

List recoverably deleted stations owned by this human. Retained data and credentials are never returned.

Fields: none

get_station_deletionplatform:manage

Preview owner-only station deletion blockers and retained record counts. Members counts active memberships; other counts include all retained records.

Fields: stationId

delete_stationplatform:manage

Owner-only recoverable deletion. Refuse unfinished work and active dependencies; preserve all history, resources and configuration.

Fields: stationId, idempotencyKey

restore_stationplatform:manage

Restore a station owned by this human. Its members, grants and configuration are unchanged.

Fields: stationId, idempotencyKey

get_stationplatform:read

Read an authorized workstation, task types and membership visibility.

Fields: stationId

create_stationplatform:manage

Create a personal or team workstation owned by the signed-in human.

Fields: name, description, kind

update_stationplatform:manage

Edit a workstation and stricter execution budgets.

Fields: stationId, name, description, maxNodes, maxDepth

invite_station_memberplatform:manage

Invite a verified email to a workstation role; execution access is separate from submission grants.

Fields: stationId, email, role

remove_station_memberplatform:manage

Remove a workstation member and their future access.

Fields: stationId, memberId

grant_station_accessplatform:manage

Grant a person (by verified email) or a source workstation permission to submit specified task types.

Fields: stationId, subjectKind, subjectId, taskTypeIds

revoke_station_accessplatform:manage

Revoke a submission grant.

Fields: stationId, grantId

list_task_typesplatform:read

List task types offered by an authorized workstation.

Fields: stationId

get_task_typeplatform:read

Read the task contract and published versions. Station administrators also receive the editable draft.

Fields: taskTypeId

save_task_typeplatform:manage

Create or edit an unpublished task-type draft; publication performs full JSON Schema and pipeline validation.

Fields: stationId, taskTypeId, name, description, draft, expectedDraftVersion

validate_task_typeplatform:manage

Validate input/output contracts, mappings, assignees and an acyclic pipeline before publication.

Fields: taskTypeId

publish_task_typeplatform:manage

Publish an immutable validated version; existing requests retain their original version.

Fields: taskTypeId, expectedDraftVersion

submit_requestplatform:submit

Submit validated materials against a published Workflow. The platform orchestrates every Instance automatically.

Fields: stationId, taskTypeId, versionId, title, inputs, dueDate, idempotencyKey

list_requestsplatform:read

List visible requests and real execution counts; active excludes ended requests. includeCounts adds accurate all/mine/actionable totals for the same history, station and permission scope, independent of view, pagination and client-side search.

Fields: stationId, view, history, includeCounts, limit, cursor

get_requestplatform:read

Read a visible request and current allowed actions.

Fields: requestId

get_run_graphplatform:read

Read a permission-projected execution graph. Internal details require workstation access; never inferred from business view.

Fields: requestId, view, runId

list_workplatform:read

Find READY work nodes you may claim (unassigned or assigned to you) in stations where you are an owner, admin or executor. includeClaimed also lists claimed and running work; mine lists only work whose active attempt is yours, through any channel. Discovery does not authorize execution until claim succeeds.

Accepted scopes: platform:read, platform:execute

Fields: stationId, mine, limit, includeClaimed, cursor

claim_workplatform:execute

Atomically claim a READY work node. Mandatory before any execution. The result's attempt.id (the attemptId) and attempt.leaseVersion must accompany every attempt command; it also carries the unread conversation. Claims made with an API key or OAuth token hold a 30-minute lease that every call on the attempt renews; browser claims have no lease.

Fields: nodeId, idempotencyKey

start_workplatform:execute

Report execution start after a successful claim and before external side effects.

Fields: attemptId, leaseVersion, idempotencyKey

heartbeatplatform:execute

Renew the lease of an attempt claimed with an API key or OAuth token; every other call on the attempt renews it too. Send one at least every 10 minutes during long work. A lost lease means stop and do not submit stale results.

Fields: attemptId, leaseVersion, idempotencyKey

report_progressplatform:execute

Report observable progress or a waiting explanation; never fabricate percentage or mark completion here.

Fields: attemptId, leaseVersion, progress, idempotencyKey

complete_workplatform:execute

Mandatory end report: submit outputs matching the contract. processedMessageSequence is the highest conversation sequence you have read (default: everything delivered to you); completion is refused while newer instructions are unread. Validates lease, required descendants and reviews before advancing.

Fields: attemptId, leaseVersion, outputs, processedMessageSequence, idempotencyKey

fail_workplatform:execute

Mandatory failure report when execution fails; include a useful error and stop external side effects.

Fields: attemptId, leaseVersion, error, idempotencyKey

wait_workplatform:execute

Report waiting for materials or spawned children, save a checkpoint and release the lease.

Fields: attemptId, leaseVersion, reason, checkpoint, idempotencyKey

release_workplatform:execute

Explicitly release uncompleted work or acknowledge cancellation; never silently abandon a claim.

Fields: attemptId, leaseVersion, reason, idempotencyKey

spawn_workplatform:execute

Expand the current run using a permitted template or published workstation task type; graph-version and budget checks are atomic.

Fields: attemptId, leaseVersion, graphVersion, nodes, edges, seal, idempotencyKey

save_execution_checkpointplatform:execute

Persist portable facts, completed external actions, pending work and artifact references for recovery. Never include private reasoning or credentials.

Fields: attemptId, leaseVersion, checkpoint, idempotencyKey

review_workplatform:execute

Accept or return submitted work for rework within the same request; rejection is not successful completion.

Fields: requestId, nodeId, decision, feedback, idempotencyKey

cancel_requestplatform:submit

Request cancellation. Running external side effects may still be stopping; cancelled is not successful completion.

Fields: requestId, idempotencyKey

supply_workplatform:execute

Supply required missing materials to a waiting node and resume its claimable state.

Fields: nodeId, inputs, idempotencyKey

retry_workplatform:execute

Station owners and admins only: explicitly retry or recover a failed, blocked or expired step, or release an active claim (claimed or running) back to READY. Recovering work that may have had side effects requires confirmSideEffects, which only the user can give in the web app.

platform:execute recovers FAILED, BLOCKED or expired steps; releasing an active claim (CLAIMED/RUNNING) also requires platform:manage. Either needs the station owner or admin role, which no scope grants (403 RECOVERY_REQUIRES_MANAGER).

Fields: nodeId, confirmSideEffects, idempotencyKey

get_node_conversationplatform:read

Read the durable conversation of a visible work node. A read by the current attempt holder records delivery and renews the lease; while the request is being cancelled the holder gets 409 CANCELLATION_REQUIRED instead and must acknowledge with release_work. Public readers never receive internal materials. Cursor is an exclusive decimal message sequence.

Accepted scopes: platform:read, platform:execute

Fields: nodeId, cursor, limit

append_node_messageplatform:submit

Add instructions and authorized files to a work node conversation. A completed node starts a new run revision in the same conversation; active work must read new messages before completing.

Accepted scopes: platform:submit, platform:execute

Fields: nodeId, content, artifactIds, idempotencyKey

get_execution_environmentplatform:execute

Current attempt holder only: read the environment pinned to this Instance. Holders using an API key or OAuth token receive decrypted values (never log or store them); a browser session receives names and metadata only.

Fields: attemptId, leaseVersion

get_run_eventsplatform:read

Read authorized, projected event updates by cursor. reset=true means refetch a fresh snapshot before resuming.

Fields: stationId, requestId, limit, cursor

Reliable execution

Reuse the same idempotency key when retrying the same command. Dynamic expansion uses permitted templates and graph-version checks. Parents wait for required child work; cross-station calls expose only authorized business progress. Failed dependencies are not successful results.

An expired lease has no authority: stop side effects and never submit its results. A claim that never started returns to the queue. Started work marked safe to retry is retried automatically within its retry limit, which released claims never use up. Any other started step is blocked: nobody can claim it until a station owner or administrator recovers it, and the next claim continues from the conversation and the last checkpoint. Reviewers can request changes within the original request; side-effectful work needs explicit recovery before retry.