> ## Documentation Index
> Fetch the complete documentation index at: https://docs.pilotstatus.com.br/llms.txt
> Use this file to discover all available pages before exploring further.

# DELETE /v1/messages/cancel — Cancel Scheduled Sends

> Cancel scheduling for messages still queued for a future send.

# Cancel Scheduled Sends

```text theme={null}
DELETE https://pilotstatus.com.br/v1/messages/cancel
```

Cancels **scheduling** for one or more messages that are still **queued** for a future send (`QUEUED` with a future `deliverAt` / `deliverBy`). The message row is **not** deleted: status becomes **`CANCELED`**, and Logs + trace history remain.

<Note>
  `CANCELED` is **not** `FAILED` and is not one of the delivery-error `errorCode` values listed in [Log Error Codes](/api/messages/log-error-codes).
</Note>

## Headers

* `Content-Type: application/json`
* `x-api-key: ps_...` (or `x-api-key-id`) — same key as `POST /v1/messages/send`

## Body

<ParamField body="messageIds" type="string[]" required>
  Up to **100** message IDs per request.
</ParamField>

```json theme={null}
{ "messageIds": ["<id1>", "<id2>"] }
```

## Example

```bash theme={null}
curl -X DELETE "https://pilotstatus.com.br/v1/messages/cancel" \
  -H "Content-Type: application/json" \
  -H "x-api-key: ps_your_key_here" \
  -d '{ "messageIds": ["msg_abc", "msg_def"] }'
```

<Note>
  This endpoint uses `DELETE` with a **JSON body**; `curl`, `fetch`, and most HTTP clients support it.
</Note>

## Response (200)

* Only still-schedulable messages appear in `cancelled`; others are listed in `failed` with a `reason`.
* After canceling, `GET /v1/messages/{messageId}` returns `"status": "CANCELED"`.
* The **Logs** page supports the same flow via bulk selection of scheduled rows.

## Common errors

* `400` — body validation (e.g., missing `messageIds`, more than 100 IDs).
* `401` — missing/invalid API key header.
* `403` — e.g., a tenant-scoped key on this number-scoped endpoint.
