Skip to content

Edit a message

PATCH
/v1/conversations/{id}/messages/{message_id}
curl --request PATCH \
--url https://app.mondochat.io/v1/conversations/2489E9AD-2EE2-8E00-8EC9-32D5F69181C0/messages/2489E9AD-2EE2-8E00-8EC9-32D5F69181C0 \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{ "text": "Hi Bob, hello again" }'

Changes the text of the caller’s own text message that is not held, deleted or redacted, within chat.edit_window_seconds of sending. Outside the window, or with the window at 0, it answers 403 policy_denied with reason edit. The edited text is moderated again. Takes a session token. See https://docs.mondochat.io/guides/messages/.

id
required
Id
string format: uuid
message_id
required
Message Id
string format: uuid
Media typeapplication/json
EditMessage

The new text of a message.

object
text
required
Text

The new text.

string
>= 1 characters <= 10000 characters

Successful Response

Media typeapplication/json
Message

A message in a conversation, as the viewer sees it.

object
auto
Auto

True for an away reply the server sent for its sender.

boolean
caption
Any of:
string
card
Any of:
Card

A structured message such as an offer, a purchase or a call event.

object
data
Data

The card’s content; its shape depends on type.

object
key
additional properties
any
type
required
Type

What the card is.

string
Allowed values: call_invite call_ended call_missed purchase offer system signup_invite
client_msg_id
required
Any of:
string
conversation_id
required
Conversation Id

The conversation it belongs to.

string format: uuid
created_at
required
Created At

When it was sent.

string format: date-time
deleted
Deleted

True when the sender deleted it for everyone. It has no text, caption, photo, card or quote.

boolean
delivered_to_peer
Delivered To Peer

True for the viewer’s own message once the peer received or read it, never for a silently dropped one.

boolean
duration_ms
Any of:
integer
edited_at
Any of:
string format: date-time
forwarded
Forwarded

True when the sender marked it forwarded, or it came from the forward route.

boolean
height
Any of:
integer
id
required
Id

The message’s id.

string format: uuid
kind
required
Kind

text, photo, video, voice, system or card.

string
Allowed values: text photo video voice system card
once
Once

True for view-once media: it carries no links and no caption for anyone, and its recipient opens it through the open route.

boolean
opened_at
Any of:
string format: date-time
photo
Any of:
Photo

A photo, video, voice note or avatar and the links to read it.

object
full_url
required
Any of:
string
height
required
Any of:
integer
id
required
Id

The media’s id.

string format: uuid
kind
required
Kind

What the media is.

string
Allowed values: photo video voice avatar
status
required
Status

pending until the upload is completed, held while it waits for the receiver’s consent or for moderation, rejected or deleted once it is gone.

string
Allowed values: pending ready held rejected deleted
thumb_url
required
Any of:
string
uploader_id
required
Uploader Id

The id of the user who uploaded it.

string format: uuid
width
required
Any of:
integer
reactions
Reactions

One entry per emoji in the order they were set; none on a deleted or redacted message.

Array<object>
default:
Reaction

One emoji on a message and how many users set it.

object
count
required
Count

How many users reacted with it.

integer
emoji
required
Emoji

The emoji.

string
mine
required
Mine

True when the viewer’s own reaction is this emoji.

boolean
read_by_peer
required
Read By Peer

True for the viewer’s own message once the peer read it; false while either participant has read_receipts off.

boolean
redacted
required
Redacted

True when a moderator removed the content.

boolean
reply_to
Any of:
ReplyTo

The message a message quotes.

object
id
required
Id

The quoted message’s id.

string format: uuid
kind
required
Kind

The quoted message’s kind.

string
Allowed values: text photo video voice system card
preview
required
Preview

The quoted text or caption, up to 140 characters; empty for a view-once message or a card.

string
sender_id
required
Any of:
string format: uuid
sender_id
required
Any of:
string format: uuid
seq
required
Seq

The message’s place in its conversation’s sync order. Keep the copy with the higher seq.

integer
status
required
Status

held and rejected come from moderation or photo consent, and undelivered is a message dropped silently because the peer blocked the sender.

string
Allowed values: sent held rejected undelivered
text
Any of:
string
wave
Any of:
string
width
Any of:
integer

Example

{
"client_msg_id": "c1f0a5e2-7d2b-4d57-9a53-0a6f5b6f1d10",
"conversation_id": "0199d6a0-2000-7000-8000-000000000001",
"created_at": "2026-11-01T09:30:00Z",
"delivered_to_peer": true,
"id": "0199d6a0-3000-7000-8000-000000000001",
"kind": "text",
"reactions": [
{
"count": 1,
"emoji": "👍",
"mine": false
}
],
"read_by_peer": false,
"redacted": false,
"sender_id": "0199d6a0-1000-7000-8000-000000000001",
"seq": 12,
"status": "sent",
"text": "Hi Bob"
}

Problem

Media typeapplication/problem+json

An RFC 9457 problem: the body of every error answer.

object
code
required

The stable error code to branch on, such as policy_denied.

string
detail

What went wrong this time, when there is more to say.

string | null
errors

For validation, one entry per invalid field.

Array<object>

One invalid field.

object
loc

The path to the field.

array
msg

What is wrong with it.

string
instance

The path of the request.

string
reason

For policy_denied and limit_reached, the rule or limit that refused the request; for forbidden, a short cause such as you_blocked; for banned, temporary when the ban expires.

string
status
required

The HTTP status code.

integer
title
required

A short summary of the problem.

string
type
required

A URL that names the problem, https://app.mondochat.io/problems/<code>.

string

Example

{
"code": "policy_denied",
"detail": null,
"instance": "/v1/conversations/0199d6a0-2000-7000-8000-000000000001",
"reason": "pins",
"status": 403,
"title": "Policy denied",
"type": "https://app.mondochat.io/problems/policy_denied"
}