# Cancel scheduled message

> Cancel a message that has not been sent yet.

Source: https://docs.mycrmsim.com/docs/messages/cancel-scheduled-message

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

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

Only a `pending` message can be cancelled. One already being sent, sent, failed or cancelled answers **409**.

## Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `id` | path | number | yes | The scheduled message id. Example: `912` |

## Response 200

OK

```json
{
  "success": true,
  "message": "Scheduled message cancelled"
}
```

## Response 401

Missing or invalid token

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

## Response 404

Scheduled message does not exist or is not owned by the installer (same response for both)

```json
{
  "success": false,
  "message": "Scheduled message not found or not accessible to this token"
}
```

## Response 409

Already sent or being sent

```json
{
  "success": false,
  "message": "This message is already sent"
}
```
