---
title: "GET /threads/{threadId}/messages"
method: GET
path: "/threads/{threadId}/messages"
---

# GET /threads/{threadId}/messages

`GET /threads/{threadId}/messages`

Gets a list of messages that exist on a thread.

## Path parameters

- `threadId` string, required

## Query parameters

- `run_id` string
- `api-version` string, required
- `limit` integer
- `order` 'asc' | 'desc'
- `after` string
- `before` string

## Response `200`

The requested list of messages.

- object — The response data for a requested list of items.
  - `data` ThreadMessage[], required — The requested list of items.
    - `id` string, required — The identifier, which can be referenced in API endpoints.
    - `object` 'thread.message', required — The object type, which is always 'thread.message'.
    - `created_at` integer, required — The Unix timestamp, in seconds, representing when this object was created.
    - `thread_id` string, required — The ID of the thread that this message belongs to.
    - `status` 'in_progress' | 'incomplete' | 'completed', required — The possible execution status values for a thread message.
    - `incomplete_details` MessageIncompleteDetails, required — Information providing additional detail about a message entering an incomplete status.
      - `reason` 'content_filter' | 'max_tokens' | 'run_cancelled' | 'run_failed' | 'run_expired', required — A set of reasons describing why a message is marked as incomplete.
    - `completed_at` integer, nullable, required — The Unix timestamp (in seconds) for when the message was completed.
    - `incomplete_at` integer, nullable, required — The Unix timestamp (in seconds) for when the message was marked as incomplete.
    - `role` 'user' | 'assistant', required — The possible values for roles attributed to messages in a thread.
    - `content` MessageContent[], required — The list of content items associated with the agent thread message.
      - `type` string, required — The object type.
    - `assistant_id` string, nullable, required — If applicable, the ID of the agent that authored this message.
    - `run_id` string, nullable, required — If applicable, the ID of the run associated with the authoring of this message.
    - `attachments` MessageAttachment[], nullable, required — A list of files attached to the message, and the tools they were added to.
      - `file_id` string — The ID of the file to attach to the message.
      - `data_source` VectorStoreDataSource — The structure, containing Azure asset URI path and the asset type of the file used as a data source for the enterprise file search.
        - `uri` string, required — Asset URI.
        - `type` 'uri_asset' | 'id_asset', required — Type of vector storage asset. Asset type may be a uri_asset, in this case it should contain asset URI ID, in the case of id_asset it should contain the data ID.
      - `tools` MessageAttachmentToolDefinition[], required — The tools to add to this file.
        - unknown
    - `metadata` object, nullable, required — A set of up to 16 key/value pairs that can be attached to an object, used for storing additional information about that object in a structured format. Keys may be up to 64 characters in length and values may be up to 512 characters in length.
  - `last_id` string — The last ID represented in this list.
  - `has_more` boolean, required — A value indicating whether there are additional values available not captured in this list.

---

[API](https://skmtc.net/azure/apis/ai-azure-ai-agents.md) · [All operations](https://skmtc.net/azure/apis/ai-azure-ai-agents/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/azure/ai-azure-ai-agents/versions/de4a99f09829/schema)
