Skip to main content
POST /v1/deployments/{id} Updates a deployment with merge-patch semantics. Only fields included in the request body are modified; omitted fields retain their current values.
This endpoint uses POST (not PATCH) for CMA alignment. Only provided fields are applied as a partial update.

Path parameters

ParameterTypeDescription
idstringDeployment ID with the dep_ prefix

Headers

HeaderRequiredDescription
AuthorizationYesBearer $QODER_PAT
Content-TypeYesapplication/json

Request body

All fields are optional. Only include fields you want to change.
FieldTypeDescription
namestringNew name (max 256 characters)
descriptionstringNew description
agentstring or objectNew Agent reference (string ID or {id, type, version} object)
environment_idstringNew Environment ID
scheduleobjectUpdated schedule config (must include all sub-fields: type, expression, timezone)
initial_eventsarrayNew initial events array (1–50 events)
resourcesarrayUpdated resources
vault_idsarrayUpdated vault IDs
metadataobjectMerge-patch metadata (key→value upserts, key→null deletes)

Example request

curl -X POST "https://api.qoder.com/api/v1/cloud/deployments/dep_019ec556114c78f8b60ee34fcb98bf59" \
  -H "Authorization: Bearer $QODER_PAT" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "api-doc-verification-deployment-v2",
    "schedule": {
      "type": "cron",
      "expression": "30 9 * * 1-5",
      "timezone": "Asia/Shanghai"
    }
  }'

Example response

HTTP 200 OK Returns the full updated Deployment object.
{
  "agent": {
    "id": "agent_019eb4d4a06d747c865d5800b9c57ae2",
    "type": "agent",
    "version": 1
  },
  "archived_at": null,
  "created_at": "2026-06-14T08:53:32Z",
  "description": "Deployment created for API documentation verification",
  "environment_id": "env_019e64e01a137caf953ac2ac7b42ec5c",
  "id": "dep_019ec556114c78f8b60ee34fcb98bf59",
  "initial_events": [
    {
      "content": "Generate today's status report",
      "type": "user.message"
    }
  ],
  "metadata": {
    "cas_config": {
      "config": {
        "max_concurrent": 1,
        "max_retries": 0,
        "timeout_ms": 300000
      },
      "session_strategy": "new_session",
      "stats": {
        "consecutive_failures": 0,
        "next_trigger_at": "2026-06-15T01:30:00Z",
        "total_failures": 0,
        "total_runs": 0
      }
    }
  },
  "name": "api-doc-verification-deployment-v2",
  "paused_reason": null,
  "resources": [],
  "schedule": {
    "expression": "30 9 * * 1-5",
    "timezone": "Asia/Shanghai",
    "type": "cron",
    "upcoming_runs_at": [
      "2026-06-15T01:30:00Z",
      "2026-06-16T01:30:00Z",
      "2026-06-17T01:30:00Z",
      "2026-06-18T01:30:00Z",
      "2026-06-19T01:30:00Z"
    ]
  },
  "status": "active",
  "type": "deployment",
  "updated_at": "2026-06-14T08:54:05Z",
  "vault_ids": []
}

Errors

HTTPTypeTrigger
400invalid_request_errorInvalid field value, empty name, invalid cron expression, or referenced Agent/Environment is archived
401authentication_errorPAT invalid or expired
404not_found_errorDeployment does not exist
See Errors for the full error envelope.

Get a deployment

Retrieve details for a single deployment.

Pause a deployment

Pause scheduling while preserving configuration.

Archive a deployment

Terminate the deployment and stop all scheduling.

Errors reference

All API error codes and the error envelope convention.