Skip to content

Edit a message

PATCH
/chats/{chat}/messages/{message}
curl --request PATCH \
--url https://chat.work.optidata.cloud/api/chats/36/messages/176 \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{ "content": "The report is ready — updated with the Q3 figures.", "hasUserMentions": true, "mentionedUserUuids": [ "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0" ] }'

Rewrites the text of a message you sent. content is required unless the message carries files, in which case the text may be cleared.

Mentions are replaced wholesale: send the full mentionedUserUuids list the edited text should end up with, not just the new ones. A link preview attached to the old text is dropped when the link disappears from it.

chat
required
integer format: int64

Numeric id of the conversation.

message
required
integer format: int64

Numeric id of the message.

Media typeapplication/json
object
content

The new text. Required unless the message carries files.

string | null
hasUserMentions

Whether the new text mentions anyone.

boolean
mentionedUserUuids

The complete list of mentioned users, by UUID. Required when hasUserMentions is true.

Array<string>

The message was updated.

Media typeapplication/json

Minimal acknowledgement returned by several write operations.

object
success
required
boolean
Example
{
"success": true
}

Missing, malformed or expired authentication key.

Media typeapplication/json

Authentication failures — and a few permission denials — use an error key rather than message.

object
error
required
string
Examples
Examplemissing

No bearer token sent

{
"error": "JWT passport exception: Missing bearer token in request"
}

The caller is not a participant of the conversation, or lacks the role the operation requires.

Media typeapplication/json

Generic error envelope used by policy, binding and framework failures.

object
message
required

Human-readable description of the failure.

string
Examples
Exampledenied
{
"message": "This action is unauthorized."
}

The resource does not exist, or does not belong to the given conversation.

Media typeapplication/json

Generic error envelope used by policy, binding and framework failures.

object
message
required

Human-readable description of the failure.

string
Examples
Examplemissing
{
"message": "No query results for model [App\\Models\\Chat\\Chat] 99999999"
}

The request body or query string failed validation.

Media typeapplication/json
object
message
required

The first validation message.

string
errors
required

Validation messages keyed by field name.

object
key
additional properties
Array<string>
Examples
Exampleinvalid
{
"message": "The content field is required.",
"errors": {
"content": [
"The content field is required."
]
}
}

Rate limit exceeded. Retry after the window resets.

Media typeapplication/json

Generic error envelope used by policy, binding and framework failures.

object
message
required

Human-readable description of the failure.

string
Examples
Examplethrottled
{
"message": "Too Many Attempts."
}