Messages

Get Conversation Messages

get

Get all messages for a specific conversation branch.

The branch is determined by the conversation's last_message_id.

Authorizations
X-API-KeystringRequired
Path parameters
conversation_idstringRequired
project_idstringRequired
Responses
200

Successful Response

application/json
get
/projects/{project_id}/conversations/{conversation_id}/messages
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 Messages Sso

post

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

Authorizations
X-API-KeystringRequired
Path parameters
conversation_idstring · uuidRequired
project_idstringRequired
Body
user_idstringRequired
Responses
200

Successful Response

application/json
post
/projects/{project_id}/conversations/{conversation_id}/messages
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 Conversation Messages Sso

get

Get all messages for a specific conversation branch.

The branch is determined by the conversation's last_message_id.

Authorizations
OAuth2passwordRequired
Token URL:
Path parameters
conversation_idstringRequired
project_idstringRequired
Responses
200

Successful Response

application/json
get
/projects/{project_id}/conversations/sso/{conversation_id}/messages
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 Messages

post

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

Authorizations
OAuth2passwordRequired
Token URL:
Path parameters
conversation_idstring · uuidRequired
project_idstringRequired
Body
user_idstringRequired
Responses
200

Successful Response

application/json
post
/projects/{project_id}/conversations/sso/{conversation_id}/messages
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"
      }
    ]
  }
]

Update Message Feedback

patch
Authorizations
X-API-KeystringRequired
Path parameters
project_idstringRequired
message_idstringRequired
Body
typestring · enumRequiredPossible values:
commentany ofOptional
stringOptional
or
nullOptional
Responses
200

Successful Response

application/json
Responseany of
or
patch
/projects/{project_id}/messages/{message_id}/feedback
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"
    }
  ]
}

Update Message Feedback Sso

patch
Authorizations
OAuth2passwordRequired
Token URL:
Path parameters
project_idstringRequired
message_idstringRequired
Query parameters
tokenstringRequired

Token for authorization

Body
typestring · enumRequiredPossible values:
commentany ofOptional
stringOptional
or
nullOptional
Responses
200

Successful Response

application/json
Responseany of
or
patch
/projects/{project_id}/messages/sso/{message_id}/feedback
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?