---
title: Edit Message | API Docs
---

POST

/api/partner/v2/chats/{chat\_id}/chat\_messages/{id}/edit

Select code sample cURL (shell:curl)

```
const url = 'https://api.linqapp.com/api/partner/v2/chats/1/chat_messages/1/edit';
const options = {
  method: 'POST',
  headers: {
    'X-LINQ-INTEGRATION-TOKEN': '<X-LINQ-INTEGRATION-TOKEN>',
    'Content-Type': 'application/json'
  },
  body: '{"text":"Updated message text"}'
};


try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```
curl --request POST \
  --url https://api.linqapp.com/api/partner/v2/chats/1/chat_messages/1/edit \
  --header 'Content-Type: application/json' \
  --header 'X-LINQ-INTEGRATION-TOKEN: <X-LINQ-INTEGRATION-TOKEN>' \
  --data '{ "text": "Updated message text" }'
```

- Production server api.linqapp.com/api/partner/v2/chats/{chat\_id}/chat\_messages/{id}/edit

Edits an existing message in the chat

## Authorizations

- **[ApiKeyAuth](/v2/api/#apikeyauth/index.md)**

## Parameters

### Path Parameters

**chat\_id**

required

integer

The chat ID

**id**

required

integer

The message ID

## Request Body required

Media type application/json

object

**text**

required

string

##### Example

```
Updated message text
```

## Responses

### 200

Message edited successfully

Media type application/json

object

**message**

string

**data**

object

**id**

integer

**text**

string

##### Example

```
{
  "message": "Message edited successfully",
  "data": {
    "id": 243062,
    "text": "nice"
  }
}
```
