---
title: "Edit a message"
method: PATCH
path: "/v1/messages/{id}"
tags: ["Messages"]
---

# Edit a message

`PATCH /v1/messages/{id}`

## Request

- Base URL: `https://www.chatrail.dev`
- URL: `https://www.chatrail.dev/v1/messages/{id}`
- Auth: HTTP bearer

Replaces the text of a text message this number sent, within WhatsApp's 15-minute window, and/or its `context`. Captions cannot be changed after sending. The first text is kept and audited. Editing the text does not change the context the AI answers from: send `context` too when the correction matters to it (a new gate, a new time). A context-only edit has no window and does not reach WhatsApp.

## Path parameters

- `id` string, required

## Request body

- object
  - `body` string
  - `context` object
  - `context_sensitivity` 'normal' | 'sensitive' | 'restricted'

## Response `200`

The message, with `edited_at` set.

## Other responses

- `404`: No such message.
- `409`: Not editable: received, not a text message, deleted, or past the window.

---

[API](https://skmtc.dev/chatrail/apis/chatrail-api.md) · [All operations](https://skmtc.dev/chatrail/apis/chatrail-api/llms.txt) · [OpenAPI document](https://skmtc.dev/chatrail/apis/chatrail-api/revisions/acc5b88c6f59?raw)
