The whole hunk
from line 20, old and new numbered
/
lines
from line 20
2020* Deployments also require at least one initial event, a `user.message` or `user.define_outcome`, that starts each session's work.
2121* In the `schedule`, you define a cron `expression` and a `timezone`. Maximum granularity supported is at the minute level.
2222
23<CodeGroup defaultLanguage="CLI">
23<CodeGroup>
2424 ```bash cURL
25 DEPLOYMENT_ID=$(
26 curl --fail-with-body -sS "https://api.anthropic.com/v1/deployments?beta=true" \
27 -H "x-api-key: $ANTHROPIC_API_KEY" \
28 -H "anthropic-version: 2023-06-01" \
29 -H "anthropic-beta: managed-agents-2026-04-01" \
30 -H "content-type: application/json" \
31 -d @- <<EOF | jq -er '.id'
25 curl --fail-with-body -sS "https://api.anthropic.com/v1/deployments?beta=true" \
26 -H "x-api-key: $ANTHROPIC_API_KEY" \
27 -H "anthropic-version: 2023-06-01" \
28 -H "anthropic-beta: managed-agents-2026-04-01" \
29 -H "content-type: application/json" \
30 -d @- <<EOF
3231 {
3332 "name": "Weekly compliance scan",
3433 "agent": "$AGENT_ID",
from line 42
4342 }
4443 }
4544 EOF
46 )
4745 ```
4846
4947 ```bash CLI
50 DEPLOYMENT_ID=$(ant beta:deployments create <<YAML | jq -er '.id'
48 ant beta:deployments create <<YAML
5149 name: Weekly compliance scan
5250 agent: $AGENT_ID
5351 environment_id: $ENVIRONMENT_ID
from line 59
6159 expression: "0 20 * * 5"
6260 timezone: America/New_York
6361 YAML
64 )
6562 ```
6663
6764 ```python Python
from line 287
290287
291288List all deployment runs for a deployment as follows:
292289
293<CodeGroup defaultLanguage="CLI">
290<CodeGroup>
294291 ```bash cURL
295292 curl --fail-with-body -sS "https://api.anthropic.com/v1/deployment_runs?beta=true&deployment_id=$DEPLOYMENT_ID" \
296293 -H "x-api-key: $ANTHROPIC_API_KEY" \
from line 376
379376
380377You can additionally filter on deployment runs with errors:
381378
382<CodeGroup defaultLanguage="CLI">
379<CodeGroup>
383380 ```bash cURL
384381 curl --fail-with-body -sS "https://api.anthropic.com/v1/deployment_runs?beta=true&deployment_id=$DEPLOYMENT_ID&has_error=true" \
385382 -H "x-api-key: $ANTHROPIC_API_KEY" \
from line 486
489486
490487**Pause** suppresses scheduled triggers on a go-forward basis; running sessions from a prior deployment run continue to execute. Manual runs through the `run` endpoint are still allowed while paused. Pausing sets `paused_reason` to `{"type": "manual"}`; unpausing clears it.
491488
492<CodeGroup defaultLanguage="CLI">
489<CodeGroup>
493490 ```bash cURL
494491 curl --fail-with-body -sS -X POST "https://api.anthropic.com/v1/deployments/$DEPLOYMENT_ID/pause?beta=true" \
495492 -H "x-api-key: $ANTHROPIC_API_KEY" \
from line 531
534531
535532**Unpause** resumes the schedule from the next scheduled occurrence. Missed triggers are not backfilled.
536533
537<CodeGroup defaultLanguage="CLI">
534<CodeGroup>
538535 ```bash cURL
539536 curl --fail-with-body -sS -X POST "https://api.anthropic.com/v1/deployments/$DEPLOYMENT_ID/unpause?beta=true" \
540537 -H "x-api-key: $ANTHROPIC_API_KEY" \
from line 576
579576
580577**Archive**, unlike **pause**, is terminal: the schedule terminates and the deployment cannot be modified.
581578
582<CodeGroup defaultLanguage="CLI">
579<CodeGroup>
583580 ```bash cURL
584581 curl --fail-with-body -sS -X POST "https://api.anthropic.com/v1/deployments/$DEPLOYMENT_ID/archive?beta=true" \
585582 -H "x-api-key: $ANTHROPIC_API_KEY" \
from line 629
632629
633630To run a deployment outside its schedule, call the [`run` endpoint](https://platform.claude.com/docs/en/api/beta/deployments/run). This creates a session immediately and writes a deployment run with `trigger_context.type: "manual"`. This allows you to test a deployment before committing to the schedule.
634631
635<CodeGroup defaultLanguage="CLI">
632<CodeGroup>
636633 ```bash cURL
637634 curl --fail-with-body -sS -X POST "https://api.anthropic.com/v1/deployments/$DEPLOYMENT_ID/run?beta=true" \
638635 -H "x-api-key: $ANTHROPIC_API_KEY" \