---
title: "Batch Messages"
method: POST
path: "/v2/batch"
tags: ["Messages"]
---

# Batch Messages

`POST /v2/batch`

## Request

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

Send multiple messages in a single request

## Request body

- object[]
  - `destination` string, required: Destination can either be a valid URL where the message gets sent to, or a URL Group name. - If the destination is a URL, make sure the URL is prefixed with a valid protocol (http:// or https://) - If the destination is a URL Group, a new message will be created for each endpoint in the group. Note that destination must be publicly accessible over the internet. If you are working with local endpoints, consider using QStash local development server or a public tunnel service.
  - `body` string: The raw request message passed to the endpoints as is
  - `headers` object: HTTP headers of the message. You can pass all the headers supported in the single publish API.
  - `queue` string: Queue name to enqueue the message to if desired.

## Response `200`

Messages published successfully

- PublishResponse[]
  - `messageId` string: Unique identifier for the published message or the old message ID if deduplicated
  - `deduplicated` boolean: Whether this message is a duplicate and was not sent to the destination.

## Other responses

- `400`: Bad request

---

[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)
