Skip to main content
POST
/
v2
/
batch
Batch Messages
curl --request POST \
  --url https://qstash.upstash.io/v2/batch \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
[
  {
    "destination": "<string>",
    "body": "<string>",
    "headers": {},
    "queue": "<string>"
  }
]
'
[
  {
    "messageId": "<string>",
    "deduplicated": true
  }
]

Authorizations

Authorization
string
header
required

QStash authentication token

Body

application/json
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

Messages published successfully

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.