On this page
runs.send_message
Send a user message to a cloud chat run
Request
POST /api/v1/runs/{run_id}/messages
- MCP:
runs_send_message - SDK:
client.runs.send_message(SDK path arguments usepath; MCP usesparams). - Minimum API key role: member.
- Idempotency: required_header. Send an
Idempotency-Keyheader; MCP usesidempotency_key. Reuse it after an unknown outcome.
Use the request schema below. Read IDs from earlier operation results.
Input schema
json
{
"parameters": [
{
"name": "run_id",
"in": "path",
"required": true,
"schema": {
"type": "string",
"format": "uuid"
}
},
{
"name": "Idempotency-Key",
"in": "header",
"required": true,
"schema": {
"type": "string",
"minLength": 1,
"maxLength": 256
}
}
],
"requestBody": {
"required": true,
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/RunsSendMessageRequest"
}
}
}
}
}
Responses
json
{
"202": {
"description": "Send a user message to a cloud chat run",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/RunsSendMessageResponse202"
}
}
}
},
"4XX": {
"description": "Typed error (ApiError)",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/ApiError"
}
}
}
},
"5XX": {
"description": "Typed error (ApiError)",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/ApiError"
}
}
}
}
}
Referenced schemas
json
{
"components": {
"schemas": {
"RunsSendMessageRequest": {
"type": "object",
"properties": {
"text": {
"type": "string",
"minLength": 1,
"maxLength": 32000
}
},
"required": [
"text"
],
"additionalProperties": false
},
"RunsSendMessageResponse202": {
"type": "object",
"properties": {
"run_id": {
"type": "string",
"format": "uuid"
},
"index": {
"type": "integer",
"minimum": 0
}
},
"required": [
"run_id",
"index"
],
"additionalProperties": false
},
"ApiError": {
"type": "object",
"properties": {
"error": {
"type": "object",
"properties": {
"code": {
"type": "string",
"enum": [
"unauthenticated",
"forbidden",
"not_found",
"conflict",
"invalid_request",
"idempotency_conflict",
"policy_denied",
"capability_unavailable",
"provider_unavailable",
"knowledge_unavailable",
"publication_invalid",
"run_not_active",
"rate_limited",
"outcome_unknown",
"internal"
]
},
"message": {
"type": "string"
},
"retryable": {
"type": "boolean"
},
"outcome": {
"type": "string",
"enum": [
"none",
"unknown"
]
},
"details": {
"type": "object",
"additionalProperties": {}
}
},
"required": [
"code",
"message",
"retryable",
"outcome"
],
"additionalProperties": false
}
},
"required": [
"error"
],
"additionalProperties": false
}
}
}
}
Errors and recovery
See API error handling and Troubleshooting.
Related guides
Content version 146ebf6eMarkdown source