---
title: "POST /agents/agent-space/{agentSpaceId}/chat/sendMessage"
method: POST
path: "/agents/agent-space/{agentSpaceId}/chat/sendMessage"
---

# POST /agents/agent-space/{agentSpaceId}/chat/sendMessage

`POST /agents/agent-space/{agentSpaceId}/chat/sendMessage`

Sends a chat message and streams the response for the specified agent space execution

## Path parameters

- `agentSpaceId` string, required — Unique identifier for an agent space (allows alphanumeric characters and hyphens; 1-64 characters)

## Request body

- object
  - `executionId` string, required — Chat execution identifier — must be a valid UUID
  - `content` string, required — Message content with size constraint
  - `context` object — Context object for additional message metadata
    - `currentPage` string — The current page or view the user is on
    - `lastMessage` string — The ID of the last message in the conversation
    - `userActionResponse` string — Response to a UI prompt (not a text conversation message). Operator App SDK clients set this to the control-string sentinel `"APPROVAL_ACTION"` when the request is resuming a paused tool call after an operator approval decision; in that case the structured decision context lives on the sibling `approvalAction` member and the chat agent reads from there. Preserved as a String for back-compat: pre-typed-approval clients still encode arbitrary UI-prompt responses as JSON in this field, and the chat agent parses them out during the transition.
  - `userId` string — Generic resource identifier (allows alphanumeric characters, hyphens, and underscores; 1-128 characters)
  - `assetIds` String[] — List of asset identifiers to attach to a message

## Response `200`

Success

- SendMessageResponse — Response structure for sending chat message events
  - `events` object, required — The stream of chat message events
    - `responseCreated` object — Emitted when the response is created
      - `responseId` string — The response ID
      - `sequenceNumber` integer — Event sequence number
    - `responseInProgress` object — Emitted while the response is being generated
      - `responseId` string — The response ID
      - `sequenceNumber` integer — Event sequence number
    - `responseCompleted` object — Emitted when the response completes successfully
      - `responseId` string — The response ID
      - `usage` object — Token usage information
        - `inputTokens` integer — Number of input tokens
        - `outputTokens` integer — Number of output tokens
        - `totalTokens` integer — Total tokens used
      - `sequenceNumber` integer — Event sequence number
    - `responseFailed` object — Emitted when the response fails
      - `responseId` string — The response ID
      - `errorCode` string — Error code
      - `errorMessage` string — Error message
      - `sequenceNumber` integer — Event sequence number
    - `summary` object — Emitted to provide a summary of agent actions
      - `content` string — Summary content
      - `sequenceNumber` integer — Event sequence number
    - `heartbeat` object — Heartbeat event sent periodically to keep the connection alive during idle periods
    - `contentBlockStart` object — Emitted when a new content block starts
      - `index` integer — Zero-based index of the content block
      - `type` string — The type of content in this block
      - `id` string — Block identifier
      - `parentId` string — Optional parent block ID for nested content blocks (e.g. subagent tool calls)
      - `sequenceNumber` integer — Event sequence number
    - `contentBlockDelta` object — Emitted for each incremental content delta within a content block
      - `index` integer — Zero-based index of the content block
      - `delta` object — The incremental content delta
        - `textDelta` object — Text delta for text-based content blocks
          - `text` string — The text fragment
        - `jsonDelta` object — JSON delta for structured content blocks
          - `partialJson` string — Partial JSON string
      - `sequenceNumber` integer — Event sequence number
    - `contentBlockStop` object — Emitted when a content block is complete
      - `index` integer — Zero-based index of the content block
      - `type` string — The type of content in this block
      - `text` string — The accumulated complete content text
      - `last` boolean — Whether this is the final content block in the response
      - `sequenceNumber` integer — Event sequence number

## Other responses

- `480` — ValidationException
- `481` — ContentSizeExceededException
- `482` — ServiceQuotaExceededException
- `483` — ConflictException
- `484` — InternalServerException
- `485` — AccessDeniedException
- `486` — ResourceNotFoundException
- `487` — ThrottlingException
- `488` — InvalidParameterException

---

[API](https://skmtc.net/aws/apis/devops-agent.md) · [All operations](https://skmtc.net/aws/apis/devops-agent/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/aws/devops-agent/versions/ca2af02d3853/schema)
