# Edit message

> Edit the text of an iMessage you sent, within 15 minutes — the recipient sees it as edited.

Source: https://docs.mycrmsim.com/docs/messages/edit-message

```http
POST https://backend.mysmsgateway.app/api/v1/ext/messages/{id}/edit
```

- Category: myCRMSIM Messages / Messages
- Auth: Bearer access token
- Scope: `messages.write`

Edits a sent iMessage the way the edit button on the app.mycrmsim.com conversation does: the Mac that sent it edits it in Messages, and the recipient sees the new text marked Edited. Apple allows edits within **15 minutes** of sending (and up to five edits).

Send the new body in `message`. If the message was sent with an effect, a subject or as a threaded reply, those stay as they were; only the body changes. The edited text is what message reads return afterwards.

**Rules** (the same as the dashboard's): the message must be one you sent, over iMessage (not an SMS fallback), with text, sent through a Mac gateway, and not itself a reaction; the workspace needs a Mac with **Advanced Mode** on (else 400 `NO_ADVANCED_MODE_MAC`). The request waits for the Mac (up to 15 s): 422 `MAC_REFUSED` when Messages refused, 503 `MAC_UNREACHABLE` when the Mac is offline, 504 `MAC_TIMEOUT` when it did not answer in time — the change may still land, so read the message again before retrying.

## Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `id` | path | number | yes | The id of the message — a List messages or conversation message `id`, or the `message_id` from Send message. Example: `84213` |
| `workspace_id` | body | number | yes | The workspace the message belongs to. Example: `7` |
| `message` | body | string (text) | yes | The new text. `text` is accepted as an alias. Example: `Booking confirmed for 5 PM.` |

## Request body

```json
{
  "workspace_id": 7,
  "message": "Booking confirmed for 5 PM."
}
```

## Response 200

OK — done on the Mac

```json
{
  "success": true,
  "message": "Message edited",
  "data": {
    "id": 84213,
    "message_id": "84213",
    "channel": "imessage",
    "workspace_id": 7,
    "contact_id": 1234,
    "direction": "outbound",
    "to": "+61412345678",
    "from": null,
    "is_group": false,
    "text": "Booking confirmed for 5 PM.",
    "effect": null,
    "reaction": null,
    "media": null,
    "status": "delivered",
    "error_message": null,
    "created_at": "2026-10-29T09:15:58.000Z",
    "updated_at": "2026-10-29T09:20:03.000Z",
    "edited_at": "2026-10-29T09:20:03.000Z"
  }
}
```

## Response 400

Outside Apple's window

```json
{
  "success": false,
  "message": "Messages can only be edited within 15 minutes of sending"
}
```

## Response 400

Not an iMessage you sent with text

```json
{
  "success": false,
  "message": "Only messages you sent can be changed"
}
```

## Response 400

No Mac with Advanced Mode on the workspace

```json
{
  "success": false,
  "code": "NO_ADVANCED_MODE_MAC",
  "message": "No Mac with Advanced Mode is connected to this workspace. Edit, unsend and Notify Anyway need a Mac with Advanced Mode on."
}
```

## Response 401

Missing or invalid token

```json
{
  "success": false,
  "message": "Invalid or expired access token."
}
```

## Response 403

Missing scope

```json
{
  "success": false,
  "message": "Missing scope: one of messages.send, messages.write. This integration was granted: …"
}
```

## Response 404

Message not found in this workspace (or not accessible to this token)

```json
{
  "success": false,
  "message": "Message not found"
}
```

## Response 422

Messages on the Mac refused the change

```json
{
  "success": false,
  "code": "MAC_REFUSED",
  "message": "The Mac couldn't edit the message"
}
```

## Response 503

The Mac that sent the message is not connected

```json
{
  "success": false,
  "code": "MAC_UNREACHABLE",
  "message": "The Mac isn't connected right now"
}
```

## Response 504

The Mac did not answer within 15 s — the change may still land; read the message again

```json
{
  "success": false,
  "code": "MAC_TIMEOUT",
  "message": "The Mac didn't answer in time. Check the thread in a moment."
}
```
