---
title: "Cancel a Message"
method: DELETE
path: "/v2/messages/{messageId}"
tags: ["Messages"]
---

# Cancel a Message

`DELETE /v2/messages/{messageId}`

## Request

- Base URL: `https://qstash-eu-central-1.upstash.io`
- URL: `https://qstash-eu-central-1.upstash.io/v2/messages/{messageId}`
- Auth: one of:
  - HTTP bearer
  - API key in query parameter `qstash_token`
- TypeScript: <https://skmtc.dev/upstash/apis/qstash-rest-api/docs/v2/messages/:messageId/delete.ts> (a function with typed inputs; its response is checked against the schema)

Cancel a pending message

## Path parameters

- `messageId` string, required

## Response `202`

Message canceled successfully

- object
  - `cancelled` integer: Number of messages cancelled. Always `1`.

## Other responses

- `404`: Message not found

## Changes

- **2026-09-16** `ed23e37f87f3`: 1 breaking, 1 info
  - removed the success response with the status `200`
  - added the success response with the status `202`

[Operation history](https://skmtc.dev/upstash/apis/qstash-rest-api/changes/v2/messages/:messageId/delete.md)

---

[API](https://skmtc.dev/upstash/apis/qstash-rest-api.md) - [All operations](https://skmtc.dev/upstash/apis/qstash-rest-api/llms.txt) - [OpenAPI document](https://skmtc.dev/upstash/apis/qstash-rest-api/revisions/0c3b83ef4770?raw)
