The whole hunk
from line 17, old and new numbered
/
lines
from line 17
1717When creating a deployment, you pass the [session configurations](https://platform.claude.com/docs/en/managed-agents/sessions) required for execution, in addition to a `schedule`.
1818
1919* Deployments require [agent configuration](https://platform.claude.com/docs/en/managed-agents/agent-setup) and [environment configuration](https://platform.claude.com/docs/en/managed-agents/environments), and optionally accept [files](https://platform.claude.com/docs/en/managed-agents/files), [GitHub](https://platform.claude.com/docs/en/managed-agents/github), [memory stores](https://platform.claude.com/docs/en/managed-agents/memory), and [vaults](https://platform.claude.com/docs/en/managed-agents/vaults). A deployment that targets a [self-hosted environment](https://platform.claude.com/docs/en/managed-agents/self-hosted-sandboxes#use-memory-stores) can attach memory stores; `file` and `github_repository` resources require a cloud environment. The Claude Console deployment form does not currently offer memory stores for self-hosted environments; attach them through the API or an SDK instead.
20* Deployments also require at least one initial event, a `user.message` or `user.define_outcome`, that starts each session's work.
20* Deployments also require at least one initial event, a `user.message` or `user.define_outcome`, that starts each session's work. In a deployment file for `ant apply`, the text below the frontmatter becomes that `user.message`.
2121* In the `schedule`, you define a cron `expression` and a `timezone`. Maximum granularity supported is at the minute level.
2222
23<CodeGroup>
23<CodeGroup defaultLanguage="CLI">
2424 ```bash cURL
2525 curl --fail-with-body -sS "https://api.anthropic.com/v1/deployments?beta=true" \
2626 -H "x-api-key: $ANTHROPIC_API_KEY" \
from line 44
4444 EOF
4545 ```
4646
47 ```bash CLI
48 ant beta:deployments create <<YAML
49 name: Weekly compliance scan
50 agent: $AGENT_ID
51 environment_id: $ENVIRONMENT_ID
52 initial_events:
53 - type: user.message
54 content:
55 - type: text
56 text: Run the weekly compliance scan.
57 schedule:
58 type: cron
59 expression: "0 20 * * 5"
60 timezone: America/New_York
61 YAML
62 ```
47 <MultiFileExample language="cli" label="CLI">
48 ```bash CLI
49 ant apply deployment.md
50 ```
6351
52 <File filename="deployment.md">
53 ```markdown
54 ---
55 name: Weekly compliance scan
56 agent: agent_011CYm1BLqPXpQRk5khsSXrs
57 environment_id: env_01595EKxaaTTGwwY3kyXdtbs
58 schedule:
59 type: cron
60 expression: "0 20 * * 5"
61 timezone: America/New_York
62 ---
63
64 Run the weekly compliance scan.
65 ```
66 </File>
67 </MultiFileExample>
68
6469 ```python Python
6570 deployment = client.beta.deployments.create(
6671 name="Weekly compliance scan",
from line 221
216221 }
217222 )
218223 ```
224
225 <ForLanguage tab="CLI">
226 [`ant apply`](https://platform.claude.com/docs/en/cli-sdks-libraries/cli/apply) prints the new deployment's ID and records it in `claude-lock.json`. To see the deployment object, run `ant beta:deployments retrieve`.
227 </ForLanguage>
219228</CodeGroup>
220229
221230The response includes a deployment object with a populated `schedule.upcoming_runs_at` with the next upcoming fire times, to confirm your schedule was set correctly.