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

# POST /threads/{threadId}/messages/{messageId}

`POST /threads/{threadId}/messages/{messageId}`

Modifies an existing message on an existing thread.

## Path parameters

- `threadId` string, required
- `messageId` string, required

## Query parameters

- `api-version` string, required

## Request body

- object
  - `metadata` object, nullable — 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.

## Response `200`

A representation of the modified message.

- ThreadMessage — A single, existing message within an agent thread.
  - `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.

## Other responses

- `default` — An unexpected error response.

---

[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)
