Chat
Edit message
PATCH
/api/chat/projects/{projectId}/chats/{chatId}/messages/{messageId}SDK setup
Create a client and set credentials (JWT and/or API key) before calling the API. Match the authentication type shown above.
import { Configuration, ChatApi } from 'mudbase-sdk';
const configuration = new Configuration({
basePath: 'https://cloud.mudbase.dev',
accessToken: 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJ1c3JfbW9yZ2FuX2RlIiwiZW1haWwiOiJtb3JnYW4uY2hlbkBub3J0aHdpbmQuZGV2IiwiZXhwIjoxODI1MTI5NjAwfQ.doc_preview_sig',
});
const chat = new ChatApi(configuration);import { Configuration, ChatApi } from 'mudbase-sdk';
const configuration = new Configuration({
basePath: 'https://cloud.mudbase.dev',
accessToken: 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJ1c3JfbW9yZ2FuX2RlIiwiZW1haWwiOiJtb3JnYW4uY2hlbkBub3J0aHdpbmQuZGV2IiwiZXhwIjoxODI1MTI5NjAwfQ.doc_preview_sig',
});
const chat = new ChatApi(configuration);Example request
Call this endpoint using the client from SDK setup. Use View HTTP for a raw cURL example.
const { data: result } = await chat.editMessage(
"proj_MngOynnrrbGo",
"XEuNfv6z5avw66Wy",
"Professional-grade Fish perfect for ugly training and recreational use",
{
content: "array hack",
e2ee: "pixel parse"
}
);const { data: result } = await chat.editMessage(
"proj_MngOynnrrbGo",
"XEuNfv6z5avw66Wy",
"Professional-grade Fish perfect for ugly training and recreational use",
{
content: "array hack",
e2ee: "pixel parse"
}
);Playground
liveTest this endpoint with your own credentials. Your requests will be sent to the live API.
Use the auth endpoints to obtain a JWT.
No Request Yet
Send a request to see the full inspector
Authentication
Requires JWT
Note
Include your JWT in the
Authorization: Bearer YOUR_TOKEN header (user-facing apps, RBAC). View authentication guide →Path Parameters
| Name | Type | Required | Description |
|---|---|---|---|
projectId | string | Yes | — |
chatId | string | Yes | — |
messageId | string | Yes | — |
Request Body
json
{
"content": "circuit synthesize",
"e2ee": {
"version": 1,
"scheme": "capacitor copy",
"ciphertext": "101.43.167.167",
"nonce": "capacitor reboot",
"ephemeralPublicKey": "protocol transmit",
"senderKeyId": "SfkvCAWQlgw91XdF"
}
}{
"content": "circuit synthesize",
"e2ee": {
"version": 1,
"scheme": "capacitor copy",
"ciphertext": "101.43.167.167",
"nonce": "capacitor reboot",
"ephemeralPublicKey": "protocol transmit",
"senderKeyId": "SfkvCAWQlgw91XdF"
}
}Responses
200Message edited
json
{
"success": true,
"data": {
"_id": "65a1b2c3d4e5f6789012345g",
"content": "Updated message content",
"editedAt": "2024-01-15T11:00:00.000Z"
}
}{
"success": true,
"data": {
"_id": "65a1b2c3d4e5f6789012345g",
"content": "Updated message content",
"editedAt": "2024-01-15T11:00:00.000Z"
}
}400—
401—
403—
Errors
| Code | Meaning |
|---|---|
400 | — |
401 | — |
403 | — |