API referenceMessages

Edit a Telegram message you sent

Edits a Telegram message you previously sent, by messageId.

Endpoint
POST https://api.dairo.app/v1/messages/{messageId}/edit

Edits a Telegram message you previously sent, by messageId. Send exactly one of text or html to replace the body, and/or buttons to change the inline keyboard — pass buttons: [] to clear it, or omit buttons on a body edit to preserve the current keyboard. Supplying both text and html, or neither a body nor buttons, returns 422. Only an outbound Telegram message is editable: a non-Telegram, non-outbound, or cross-tenant id returns 404. The response echoes the updated message with edited: true and an editedAt timestamp. Requires the messages:send scope; see Telegram.

Scope: messages:send. Send the API key as a bearer token; Scopes lists what each one reaches.

Request

cURL
curl -X POST "https://api.dairo.app/v1/messages/3fa85f64-5717-4562-b3fc-2c963f66afa6/edit" \
  -H "Authorization: Bearer $DAIRO_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{}'

Path parameters

NameTypeRequiredDescription
messageIdstringyesThe Dairo outbound message id (a telegram send) to edit.

Body

Required, application/json: EditTelegramMessageRequest.

Edit a Telegram message you sent: exactly one of text or html, plus an optional replacement inline keyboard.

FieldTypeRequiredDescription
textstringnoNew plain-text body. Mutually exclusive with html.
htmlstringnoNew rich-HTML body. Mutually exclusive with text.
buttonsarray of array of TelegramButtonnoOptional replacement inline keyboard (rows of buttons). Pass [] to clear the keyboard. Callback buttons show a feedback toast on tap (default: ✓ + the button label; set alert:true for a modal).

Response

200 Success. Body: application/json, MessageActionResponse.

FieldTypeRequiredDescription
objectstringno
idstringnoThe message id acted on.
channelstringno
editedbooleanno
editedAtstringno
reactedbooleanno
emojistringno
bigbooleanno
200
{
  "object": "string",
  "id": "string",
  "channel": "string",
  "edited": true,
  "editedAt": "string",
  "reacted": true,
  "emoji": "string",
  "big": true
}

Errors

Every error has the same body, {"error": {"type", "code", "message", "param"}}; branch on code. Errors lists every code.

StatusMeaning
400The request is malformed or a value is invalid (invalid_request, invalid_domain, idempotency_key_mismatch).
401The API key is missing or invalid.
403The key lacks the scope this endpoint needs (scope_missing) or may not do this (not_permitted).
404No such resource in this account (resource_not_found).
409The resource already exists or its state does not allow this (duplicate_resource or a condition-specific code).
422The request is well-formed but a field failed validation (validation_failed).
429Rate limit, plan limit, budget or spend cap reached (rate_limited, plan_limit_reached, budget_exceeded, spend_cap_reached).
500An unexpected error; retry with backoff, then contact support (internal_error).

On this page