These routes require authentication. A worker can open and run Missions within its approved fleet policy. STACK returns 404 for another operator's Mission or a Mission the calling agent cannot access.
Missions are available on every plan. Every Passport is issued for exactly one Mission. Opening a Mission is free; issuing its Passport is metered.
POST /v1/missions/start opens a Mission and issues its Passport in one call. It has two forms: the operator form for one of your agents, and the fleet form for fleet workers. The call counts once, as the Passport issue.
Operator API keys, dashboard sessions and the keys of partner-managed accounts use this form. An agent can also use it for itself. Agents in a fleet use the fleet form.
curl -X POST https://api.getstack.run/v1/missions/start \
-H "Authorization: Bearer <access token>" \
-H "Content-Type: application/json" \
-d '{
"agent_id": "agt_7kx9m2nq4p",
"mission": {
"intent_summary": "Reconcile August invoices",
"intent_services": ["stripe"],
"max_actions": 200,
"expires_in_seconds": 3600
},
"passport": { "ttl_seconds": 900 }
}'Response - 201 Created:
{
"mission_id": "ms_4hT9pQ2xVn",
"claim_id": "pc_...",
"expires_at": "2026-10-01T11:30:00.000Z",
"passport": {
"token": "eyJhbGciOiJFZERTQSIsInR5cCI6IkpXVCJ9...",
"jti": "ppt_9xm3kR7wL2",
"expires_at": "2026-10-01T10:45:00.000Z"
}
}If issuance fails, STACK revokes the just-opened Mission and returns the error.
POST /v1/missions/start with fleet_policy_id accepts fleet_policy_id, idempotency_key, intent_summary, requested_access, requested_operations and limits. It checks the request against the live fleet policy and returns mission_id, policy_id, policy_revision and a Passport. Reuse the idempotency key only for the same job request.
Each requested_access entry names a connection_id and exact scopes. Named intents or constraints limit the action and its parameters, such as a Slack channel. requested_operations covers Skills, A2A tasks and Drop-offs with an exact target and action. These requests may narrow the fleet policy's permission.
curl -X POST https://api.getstack.run/v1/missions \
-H "Authorization: Bearer <access token>" \
-H "Content-Type: application/json" \
-d '{
"agent_id": "agt_7kx9m2nq4p",
"intent_summary": "Reconcile August invoices",
"intent_services": ["stripe", "quickbooks"],
"expected_counterparties": ["acct_123"],
"max_actions": 200,
"coverage_cap_cents": 5000,
"max_duration_seconds": 3600,
"coverage_cap_period": "day",
"cap_time_zone": "America/New_York",
"cap_behavior": { "max_actions": "refuse_action" }
}'The response contains mission_id, the signed Mission claim_id, and expires_at.
A Mission has no maximum length (the latest end is 31 December 9999) and needs no spend or action limit at any length, though it can carry one. Passports stay short-lived and renew as before. An agent can renew its Passport for as long as its Mission is live without anyone being asked, so a Mission with no end in sight and no limit lets the agent keep working until you complete or revoke the Mission.
A Mission bounds the job; it is not a mandate. An authority binding can pin the Mission ID, and a Passport can carry both mission_ids and opaque authority_refs. See Authority API.
agent_id (string, optional) assigns the Mission to one of your agents, prefixed agt_. An agent caller is always assigned itself. If you pass passport_jti, it must belong to your account and to the assigned agent. Opening a Mission is free.
To issue the Passport as a separate step, pass the Mission ID to POST /v1/passports/issue as mission_ids: ["ms_..."]. The Mission must be live and assigned to that agent or unassigned. POST /v1/missions also accepts the fleet request when opening and issuing are separate steps.
cap_behavior maps each limit (coverage_cap_cents, max_actions, max_actions_per_service, max_concurrent_intents, max_duration_seconds, max_dropoff_bytes) to what happens when it is reached. It is set when the Mission opens.
coverage_cap_period is mission (the default: coverage_cap_cents counts everything the Mission spends) or day (what it spends in one day, the day ending at midnight in cap_time_zone, an IANA time zone, default UTC). GET /v1/missions?status=paused lists the Missions waiting for your review; a paused Mission carries paused_at, paused_cap and, for a per-service limit, paused_service.
making_orders_up_to_cents is what you pre-approve of the Mission's print-on-demand orders, in cents across all of them: an order that fits in what is left is approved without asking you. Only the owner or an admin sets it, at open or with PUT /v1/missions/:id/making-allowance on a running Mission (null removes it).
A policy rule that leaves recipients to each Mission allows a send only in a Mission that names the recipients exactly, and only to them. A Mission that does not name them is refused with recipients_not_pinned. POST /v1/missions, and the mission object of POST /v1/missions/start, take these optional fields. The owner can add to them on a running Mission with POST /v1/missions/:id/recipients (the same fields; nothing is taken away); an agent cannot.
An agent woken by an incoming message can reply to that person, and no one else, in one call. The wake carries the message id as event.message_id:
curl -X POST https://api.getstack.run/v1/missions/start \
-H "Authorization: Bearer <access token>" \
-H "Content-Type: application/json" \
-d '{
"agent_id": "agt_7kx9m2nq4p",
"mission": {
"intent_summary": "Reply to the customer about order 1042",
"reply_to_message": "amsg_3Qm8vXk2Lp"
}
}'A send to anyone else inside that Mission is refused with recipient_not_allowed. A delegated Passport carries the same Mission, so it carries the same recipients; the per-job rules of the agent the Mission was opened for apply to it too.
GET /v1/missions/:id includes the approved connection access, operation targets and Mission usage under fleet. It also shows the fleet's current policy revision and shared limits.
POST /v1/missions/:id/renew returns a fresh Passport for the existing Mission. Renewal checks the current agent key, membership and policy. It keeps the Mission's original permissions, limits, deadline and usage.
curl -X POST https://api.getstack.run/v1/missions/ms_123/complete \
-H "Authorization: Bearer <access token>" -H "Content-Type: application/json" \
-d '{"output":{"reconciled":42}}'
curl -X POST https://api.getstack.run/v1/missions/ms_123/revoke \
-H "Authorization: Bearer <access token>" -H "Content-Type: application/json" \
-d '{"reason":"adversarial","notes":"Unexpected recipient"}'Repeating the same terminal transition is safe. An incompatible second transition returns 409. A revoke can use adversarial or operator_initiated_clean.
Completing or revoking a Mission, with either reason, revokes every Passport bound to it in the same transaction. Refresh and delegation of those Passports then fail.
When a Mission declares an output schema, successful completion requires matching output. STACK stores the output encrypted and signs a salted digest in the completion claim. Authorized callers can retrieve the output, salt and digest from GET /v1/missions/:id. Changing the encryption key leaves the signed claim intact.
This route requires a same-operator member principal, such as a member OAuth session. Agent JWTs, Passports, owner OAuth tokens and operator API keys cannot author it.
The body accepts narrative, optional decision-tree and alert detail, lessons_learned, and an incident classification. Dossiers are a controls feature: without controls the route answers 402 CONTROLS_REQUIRED.
Operator reviews use separate routes and a stricter dashboard-session rule. See Evidence API.
List routes accept page and limit and return items, page, limit, total and has_more. Without pagination parameters they return arrays.
Read one fleet policy and its shared usage. The response includes policy, usage, window_started_at and window_seconds. Usage includes actions, concurrent_actions, reserved_spend_cents, dropoff_bytes and unknown_actions.
Read the fleet policy an agent belongs to. The response includes policy_id, policy_name, revision, membership_id, identity_expires_at, revoked_at, policy_status and policy_expires_at, or null when the agent has no fleet membership. Fleet reads require operator-admin access.
List fleet policies.
Request approval for a policy and activate it after approval. Supply Idempotency-Key. Retry the same body with X-Governance-Approval.
Revise an approved policy. Supply If-Match with its current revision, Idempotency-Key and the approval header.
Revoke the fleet's permission to continue work.
List enrolled agents and their identity expiry.
Revoke one agent's fleet membership.
Request a challenge as an approved provisioner.
Enroll or renew a worker using its public key, signed challenge and stable enrollment key. Key rotation also requires previous_key_proof from its old key.
Request a challenge with a workload token from the policy's trusted issuer.
Enroll or renew a worker with that workload identity and its signed key proof.
Exchange a fresh agent proof for an MCP session lasting up to five minutes. Workers send an empty body. Provisioners include fleet_policy_id.
To replace a worker key, send the original name and enrollment idempotency key, the new public key and its signed challenge. Also supply previous_key_proof, signed by the old key. It covers canonical JSON containing domain=stack:fleet-key-rotation:v1, challenge_id, challenge, policy_id, idempotency_key and the new key's SHA-256 RFC 7638 public_key_thumbprint. Encode the signature as base64url. Local enrollment helpers retain the existing key. Use enroll or enrollWorkload when managing rotation yourself.