List messages

Retrieve a list of all messages in a thread.

Query Parameters

ParameterTypeRequiredDescription
publicApiKeystringYesPublic API key for authentication
assistantIdstringYesID of the assistant to which the thread belongs
threadIdstringYesID of the thread to retrieve messages from
pageParamstringNoPagination token for fetching the next page of messages

Request

GET https://superinterface.ai/api/cloud/messages?publicApiKey={publicApiKey}&assistantId={assistantId}&threadId={threadId}

Example request

curl -X GET "https://superinterface.ai/api/cloud/messages?publicApiKey=40cfe680-fee5-49b9-b386-6a7097eb8497&assistantId=00cfe680-fee5-49b9-b386-6a7097eb8497&threadId=70cfe680-fee5-49b9-b386-6a7097eb8497" \ -H "Content-Type: application/json"

Response

ParameterTypeDescription
dataarrayList of Messages
hasNextPagebooleanIndicates if there are more pages of messages available
lastIdstringID of the last message in the current page, used for pagination

Example response

{ "data": [ { "id": "80cfe680-fee5-49b9-b386-6a7097eb8497", "role": "ASSISTANT", "created_at": "2024-01-15T10:30:00Z", "content": "Hello, how can I help you?", "attachments": [], "metadata": {}, "runSteps": [], "status": "COMPLETED" } ], "hasNextPage": false }

Errors

The endpoint may return the following errors:

401 Unauthorized

This error occurs if the API key is invalid or missing.
{ "error": "Unauthorized", "message": "Invalid or missing API key" }