Skip to content

Messages

Create Message
messages.create(MessageCreateParams**kwargs) -> TaskMessage
POST/messages
List Messages
messages.list(MessageListParams**kwargs) -> MessageListResponse
GET/messages
Update Message
messages.update(strmessage_id, MessageUpdateParams**kwargs) -> TaskMessage
PUT/messages/{message_id}
Get Message
messages.retrieve(strmessage_id) -> TaskMessage
GET/messages/{message_id}
List Messages Paginated
messages.list_paginated(MessageListPaginatedParams**kwargs) -> MessageListPaginatedResponse
GET/messages/paginated
ModelsExpand Collapse
class DataContent: …

The role of the messages author, in this case system, user, assistant, or tool.

One of the following:
"user"
"agent"
data: Dict[str, object]

The contents of the data message.

style: Optional[MessageStyle]

The style of the message. This is used by the client to determine how to display the message.

One of the following:
"static"
"active"
type: Optional[Literal["data"]]

The type of the message, in this case data.

Literal["user", "agent"]
One of the following:
"user"
"agent"
Literal["static", "active"]
One of the following:
"static"
"active"
class ReasoningContent: …

The role of the messages author, in this case system, user, assistant, or tool.

One of the following:
"user"
"agent"
summary: List[str]

A list of short reasoning summaries

content: Optional[List[str]]

The reasoning content or chain-of-thought text

style: Optional[MessageStyle]

The style of the message. This is used by the client to determine how to display the message.

One of the following:
"static"
"active"
type: Optional[Literal["reasoning"]]

The type of the message, in this case reasoning.

class TaskMessage: …

Represents a message in the agent system.

This entity is used to store messages in MongoDB, with each message associated with a specific task.

The content of the message. This content is not OpenAI compatible. These are messages that are meant to be displayed to the user.

One of the following:
class TextContent: …

The role of the messages author, in this case system, user, assistant, or tool.

One of the following:
"user"
"agent"
content: str

The contents of the text message.

attachments: Optional[List[Attachment]]

Optional list of file attachments with structured metadata.

file_id: str

The unique ID of the attached file

name: str

The name of the file

size: int

The size of the file in bytes

type: str

The MIME type or content type of the file

format: Optional[TextFormat]

The format of the message. This is used by the client to determine how to display the message.

One of the following:
"markdown"
"plain"
"code"
style: Optional[MessageStyle]

The style of the message. This is used by the client to determine how to display the message.

One of the following:
"static"
"active"
type: Optional[Literal["text"]]

The type of the message, in this case text.

class ReasoningContent: …

The role of the messages author, in this case system, user, assistant, or tool.

One of the following:
"user"
"agent"
summary: List[str]

A list of short reasoning summaries

content: Optional[List[str]]

The reasoning content or chain-of-thought text

style: Optional[MessageStyle]

The style of the message. This is used by the client to determine how to display the message.

One of the following:
"static"
"active"
type: Optional[Literal["reasoning"]]

The type of the message, in this case reasoning.

class DataContent: …

The role of the messages author, in this case system, user, assistant, or tool.

One of the following:
"user"
"agent"
data: Dict[str, object]

The contents of the data message.

style: Optional[MessageStyle]

The style of the message. This is used by the client to determine how to display the message.

One of the following:
"static"
"active"
type: Optional[Literal["data"]]

The type of the message, in this case data.

class ToolRequestContent: …
arguments: Dict[str, object]

The arguments to the tool.

The role of the messages author, in this case system, user, assistant, or tool.

One of the following:
"user"
"agent"
name: str

The name of the tool that is being requested.

tool_call_id: str

The ID of the tool call that is being requested.

style: Optional[MessageStyle]

The style of the message. This is used by the client to determine how to display the message.

One of the following:
"static"
"active"
type: Optional[Literal["tool_request"]]

The type of the message, in this case tool_request.

class ToolResponseContent: …

The role of the messages author, in this case system, user, assistant, or tool.

One of the following:
"user"
"agent"
content: object

The result of the tool.

name: str

The name of the tool that is being responded to.

tool_call_id: str

The ID of the tool call that is being responded to.

is_error: Optional[bool]

Whether the tool call resulted in an error. None when the harness does not report a status.

style: Optional[MessageStyle]

The style of the message. This is used by the client to determine how to display the message.

One of the following:
"static"
"active"
type: Optional[Literal["tool_response"]]

The type of the message, in this case tool_response.

task_id: str

ID of the task this message belongs to

id: Optional[str]

The task message’s unique id

created_at: Optional[datetime]

The timestamp when the message was created

formatdate-time
streaming_status: Optional[Literal["IN_PROGRESS", "DONE"]]
One of the following:
"IN_PROGRESS"
"DONE"
updated_at: Optional[datetime]

The timestamp when the message was last updated

formatdate-time
class TextContent: …

The role of the messages author, in this case system, user, assistant, or tool.

One of the following:
"user"
"agent"
content: str

The contents of the text message.

attachments: Optional[List[Attachment]]

Optional list of file attachments with structured metadata.

file_id: str

The unique ID of the attached file

name: str

The name of the file

size: int

The size of the file in bytes

type: str

The MIME type or content type of the file

format: Optional[TextFormat]

The format of the message. This is used by the client to determine how to display the message.

One of the following:
"markdown"
"plain"
"code"
style: Optional[MessageStyle]

The style of the message. This is used by the client to determine how to display the message.

One of the following:
"static"
"active"
type: Optional[Literal["text"]]

The type of the message, in this case text.

Literal["markdown", "plain", "code"]
One of the following:
"markdown"
"plain"
"code"
class ToolRequestContent: …
arguments: Dict[str, object]

The arguments to the tool.

The role of the messages author, in this case system, user, assistant, or tool.

One of the following:
"user"
"agent"
name: str

The name of the tool that is being requested.

tool_call_id: str

The ID of the tool call that is being requested.

style: Optional[MessageStyle]

The style of the message. This is used by the client to determine how to display the message.

One of the following:
"static"
"active"
type: Optional[Literal["tool_request"]]

The type of the message, in this case tool_request.

class ToolResponseContent: …

The role of the messages author, in this case system, user, assistant, or tool.

One of the following:
"user"
"agent"
content: object

The result of the tool.

name: str

The name of the tool that is being responded to.

tool_call_id: str

The ID of the tool call that is being responded to.

is_error: Optional[bool]

Whether the tool call resulted in an error. None when the harness does not report a status.

style: Optional[MessageStyle]

The style of the message. This is used by the client to determine how to display the message.

One of the following:
"static"
"active"
type: Optional[Literal["tool_response"]]

The type of the message, in this case tool_response.

The content of the message. This content is not OpenAI compatible. These are messages that are meant to be displayed to the user.

One of the following:
class TextContent: …

The role of the messages author, in this case system, user, assistant, or tool.

One of the following:
"user"
"agent"
content: str

The contents of the text message.

attachments: Optional[List[Attachment]]

Optional list of file attachments with structured metadata.

file_id: str

The unique ID of the attached file

name: str

The name of the file

size: int

The size of the file in bytes

type: str

The MIME type or content type of the file

format: Optional[TextFormat]

The format of the message. This is used by the client to determine how to display the message.

One of the following:
"markdown"
"plain"
"code"
style: Optional[MessageStyle]

The style of the message. This is used by the client to determine how to display the message.

One of the following:
"static"
"active"
type: Optional[Literal["text"]]

The type of the message, in this case text.

class ReasoningContent: …

The role of the messages author, in this case system, user, assistant, or tool.

One of the following:
"user"
"agent"
summary: List[str]

A list of short reasoning summaries

content: Optional[List[str]]

The reasoning content or chain-of-thought text

style: Optional[MessageStyle]

The style of the message. This is used by the client to determine how to display the message.

One of the following:
"static"
"active"
type: Optional[Literal["reasoning"]]

The type of the message, in this case reasoning.

class DataContent: …

The role of the messages author, in this case system, user, assistant, or tool.

One of the following:
"user"
"agent"
data: Dict[str, object]

The contents of the data message.

style: Optional[MessageStyle]

The style of the message. This is used by the client to determine how to display the message.

One of the following:
"static"
"active"
type: Optional[Literal["data"]]

The type of the message, in this case data.

class ToolRequestContent: …
arguments: Dict[str, object]

The arguments to the tool.

The role of the messages author, in this case system, user, assistant, or tool.

One of the following:
"user"
"agent"
name: str

The name of the tool that is being requested.

tool_call_id: str

The ID of the tool call that is being requested.

style: Optional[MessageStyle]

The style of the message. This is used by the client to determine how to display the message.

One of the following:
"static"
"active"
type: Optional[Literal["tool_request"]]

The type of the message, in this case tool_request.

class ToolResponseContent: …

The role of the messages author, in this case system, user, assistant, or tool.

One of the following:
"user"
"agent"
content: object

The result of the tool.

name: str

The name of the tool that is being responded to.

tool_call_id: str

The ID of the tool call that is being responded to.

is_error: Optional[bool]

Whether the tool call resulted in an error. None when the harness does not report a status.

style: Optional[MessageStyle]

The style of the message. This is used by the client to determine how to display the message.

One of the following:
"static"
"active"
type: Optional[Literal["tool_response"]]

The type of the message, in this case tool_response.

task_id: str

ID of the task this message belongs to

id: Optional[str]

The task message’s unique id

created_at: Optional[datetime]

The timestamp when the message was created

formatdate-time
streaming_status: Optional[Literal["IN_PROGRESS", "DONE"]]
One of the following:
"IN_PROGRESS"
"DONE"
updated_at: Optional[datetime]

The timestamp when the message was last updated

formatdate-time
class MessageListPaginatedResponse: …

Response with cursor pagination metadata.

data: List[TaskMessage]

List of messages

The content of the message. This content is not OpenAI compatible. These are messages that are meant to be displayed to the user.

One of the following:
class TextContent: …

The role of the messages author, in this case system, user, assistant, or tool.

One of the following:
"user"
"agent"
content: str

The contents of the text message.

attachments: Optional[List[Attachment]]

Optional list of file attachments with structured metadata.

file_id: str

The unique ID of the attached file

name: str

The name of the file

size: int

The size of the file in bytes

type: str

The MIME type or content type of the file

format: Optional[TextFormat]

The format of the message. This is used by the client to determine how to display the message.

One of the following:
"markdown"
"plain"
"code"
style: Optional[MessageStyle]

The style of the message. This is used by the client to determine how to display the message.

One of the following:
"static"
"active"
type: Optional[Literal["text"]]

The type of the message, in this case text.

class ReasoningContent: …

The role of the messages author, in this case system, user, assistant, or tool.

One of the following:
"user"
"agent"
summary: List[str]

A list of short reasoning summaries

content: Optional[List[str]]

The reasoning content or chain-of-thought text

style: Optional[MessageStyle]

The style of the message. This is used by the client to determine how to display the message.

One of the following:
"static"
"active"
type: Optional[Literal["reasoning"]]

The type of the message, in this case reasoning.

class DataContent: …

The role of the messages author, in this case system, user, assistant, or tool.

One of the following:
"user"
"agent"
data: Dict[str, object]

The contents of the data message.

style: Optional[MessageStyle]

The style of the message. This is used by the client to determine how to display the message.

One of the following:
"static"
"active"
type: Optional[Literal["data"]]

The type of the message, in this case data.

class ToolRequestContent: …
arguments: Dict[str, object]

The arguments to the tool.

The role of the messages author, in this case system, user, assistant, or tool.

One of the following:
"user"
"agent"
name: str

The name of the tool that is being requested.

tool_call_id: str

The ID of the tool call that is being requested.

style: Optional[MessageStyle]

The style of the message. This is used by the client to determine how to display the message.

One of the following:
"static"
"active"
type: Optional[Literal["tool_request"]]

The type of the message, in this case tool_request.

class ToolResponseContent: …

The role of the messages author, in this case system, user, assistant, or tool.

One of the following:
"user"
"agent"
content: object

The result of the tool.

name: str

The name of the tool that is being responded to.

tool_call_id: str

The ID of the tool call that is being responded to.

is_error: Optional[bool]

Whether the tool call resulted in an error. None when the harness does not report a status.

style: Optional[MessageStyle]

The style of the message. This is used by the client to determine how to display the message.

One of the following:
"static"
"active"
type: Optional[Literal["tool_response"]]

The type of the message, in this case tool_response.

task_id: str

ID of the task this message belongs to

id: Optional[str]

The task message’s unique id

created_at: Optional[datetime]

The timestamp when the message was created

formatdate-time
streaming_status: Optional[Literal["IN_PROGRESS", "DONE"]]
One of the following:
"IN_PROGRESS"
"DONE"
updated_at: Optional[datetime]

The timestamp when the message was last updated

formatdate-time
has_more: Optional[bool]

Whether there are more messages to fetch

next_cursor: Optional[str]

Cursor for fetching the next page of older messages

MessagesBatch

Batch Update Messages
messages.batch.update(BatchUpdateParams**kwargs) -> BatchUpdateResponse
PUT/messages/batch
Batch Create Messages
messages.batch.create(BatchCreateParams**kwargs) -> BatchCreateResponse
POST/messages/batch
ModelsExpand Collapse

The content of the message. This content is not OpenAI compatible. These are messages that are meant to be displayed to the user.

One of the following:
class TextContent: …

The role of the messages author, in this case system, user, assistant, or tool.

One of the following:
"user"
"agent"
content: str

The contents of the text message.

attachments: Optional[List[Attachment]]

Optional list of file attachments with structured metadata.

file_id: str

The unique ID of the attached file

name: str

The name of the file

size: int

The size of the file in bytes

type: str

The MIME type or content type of the file

format: Optional[TextFormat]

The format of the message. This is used by the client to determine how to display the message.

One of the following:
"markdown"
"plain"
"code"
style: Optional[MessageStyle]

The style of the message. This is used by the client to determine how to display the message.

One of the following:
"static"
"active"
type: Optional[Literal["text"]]

The type of the message, in this case text.

class ReasoningContent: …

The role of the messages author, in this case system, user, assistant, or tool.

One of the following:
"user"
"agent"
summary: List[str]

A list of short reasoning summaries

content: Optional[List[str]]

The reasoning content or chain-of-thought text

style: Optional[MessageStyle]

The style of the message. This is used by the client to determine how to display the message.

One of the following:
"static"
"active"
type: Optional[Literal["reasoning"]]

The type of the message, in this case reasoning.

class DataContent: …

The role of the messages author, in this case system, user, assistant, or tool.

One of the following:
"user"
"agent"
data: Dict[str, object]

The contents of the data message.

style: Optional[MessageStyle]

The style of the message. This is used by the client to determine how to display the message.

One of the following:
"static"
"active"
type: Optional[Literal["data"]]

The type of the message, in this case data.

class ToolRequestContent: …
arguments: Dict[str, object]

The arguments to the tool.

The role of the messages author, in this case system, user, assistant, or tool.

One of the following:
"user"
"agent"
name: str

The name of the tool that is being requested.

tool_call_id: str

The ID of the tool call that is being requested.

style: Optional[MessageStyle]

The style of the message. This is used by the client to determine how to display the message.

One of the following:
"static"
"active"
type: Optional[Literal["tool_request"]]

The type of the message, in this case tool_request.

class ToolResponseContent: …

The role of the messages author, in this case system, user, assistant, or tool.

One of the following:
"user"
"agent"
content: object

The result of the tool.

name: str

The name of the tool that is being responded to.

tool_call_id: str

The ID of the tool call that is being responded to.

is_error: Optional[bool]

Whether the tool call resulted in an error. None when the harness does not report a status.

style: Optional[MessageStyle]

The style of the message. This is used by the client to determine how to display the message.

One of the following:
"static"
"active"
type: Optional[Literal["tool_response"]]

The type of the message, in this case tool_response.

task_id: str

ID of the task this message belongs to

id: Optional[str]

The task message’s unique id

created_at: Optional[datetime]

The timestamp when the message was created

formatdate-time
streaming_status: Optional[Literal["IN_PROGRESS", "DONE"]]
One of the following:
"IN_PROGRESS"
"DONE"
updated_at: Optional[datetime]

The timestamp when the message was last updated

formatdate-time

The content of the message. This content is not OpenAI compatible. These are messages that are meant to be displayed to the user.

One of the following:
class TextContent: …

The role of the messages author, in this case system, user, assistant, or tool.

One of the following:
"user"
"agent"
content: str

The contents of the text message.

attachments: Optional[List[Attachment]]

Optional list of file attachments with structured metadata.

file_id: str

The unique ID of the attached file

name: str

The name of the file

size: int

The size of the file in bytes

type: str

The MIME type or content type of the file

format: Optional[TextFormat]

The format of the message. This is used by the client to determine how to display the message.

One of the following:
"markdown"
"plain"
"code"
style: Optional[MessageStyle]

The style of the message. This is used by the client to determine how to display the message.

One of the following:
"static"
"active"
type: Optional[Literal["text"]]

The type of the message, in this case text.

class ReasoningContent: …

The role of the messages author, in this case system, user, assistant, or tool.

One of the following:
"user"
"agent"
summary: List[str]

A list of short reasoning summaries

content: Optional[List[str]]

The reasoning content or chain-of-thought text

style: Optional[MessageStyle]

The style of the message. This is used by the client to determine how to display the message.

One of the following:
"static"
"active"
type: Optional[Literal["reasoning"]]

The type of the message, in this case reasoning.

class DataContent: …

The role of the messages author, in this case system, user, assistant, or tool.

One of the following:
"user"
"agent"
data: Dict[str, object]

The contents of the data message.

style: Optional[MessageStyle]

The style of the message. This is used by the client to determine how to display the message.

One of the following:
"static"
"active"
type: Optional[Literal["data"]]

The type of the message, in this case data.

class ToolRequestContent: …
arguments: Dict[str, object]

The arguments to the tool.

The role of the messages author, in this case system, user, assistant, or tool.

One of the following:
"user"
"agent"
name: str

The name of the tool that is being requested.

tool_call_id: str

The ID of the tool call that is being requested.

style: Optional[MessageStyle]

The style of the message. This is used by the client to determine how to display the message.

One of the following:
"static"
"active"
type: Optional[Literal["tool_request"]]

The type of the message, in this case tool_request.

class ToolResponseContent: …

The role of the messages author, in this case system, user, assistant, or tool.

One of the following:
"user"
"agent"
content: object

The result of the tool.

name: str

The name of the tool that is being responded to.

tool_call_id: str

The ID of the tool call that is being responded to.

is_error: Optional[bool]

Whether the tool call resulted in an error. None when the harness does not report a status.

style: Optional[MessageStyle]

The style of the message. This is used by the client to determine how to display the message.

One of the following:
"static"
"active"
type: Optional[Literal["tool_response"]]

The type of the message, in this case tool_response.

task_id: str

ID of the task this message belongs to

id: Optional[str]

The task message’s unique id

created_at: Optional[datetime]

The timestamp when the message was created

formatdate-time
streaming_status: Optional[Literal["IN_PROGRESS", "DONE"]]
One of the following:
"IN_PROGRESS"
"DONE"
updated_at: Optional[datetime]

The timestamp when the message was last updated

formatdate-time