Skip to main content

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 Overview and authentication.

Endpoint

POST /deployments

Request body

FieldRequiredTypeDescription
nameYesstringDeployment name, max 256 characters
descriptionNostringDescription of the deployment's purpose
agentYesobjectAssociated Agent. Contains id (string, required) and version (integer; locks to a specific Agent version; omit to use the latest version)
environment_idNostringAssociated Environment ID
scheduleNoobjectSchedule trigger configuration; omit for manual trigger. Contains type (cron), expression (cron expression), and timezone
initial_eventsYesarray<object>Initial events sent to the Agent on trigger, 1–50 items
resourcesNoarray<object>Mounted file resources. Each item contains type (file), file_id, and mount_path
vault_idsNoarray<string>Associated Vault ID list
metadataNoobjectCustom 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 yesterday's order data"
          }
        ]
      }
    ]
  }'

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 yesterday's order data"
        }
      ]
    }
  ],
  "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"
}

Response fields

FieldTypeDescription
idstringDeployment ID
typestringAlways deployment
namestringDeployment name
descriptionstringDeployment purpose description
agentobjectSnapshot of the associated Agent at the locked version; contains id, type, version, name, description, model, system, tools, skills, mcp_servers
environment_idstringAssociated Environment ID
scheduleobjectSchedule trigger configuration. Contains type, expression, timezone, last_run_at (string | null), next_run_at (string | null)
initial_eventsarray<object>Initial events sent to the Agent on trigger
resourcesarray<object>Mounted file resources; each item has type, file_id, mount_path
vault_idsarray<string>Associated Vault ID list
metadataobjectCustom key-value pairs
statusstringDeployment status: active or paused
paused_reasonobject | nullPause reason; returned only when the status is paused
archived_atstring | nullArchive timestamp; null if not archived
created_atstringCreation time, ISO 8601
updated_atstringLast update time, ISO 8601
request_idstringUnique request identifier

Error codes

HTTP statusError codeDescription
400InvalidParameterRequired parameter missing or invalid
401InvalidApiKeyInvalid API key provided
Flow Agent API
Sandbox API
RAG API
Long-term Memory
ParseX API
Security API
Framework Integration