# Cancel scheduled messages

Cancel one or more scheduled message batches by ID or by batch metadata. If using metadata, all batches matching the given key and value will be cancelled.

To successfully cancel a batch, you must do so before the send_after time. Batches without a send_after value (i.e., batches that are sent immediately) cannot be cancelled.

Cancellation is performed asynchronously. This means that this method always returns a 200 response, even if the cancellation fails.

Endpoint: DELETE /v1/projects/{project_id}/messages
Version: 1.0
Security: BearerAuth

## Path parameters:

  - `project_id` (string, required)
    The unique ID of the project. You can find this on the Sinch Dashboard.

## Request fields (application/json):

  - `body` (batch_id (object) or metadata_filter (object), required) — one of:
    - batch_id:
      - `batch_id` (string)
    - metadata_filter:
      - `metadata_filter` (object)
      - `metadata_filter.key_name` (string)
      - `metadata_filter.key_value` (string)

## Response 403 fields (application/json):

  - `code` (integer)

  - `message` (string)

  - `status` (string)

  - `details` (array)


## Response 200 fields

## Response 401 fields
