Saltar al contenido

Notify batch

Este contenido aún no está disponible en su idioma.

POST https://api.pushwoosh.com/messaging/v2/notify/batch

Sends several messages in one call. Every item is an independent Notify: it is validated exactly like a standalone Notify request, and it gets its own result.

Request structure

Anchor link to
Shape
{
"items": [
{
"item_id": "caller-defined-id",
"request": { ... }
}
]
}
FieldTypeDescription
itemsarray of NotifyBatchItemRequired, 1 to 500 entries (server-configured limit). Items are processed concurrently; results come back in request order regardless.

NotifyBatchItem

Anchor link to
FieldTypeDescription
item_idstringOptional caller-supplied correlation id, echoed back on the matching result. Not used by Pushwoosh otherwise.
requestNotifyRequestSame body as a single Notify call — segment or transactional, transaction_id included. Required.
Terminal window
curl -X POST https://api.pushwoosh.com/messaging/v2/notify/batch \
-H "Authorization: Token YOUR_API_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"items": [
{
"item_id": "order-1001",
"request": {
"transactional": {
"application": "XXXXX-XXXXX",
"platforms": ["IOS", "ANDROID"],
"users": { "list": ["user-123"] },
"payload": {
"content": {
"localized_content": {
"en": { "ios": { "body": "Your order has shipped." } }
}
}
},
"schedule": { "at": "2026-05-01T12:00:00Z" },
"message_type": "MESSAGE_TYPE_TRANSACTIONAL",
"transaction_id": "order-1001-shipped"
}
}
},
{
"item_id": "order-1002",
"request": {
"transactional": {
"application": "XXXXX-XXXXX",
"platforms": ["IOS", "ANDROID"],
"users": { "list": ["user-456"] },
"payload": {
"content": {
"localized_content": {
"en": { "ios": { "body": "Your order has shipped." } }
}
}
},
"schedule": { "at": "2026-05-01T12:00:00Z" },
"message_type": "MESSAGE_TYPE_TRANSACTIONAL",
"transaction_id": "order-1002-shipped"
}
}
}
]
}'
{
"results": [
{
"item_id": "order-1001",
"index": 0,
"result": {
"message_code": "XXXXX-XXXXX-XXXXX",
"unknown_identifiers": []
}
},
{
"item_id": "order-1002",
"index": 1,
"error": {
"code": 3,
"message": "invalid argument",
"reason": "EmptySchedule",
"domain": "api.pushwoosh.com"
}
}
],
"succeeded": 1,
"failed": 1
}
FieldTypeDescription
resultsarray of NotifyBatchResultOne entry per requested item, in request order.
succeededintegerCount of items that returned a result.
failedintegerCount of items that returned an error.

NotifyBatchResult

Anchor link to
FieldTypeDescription
item_idstringEcho of the request item’s item_id.
indexintegerZero-based position of the item in the request. Use this to correlate results when item_id was left empty.
resultobjectSet when the item succeeded — same shape as a single Notify response: message_code and unknown_identifiers.
errorNotifyBatchErrorSet when the item failed.

NotifyBatchError

Anchor link to
FieldTypeDescription
codeintegergRPC status code (google.rpc.Code), e.g. 3 for INVALID_ARGUMENT.
messagestringDeveloper-facing error message, in English.
reasonstringShort status name — the same value a single Notify call would return, e.g. EmptySchedule.
domainstringError domain, api.pushwoosh.com.

Errors use the standard gRPC-Gateway error envelope: { "code": ..., "message": ..., "details": [...] }. These are envelope-level errors that fail the whole request — an individual item failing produces a per-item error in results[] instead (see NotifyBatchError above), not one of these.

HTTP statusCondition
400items is empty.
400items has more than the server-configured limit (500 by default).
400One of the items is missing request.

Example

Sending 501 items when the limit is 500 returns HTTP 400:

{
"code": 3,
"message": "items must not exceed 500 entries, got 501",
"details": []
}