---
title: "Edit a message"
method: PUT
path: "/v1/{appId}/conversations/{conversationId}/messages/{messageId}"
tags: ["Messages"]
---

# Edit a message

`PUT /v1/{appId}/conversations/{conversationId}/messages/{messageId}`

## Request

- Base URL: `https://api.talkjs.com`
- URL: `https://api.talkjs.com/v1/{appId}/conversations/{conversationId}/messages/{messageId}`
- Auth: one of:
  - HTTP bearer
  - HTTP bearer
- TypeScript: <https://skmtc.dev/talkjs/apis/talkjs-api/docs/v1/:appId/conversations/:conversationId/messages/:messageId/put.ts> (a function with typed inputs; its response is checked against the schema)

You can edit the text field and the custom data of any message that you know the message ID (`id`) of. To find the `id` of the message you want to edit, use the endpoint to list messages in a conversation, or get a list of messages via a Webhook.

To automatically add a timestamp to the message's `editedAt` field for when a message was last edited, pass the `markEdited` field and set it to `true`. Depending on your theme, an indicator that the user edited the message can now appear in the chat UI.

## Path parameters

- `appId` string, required
- `conversationId` string, required
- `messageId` string, required

## Request body

- MessageEditData: A single message with details to edit.
  - `custom` object: A custom object with key-value pairs that you want to associate with a message. Both keys and values must be strings. You can access a custom property in for example API responses, webhook events, and themes.
  - `text` string: Text of a message body. `text` is only given if the message type is text.
  - `markEdited` boolean: Optional field to set the `editedAt` field of this message to a timestamp for when the message was edited.

## Response `200`

Empty response

- object: Empty response

## Other responses

- `400`: Bad request
- `401`: Authorization information is missing or invalid.
- `404`: Resource not found
- `415`: Unsupported media type
- `429`: Too many requests
- `500`: Internal server error

---

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