Create Deployment
Creates a new Deployment, binding an Agent and configuring the trigger method. The request body carries the Agent reference, schedule, and initial events; the response returns the complete Deployment object.
Prerequisites
Endpoint and authentication configured. For details, see API overview and authentication.
Endpoint
/deploymentsRequest body
namestringRequiredDeployment name, max 256 characters
descriptionstringOptionalDescription of the deployment purpose
agentobjectRequiredAssociated Agent
environment_idstringOptionalAssociated Environment ID
scheduleobjectOptionalScheduled trigger configuration; omit for manual trigger
initial_eventsarray<object>RequiredList of initial events sent to the Agent on trigger, 1-50 items
resourcesarray<object>OptionalList of mounted file resources
vault_idsarray<string>OptionalAssociated Vault ID list
metadataobjectOptionalBusiness custom key-value pairs
Request example
curl -X POST "$AGENTSTUDIO_URL/deployments" \
-H "Authorization: Bearer $DASHSCOPE_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"name": "Daily order summary",
"agent": {
"id": "agent_xxx",
"version": 12
},
"environment_id": "env_xxx",
"schedule": {
"type": "cron",
"expression": "0 9 * * 1-5",
"timezone": "Asia/Shanghai"
},
"initial_events": [
{
"type": "message",
"role": "user",
"content": [
{
"type": "text",
"text": "Summarize order data from yesterday"
}
]
}
]
}'
Response fields
idstringDeployment ID
typestringFixed value deployment
namestringDeployment name
descriptionstringDescription of the deployment purpose
agentobjectAssociated Agent
environment_idstringAssociated Environment ID
scheduleobjectSchedule configuration; omit for manual trigger
initial_eventsarray<object>Initial events sent to the Agent when triggered, 1-50 items
resourcesarray<object>Mounted file resources
vault_idsarray<string>Associated Vault IDs
metadataobjectBusiness metadata
statusstringResource status
paused_reasonobject | nullPause reason, returned only when the status is paused
archived_atstring | nullArchive time; null if not archived
created_atstringCreation time, ISO 8601
updated_atstringLast update time, ISO 8601
request_idstringUnique identifier of this request, include it when troubleshooting
Response example
{
"id": "depl_xxx",
"type": "deployment",
"name": "Daily order summary",
"status": "active",
"agent": {
"id": "agent_xxx",
"version": 12
},
"environment_id": "env_xxx",
"schedule": {
"type": "cron",
"expression": "0 9 * * 1-5",
"timezone": "Asia/Shanghai",
"last_run_at": null,
"next_run_at": "2026-07-28T01:00:00Z"
},
"initial_events": [
{
"type": "message",
"role": "user",
"content": [
{
"type": "text",
"text": "Summarize order data from yesterday"
}
]
}
],
"resources": [],
"vault_ids": [],
"metadata": {},
"paused_reason": null,
"archived_at": null,
"created_at": "2026-07-28T01:00:00Z",
"updated_at": "2026-07-28T01:00:00Z",
"request_id": "req_xxx"
}
Error codes
| HTTP status | Error code | Description |
|---|---|---|
| 400 | InvalidParameter | Required parameter missing or invalid. |
| 401 | InvalidApiKey | Invalid API-key provided. |