v1

latestOpenAPI 3.0.02026-07-174565114.3 KB
v1

Get message

Get a specific message by ID from a thread.

get/v1/threads/{threadId}/messages/{messageId}

Path parameters

threadIdstring required
Example:thr_abc123xyz

Thread ID

messageIdstring required
Example:msg_xyz789abc

Message ID

Query parameters

userKeystring

Identifier for a user in your system. Required if no bearer token is provided.

Response

Message details

idstring required

Unique identifier for this message

role'user' | 'assistant' | 'system' required

Message role

createdAtstring

When the message was created (ISO 8601)

metadataobject

Additional metadata

parentMessageIdstring

The id of the parent message, if the message was created during the generation of another message, such as during an agent call, MCP Elicitation, or MCP Sample

isCancelledboolean

Whether this message was interrupted by a run cancellation. When true, the message content may be incomplete.

Example response

{
  "id": "msg_abc123xyz",
  "role": "assistant",
  "content": [
    {
      "type": "text",
      "text": "Hello, world!"
    }
  ],
  "createdAt": "2024-01-15T12:00:00Z"
}