---
title: "Edit message"
method: PUT
path: "/messages"
tags: ["messages"]
---

# Edit message

`PUT /messages`

## Request

- Base URL: `https://botapi.tamtam.chat`
- URL: `https://botapi.tamtam.chat/messages`
- Auth: API key in query parameter `access_token`

Updated message should be sent as `NewMessageBody` in a request body. In case `attachments` field is `null`, the current message attachments won’t be changed. In case of sending an empty list in this field, all attachments will be deleted.

## Query parameters

- `message_id` string, required

## Request body

- NewMessageBody
  - `text` string, nullable, required: Message text
  - `attachments` AttachmentRequest[], nullable, required: Message attachments. See `AttachmentRequest` and it's inheritors for full information
    - `type` string, required
  - `link` NewMessageLink, required
    - `type` 'forward' | 'reply', required: Type of linked message
    - `mid` string, required: Message identifier of original message
  - `notify` boolean: If false, chat participants would not be notified
  - `format` 'markdown' | 'html': Message text format

## Response `200`

Success or not result

- SimpleQueryResult: Simple response to request
  - `success` boolean, required: `true` if request was successful. `false` otherwise
  - `message` string: Explanatory message if the result is not successful

## Other responses

- `401`: Authorization Error. No `access_token` provided or token is invalid
- `500`: Internal Server Error

## Changes

- **2021-05-31** `dc45288cfedc`: 1 info
  - added the new optional request property `format`
- **2019-12-12** `1fa16652454b`: 1 info
  - added `share` discriminator mapping keys to the `attachments/items/` request property
- **2019-10-03** `cc15b2158c8b`: 1 warning
  - removed the request property `attachment`
- **2019-09-09** `844033ee1672`: 1 breaking, 1 info
  - for the `query` request parameter `message_id`, the minLength was increased from `0` to `1`
  - removed the pattern `mid\.[a-z0-9]{32}` from the `query` request parameter `message_id`

[Operation history](https://skmtc.dev/tamtam/apis/tamtam-bot-api/changes/messages/put.md)

---

[API](https://skmtc.dev/tamtam/apis/tamtam-bot-api.md) - [All operations](https://skmtc.dev/tamtam/apis/tamtam-bot-api/llms.txt) - [OpenAPI document](https://skmtc.dev/tamtam/apis/tamtam-bot-api/revisions/fa85402ea716?raw)
