GET /v2/threads/{threadId}/messages

Retrieves a list of messages for a specific thread.

Request

  • Base URL
    https://api.langtail.com
  • Auth
    none declared. Required headers: X-API-Key

Path parameters

threadIdstring required

The ID of the thread to retrieve messages from.

Query parameters

limitnumber nullable

The maximum number of threads to return. Default is 100.

afterstring nullable

A cursor for use in pagination. 'after' is a thread ID that defines your place in the list. For instance, if you make a list request and receive 100 threads, ending with thread 'xyz', your subsequent call can include after='xyz' in order to fetch the next page of the list. Pagination works the same as in the OpenAI API https://platform.openai.com/docs/api-reference/assistants/listAssistants.

order'asc' | 'desc' nullable

The order of the messages. Default is 'asc' (oldest first). Use 'desc' for newest first.

Headers

X-API-Keystring required
Example:<LANGTAIL_API_KEY>

Your Langtail API Key

Response

Successful response

object'list'

The object type, which is always 'list' for a list of messages.

first_idstring nullable

The ID of the first thread in the list, or null if the list is empty.

last_idstring nullable

The ID of the last thread in the list, or null if the list is empty.

has_moreboolean required

Whether there are more threads available after this batch.

Example response

{
  "data": [
    {
      "content": [
        {
          "role": "user",
          "content": "Hello"
        }
      ]
    }
  ]
}

Changes

No recorded changes to this operation across all 1 revision of this API.