---
title: "Cancel a message"
method: POST
path: "/cancel_msg/"
tags: ["Messages"]
---

# Cancel a message

`POST /cancel_msg/`

## Request

- Base URL: `https://wbiztool.com/api/v1`
- URL: `https://wbiztool.com/api/v1/cancel_msg/`
- Auth: none required

Cancel a message that has not been sent yet (status `0`, Created): scheduled or queued. It then reports status `3` and its webhook gets a `CANCELLED` event. A message a bot is already sending may still go out. The JSON body is served with `Content-Type: text/html`; parse it as JSON whatever the header says.

## Request body

- CancelMessageRequest: Your API credentials, sent in the request body (JSON or form fields) of every request that uses them. Both come from Settings → API keys in the dashboard. The API key decides which workspace the request acts on.
  - `client_id` integer, required: Your API Client ID from Settings → API keys.
  - `api_key` string, required: One of your API keys from the same page. Keep it secret.
  - `msg_id` integer, required: The `msg_id` returned when the message was sent or scheduled.

## Response `200`

Cancelled (`status: 1`, `message: Cancelled`) or not (`status: 0`). Failure messages: `Msg has been Sent`, `Msg has been Failed`, `Msg has been Cancelled`, `Msg has been Expired`, `No msg found for given msg_id`, `Msg_id cant be null`, `Auth Error`, `Invalid JSON format: …`; a JSON body sent with another method than POST returns `{}`.

- SimpleResult
  - `status` 0 | 1, required: `1` success, `0` failure.
  - `message` string, required

## Other responses

- `400`: Invalid API key.
- `403`: `client_id` is not a whole number.

---

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