Messages
Get all messages for a specific conversation branch.
The branch is determined by the conversation's last_message_id.
API Key. Learn how to get it.
Successful Response
Validation Error
GET /projects/{project_id}/conversations/{conversation_id}/messages HTTP/1.1
Host: api.stack-ai.com
X-API-Key: YOUR_API_KEY
Accept: */*
{
"data": [
{
"id": "text",
"type": "message",
"created_at": 1,
"parent_id": "text",
"metadata": {
"ANY_ADDITIONAL_PROPERTY": "anything"
},
"conversation_id": "text",
"role": "user",
"content": [
{
"type": "text",
"text": "text"
}
],
"attachments": [
{
"id": "text",
"type": "image",
"name": "text",
"content_type": "text",
"url": "text"
}
]
}
],
"has_more": true,
"first_id": "text",
"last_id": "text"
}Append multiple messages to a given conversation.
If the conversation does not exist, it will be created with the first messages.
Args: conversation_id: ID of the conversation to append messages to project_id: ID of the project the conversation belongs to body: AppendMessagesBody message_service: Message service dependency conversation_service: Conversation service dependency
Returns: The list of appended messages
API Key. Learn how to get it.
Successful Response
Validation Error
POST /projects/{project_id}/conversations/{conversation_id}/messages HTTP/1.1
Host: api.stack-ai.com
X-API-Key: YOUR_API_KEY
Content-Type: application/json
Accept: */*
Content-Length: 346
{
"messages": [
{
"id": "text",
"type": "message",
"created_at": "2025-11-28T01:31:19.335Z",
"parent_id": "text",
"metadata": {
"ANY_ADDITIONAL_PROPERTY": "anything"
},
"conversation_id": "text",
"role": "user",
"content": [
{
"type": "text",
"text": "text"
}
],
"attachments": [
{
"id": "text",
"type": "image",
"name": "text",
"content_type": "text",
"url": "text"
}
]
}
],
"user_id": "text"
}[
{
"id": "text",
"type": "message",
"created_at": 1,
"parent_id": "text",
"metadata": {
"ANY_ADDITIONAL_PROPERTY": "anything"
},
"conversation_id": "text",
"role": "user",
"content": [
{
"type": "text",
"text": "text"
}
],
"attachments": [
{
"id": "text",
"type": "image",
"name": "text",
"content_type": "text",
"url": "text"
}
]
}
]Get all messages for a specific conversation branch.
The branch is determined by the conversation's last_message_id.
Successful Response
Validation Error
GET /projects/{project_id}/conversations/sso/{conversation_id}/messages HTTP/1.1
Host: api.stack-ai.com
Authorization: Bearer YOUR_OAUTH2_TOKEN
Accept: */*
{
"data": [
{
"id": "text",
"type": "message",
"created_at": 1,
"parent_id": "text",
"metadata": {
"ANY_ADDITIONAL_PROPERTY": "anything"
},
"conversation_id": "text",
"role": "user",
"content": [
{
"type": "text",
"text": "text"
}
],
"attachments": [
{
"id": "text",
"type": "image",
"name": "text",
"content_type": "text",
"url": "text"
}
]
}
],
"has_more": true,
"first_id": "text",
"last_id": "text"
}Append multiple messages to a given conversation.
If the conversation does not exist, it will be created with the first messages.
Args: conversation_id: ID of the conversation to append messages to project_id: ID of the project the conversation belongs to body: AppendMessagesBody message_service: Message service dependency conversation_service: Conversation service dependency
Returns: The list of appended messages
Successful Response
Validation Error
POST /projects/{project_id}/conversations/sso/{conversation_id}/messages HTTP/1.1
Host: api.stack-ai.com
Authorization: Bearer YOUR_OAUTH2_TOKEN
Content-Type: application/json
Accept: */*
Content-Length: 346
{
"messages": [
{
"id": "text",
"type": "message",
"created_at": "2025-11-28T01:31:19.335Z",
"parent_id": "text",
"metadata": {
"ANY_ADDITIONAL_PROPERTY": "anything"
},
"conversation_id": "text",
"role": "user",
"content": [
{
"type": "text",
"text": "text"
}
],
"attachments": [
{
"id": "text",
"type": "image",
"name": "text",
"content_type": "text",
"url": "text"
}
]
}
],
"user_id": "text"
}[
{
"id": "text",
"type": "message",
"created_at": 1,
"parent_id": "text",
"metadata": {
"ANY_ADDITIONAL_PROPERTY": "anything"
},
"conversation_id": "text",
"role": "user",
"content": [
{
"type": "text",
"text": "text"
}
],
"attachments": [
{
"id": "text",
"type": "image",
"name": "text",
"content_type": "text",
"url": "text"
}
]
}
]API Key. Learn how to get it.
Successful Response
Validation Error
PATCH /projects/{project_id}/messages/{message_id}/feedback HTTP/1.1
Host: api.stack-ai.com
X-API-Key: YOUR_API_KEY
Content-Type: application/json
Accept: */*
Content-Length: 36
{
"type": "positive",
"comment": "text"
}{
"id": "text",
"type": "message",
"created_at": 1,
"parent_id": "text",
"metadata": {
"ANY_ADDITIONAL_PROPERTY": "anything"
},
"conversation_id": "text",
"role": "user",
"content": [
{
"type": "text",
"text": "text"
}
],
"attachments": [
{
"id": "text",
"type": "image",
"name": "text",
"content_type": "text",
"url": "text"
}
]
}Token for authorization
Successful Response
Validation Error
PATCH /projects/{project_id}/messages/sso/{message_id}/feedback?token=text HTTP/1.1
Host: api.stack-ai.com
Authorization: Bearer YOUR_OAUTH2_TOKEN
Content-Type: application/json
Accept: */*
Content-Length: 36
{
"type": "positive",
"comment": "text"
}{
"id": "text",
"type": "message",
"created_at": 1,
"parent_id": "text",
"metadata": {
"ANY_ADDITIONAL_PROPERTY": "anything"
},
"conversation_id": "text",
"role": "user",
"content": [
{
"type": "text",
"text": "text"
}
],
"attachments": [
{
"id": "text",
"type": "image",
"name": "text",
"content_type": "text",
"url": "text"
}
]
}Last updated
Was this helpful?

