cURL
curl --request POST \ --url https://qstash.upstash.io/v2/batch \ --header 'Authorization: Bearer <token>'
Send multiple messages in a single request
POST https://qstash.upstash.io/v2/batch
destination: string headers: headers object body: string
curl -XPOST https://qstash.upstash.io/v2/batch -H "Authorization: Bearer XXX" \ -H "Content-Type: application/json" \ -d ' [ { "destination": "myUrlGroup", "headers":{ "Upstash-Delay":"5s", "Upstash-Forward-Hello":"123456" }, "body": "Hello World" }, { "queue": "test", "destination": "https://example.com/destination", "headers":{ "Upstash-Forward-Hello":"789" } }, { "destination": "https://example.com/destination1", "headers":{ "Upstash-Delay":"7s", "Upstash-Forward-Hello":"789" } }, { "destination": "https://example.com/destination2", "headers":{ "Upstash-Delay":"9s", "Upstash-Forward-Hello":"again" } } ]'
[ [ { "messageId": "msg_...", "url": "https://myUrlGroup-endpoint1.com" }, { "messageId": "msg_...", "url": "https://myUrlGroup-endpoint2.com" } ], { "messageId": "msg_...", }, { "messageId": "msg_..." }, { "messageId": "msg_..." } ]
Was this page helpful?