Deployments.ai Docs
Runtime

Submit a turn to a preview

POST /v1/previews/{previewId}/turns · SDK submitPreviewTurn · CLI deployments preview turn

POST
/v1/previews/{previewId}/turns

Requires runs:write.

Authorization

headerAuthorizationBearer <token>

Opaque bearer credential scoped to one service account and tenant.

Path Parameters

previewId*string
Match^[0-7][0-9A-HJKMNP-TV-Z]{25}$

Header Parameters

x-deployments-environment?string

Required with a platform bearer JWT, where the three tenant headers select an environment the caller can access through active organization membership. Optional with an API key; when supplied, it must match the key's tenant.

Match^[0-7][0-9A-HJKMNP-TV-Z]{25}$
x-deployments-organization?string

Required with a platform bearer JWT, where the three tenant headers select an environment the caller can access through active organization membership. Optional with an API key; when supplied, it must match the key's tenant.

Match^[0-7][0-9A-HJKMNP-TV-Z]{25}$
x-deployments-project?string

Required with a platform bearer JWT, where the three tenant headers select an environment the caller can access through active organization membership. Optional with an API key; when supplied, it must match the key's tenant.

Match^[0-7][0-9A-HJKMNP-TV-Z]{25}$
idempotency-key*string

Must contain 1–256 UTF-8 bytes with no surrounding whitespace or control characters (U+0000–U+001F and U+007F); maxLength is only a character-count approximation.

Match^(?!\s)(?!.*\s$)[^\u0000-\u001F\u007F]+$
Length1 <= length <= 256

Request Body

application/json
  1. body
content*string
Match^\S[\s\S]*\S$|^\S$|^$
Length1 <= length
responseFormat?
threadId?string
Match^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$

Response Body

SubmitAgentRunResponse

application/json
  1. response
created*boolean
message*
run*
thread*
curl -X POST "https://example.com/v1/previews/string/turns" \  -H "idempotency-key: string" \  -H "Content-Type: application/json" \  -d '{    "content": "string"  }'
{  "created": true,  "message": {    "environmentId": "string",    "organizationId": "string",    "projectId": "string",    "agentDeploymentId": "string",    "body": "string",    "bodyAccess": {      "byteSize": 0,      "contentType": "string",      "expiresAt": "2019-08-24T14:15:22Z",      "sha256": "string",      "url": "string"    },    "contentHash": "string",    "createdAt": "2019-08-24T14:15:22Z",    "id": "string",    "inputArtifacts": [      "string"    ],    "inputOmissions": [      {        "name": "string",        "reason": "too_large"      }    ],    "metadata": {      "property1": null,      "property2": null    },    "object": "message",    "role": "assistant",    "runId": "string",    "sequence": 0,    "streamEventId": "string",    "threadId": "string",    "unlistedInputOmissions": 1  },  "run": {    "createdAt": "2019-08-24T14:15:22Z",    "updatedAt": "2019-08-24T14:15:22Z",    "version": 0,    "environmentId": "string",    "organizationId": "string",    "projectId": "string",    "workspaceId": "string",    "agentDeploymentId": "string",    "agentReleaseId": "string",    "attempt": 0,    "automation": {      "fireId": "string",      "id": "string",      "kind": "heartbeat"    },    "checkpointCount": 0,    "completedAt": "2019-08-24T14:15:22Z",    "error": {      "property1": null,      "property2": null    },    "executionBindingId": "string",    "executionPurpose": "customer",    "executor": "string",    "id": "string",    "object": "run",    "parentSpanId": "string",    "priority": 0,    "releaseSelection": "candidate",    "replayedFromRunId": "string",    "replayedFromTraceId": "string",    "spanId": "string",    "startedAt": "2019-08-24T14:15:22Z",    "status": "canceled",    "threadId": "string",    "traceId": "string",    "trigger": "string"  },  "thread": {    "createdAt": "2019-08-24T14:15:22Z",    "updatedAt": "2019-08-24T14:15:22Z",    "version": 0,    "environmentId": "string",    "organizationId": "string",    "projectId": "string",    "workspaceId": "string",    "agentDeploymentId": "string",    "archived": true,    "channel": "string",    "continuedFromThreadId": "string",    "createdBy": {      "id": "string",      "type": "agent"    },    "executionBindingId": "string",    "executionPurpose": "customer",    "externalThreadKey": "string",    "id": "string",    "object": "thread",    "pinned": true,    "pinnedAgentReleaseId": "string",    "streamId": "string",    "title": "string"  }}