SPB Git

Repository Public

run.md 8.4 KB 378 lines markdown

1---2title: Run Deployment Now3url: https://platform.claude.com/docs/en/api/beta/deployments/run4---56# Run Deployment Now78**POST** `/v1/deployments/{deployment_id}/run`910Run Deployment Now1112## Path parameters1314- `deployment_id: string`1516## Headers1718- `"anthropic-beta": optional array of AnthropicBeta`1920  Optional header to specify the beta version(s) you want to use.2122  - `string`2324  - `"message-batches-2024-09-24" or "prompt-caching-2024-07-31" or "computer-use-2024-10-22" or 43 more`2526    - `"message-batches-2024-09-24"`2728    - `"prompt-caching-2024-07-31"`2930    - `"computer-use-2024-10-22"`3132    - `"computer-use-2025-01-24"`3334    - `"pdfs-2024-09-25"`3536    - `"token-counting-2024-11-01"`3738    - `"token-efficient-tools-2025-02-19"`3940    - `"output-128k-2025-02-19"`4142    - `"files-api-2025-04-14"`4344    - `"mcp-client-2025-04-04"`4546    - `"mcp-client-2025-11-20"`4748    - `"dev-full-thinking-2025-05-14"`4950    - `"interleaved-thinking-2025-05-14"`5152    - `"code-execution-2025-05-22"`5354    - `"extended-cache-ttl-2025-04-11"`5556    - `"context-1m-2025-08-07"`5758    - `"context-management-2025-06-27"`5960    - `"model-context-window-exceeded-2025-08-26"`6162    - `"skills-2025-10-02"`6364    - `"fast-mode-2026-02-01"`6566    - `"output-300k-2026-03-24"`6768    - `"user-profiles-2026-03-24"`6970    - `"user-profiles-2026-08-18"`7172    - `"user-profiles-2026-09-04"`7374    - `"advisor-tool-2026-03-01"`7576    - `"managed-agents-2026-04-01"`7778    - `"cache-diagnosis-2026-04-07"`7980    - `"dreaming-2026-04-21"`8182    - `"thinking-token-count-2026-05-13"`8384    - `"server-side-fallback-2026-06-01"`8586    - `"server-side-fallback-2026-07-01"`8788    - `"fallback-credit-2026-06-01"`8990    - `"fallback-credit-2026-07-01"`9192    - `"agent-memory-2026-07-22"`9394    - `"mid-conversation-tool-changes-2026-07-01"`9596    - `"compact-2026-01-12"`9798    - `"computer-use-2025-11-24"`99100    - `"mcp-tunnels-2026-06-22"`101102    - `"structured-outputs-2025-11-13"`103104    - `"task-budgets-2026-03-13"`105106    - `"thinking-display-updates-2026-08-18"`107108    - `"ce-user-management-2026-07-13"`109110    - `"mid-conversation-output-config-2026-07-01"`111112    - `"thinking-binding-controls-2026-08-01"`113114    - `"mid-conversation-system-clear-at-2026-08-21"`115116    - `"compact-2026-09-04"`117118- `"anthropic-workspace-id": optional string`119120## Returns121122- `BetaManagedAgentsDeploymentRun object`123124  A persistent, append-only record of a single deployment execution. Records session creation success or failure — no session lifecycle tracking.125126  - `type: "deployment_run"`127128  - `id: string`129130    Unique identifier for this run (`drun_...`).131132  - `agent: BetaManagedAgentsAgentReference`133134    A resolved agent reference with a concrete version.135136    - `type: "agent"`137138    - `id: string`139140    - `version: number`141142      format: int32143144  - `created_at: string`145146    A timestamp in RFC 3339 format147148    format: date-time149150  - `deployment_id: string`151152    ID of the deployment that produced this run.153154  - `error: BetaManagedAgentsEnvironmentArchivedRunError or BetaManagedAgentsAgentArchivedRunError or BetaManagedAgentsEnvironmentNotFoundRunError or 13 more or null`155156    Why the run failed to create a session. The type identifies the failure; message is human-readable detail.157158    - `BetaManagedAgentsEnvironmentArchivedRunError object`159160      The deployment's environment was archived.161162      - `type: "environment_archived_error"`163164      - `message: string`165166        Human-readable error description.167168    - `BetaManagedAgentsAgentArchivedRunError object`169170      The deployment's agent was archived.171172      - `type: "agent_archived_error"`173174      - `message: string`175176        Human-readable error description.177178    - `BetaManagedAgentsEnvironmentNotFoundRunError object`179180      The deployment's environment no longer exists.181182      - `type: "environment_not_found_error"`183184      - `message: string`185186        Human-readable error description.187188    - `BetaManagedAgentsVaultNotFoundRunError object`189190      A vault referenced by the deployment no longer exists.191192      - `type: "vault_not_found_error"`193194      - `message: string`195196        Human-readable error description.197198    - `BetaManagedAgentsVaultArchivedRunError object`199200      A vault referenced by the deployment is archived.201202      - `type: "vault_archived_error"`203204      - `message: string`205206        Human-readable error description.207208    - `BetaManagedAgentsFileNotFoundRunError object`209210      A file resource referenced by the deployment no longer exists.211212      - `type: "file_not_found_error"`213214      - `message: string`215216        Human-readable error description.217218    - `BetaManagedAgentsMemoryStoreArchivedRunError object`219220      A memory store referenced by the deployment is archived.221222      - `type: "memory_store_archived_error"`223224      - `message: string`225226        Human-readable error description.227228    - `BetaManagedAgentsSkillNotFoundRunError object`229230      A skill referenced by the deployment's agent no longer exists.231232      - `type: "skill_not_found_error"`233234      - `message: string`235236        Human-readable error description.237238    - `BetaManagedAgentsSessionResourceNotFoundRunError object`239240      A referenced resource no longer exists and its kind was not reported.241242      - `type: "session_resource_not_found_error"`243244      - `message: string`245246        Human-readable error description.247248    - `BetaManagedAgentsWorkspaceArchivedRunError object`249250      The deployment's workspace was archived.251252      - `type: "workspace_archived_error"`253254      - `message: string`255256        Human-readable error description.257258    - `BetaManagedAgentsOrganizationDisabledRunError object`259260      The deployment's organization is disabled.261262      - `type: "organization_disabled_error"`263264      - `message: string`265266        Human-readable error description.267268    - `BetaManagedAgentsSessionRateLimitedRunError object`269270      Session creation was rejected due to rate limiting. The schedule keeps firing; subsequent runs may succeed.271272      - `type: "session_rate_limited_error"`273274      - `message: string`275276        Human-readable error description.277278    - `BetaManagedAgentsSessionCreationRejectedRunError object`279280      The session create request was rejected with a non-retryable validation error.281282      - `type: "session_creation_rejected_error"`283284      - `message: string`285286        Human-readable error description.287288    - `BetaManagedAgentsUnknownRunError object`289290      An unknown or unexpected error caused the run to fail. A fallback variant; clients that do not recognize a new error type can match on message alone.291292      - `type: "unknown_error"`293294      - `message: string`295296        Human-readable error description.297298    - `BetaManagedAgentsSelfHostedResourcesUnsupportedRunError object`299300      The deployment configures resources, but its environment is self-hosted and cannot mount them.301302      - `type: "self_hosted_resources_unsupported_error"`303304      - `message: string`305306        Human-readable error description.307308    - `BetaManagedAgentsMCPEgressBlockedRunError object`309310      An MCP server host used by the deployment's agent is blocked by the environment's network policy.311312      - `type: "mcp_egress_blocked_error"`313314      - `message: string`315316        Human-readable error description.317318  - `session_id: string or null`319320    Populated on success. Null on creation failure. Exactly one of `session_id` or `error` is non-null.321322  - `trigger_context: BetaManagedAgentsTriggerContext`323324    Describes what triggered a deployment run, with trigger-specific metadata.325326    - `BetaManagedAgentsScheduleTriggerContext object`327328      The run was fired by the deployment's cron schedule.329330      - `type: "schedule"`331332      - `scheduled_at: string`333334        A timestamp in RFC 3339 format335336        format: date-time337338    - `BetaManagedAgentsManualTriggerContext object`339340      The run was started manually by creating a session directly against the deployment.341342      - `type: "manual"`343344## Example345346```bash347curl https://api.anthropic.com/v1/deployments/$DEPLOYMENT_ID/run \348    -X POST \349    -H 'anthropic-version: 2023-06-01' \350    -H 'anthropic-beta: managed-agents-2026-04-01' \351    -H "X-Api-Key: $ANTHROPIC_API_KEY"352```353354### Response (200)355356```json357{358  "id": "id",359  "agent": {360    "id": "agent_011CZkYqphY8vELVzwCUpqiQ",361    "type": "agent",362    "version": 1363  },364  "created_at": "2019-12-27T18:11:19.117Z",365  "deployment_id": "deployment_id",366  "error": {367    "message": "message",368    "type": "environment_archived_error"369  },370  "session_id": "session_id",371  "trigger_context": {372    "scheduled_at": "2019-12-27T18:11:19.117Z",373    "type": "schedule"374  },375  "type": "deployment_run"376}377```378
Files main
Menu

Theme