Publish API
∞ Publishing a notification to interest(s)
POST https://<YOUR_INSTANCE_ID>.pushnotifications.pusher.com/publish_api/v1/instances/<YOUR_INSTANCE_ID>/publishes/interests
∞ Request headers
The following headers are necessary:
Authorization
: with the value in the following format:Bearer <YOUR_SECRET_KEY>
.Content-Type
: with the value always set toapplication/json
.
∞ Request body
A JSON object with the following keys:
- ∞ interestsArray<string> Required
-
Array of interests to send the push notification to, ranging from 1 to 100 per publish request.
Where multiple interests are provided, the notification will be delivered to devices subscribed to any of the interests.
Beams will also only deliver one notification to any devices that may be subscribed to multiple interests in the publish request.
- ∞ webhookUrlString Optional
-
A URL to which we will send webhooks at key points throughout the publishing process. E.g., when the publish finishes.
At least one of:
- ∞ apnsobject
-
The payload to be sent to APNs. The full set of options for the APNs section of the
notify
call is described in Apple’s Payload Key Reference. For further examples, see Apple’s “Creating the Remote Notification Payload”.
- ∞ fcmobject
-
The payload to be sent to FCM. The full set of options is described in Google docs under FCM downstream HTTP messages.
- ∞ webobject
-
The payload to be sent to the web push gateway. Refer to Beams web push format reference.
Each interest name can be up to 164 characters. Each character in the name must be an ASCII upper- or lower-case letter, a number, or one of
_-=@,.;
.
∞ Response Body
A JSON object with the following fields:
- ∞ publishIdstring Required
-
Unique string used to identify this publish request.
∞ Error Responses
Title | Status Code | Description |
---|---|---|
Invalid content type | 400 | Only application/json is supported. |
Incomplete Request | 400 | instance-id param is missing from path. |
Incomplete Request | 400 | Authorization header is missing. |
Bad request | 400 | Request body size is too large (max 10KiB). |
Bad request | 400 | Failed to read body as a JSON object. |
Unauthorized | 401 | Incorrect API Key. |
Payment Required | 402 | Publishing has been blocked due to being over plan limits. Refer to Beams plan limits article in our Support knowledge base. |
Instance not found | 404 | Could not find the instance. |
Unprocessable Entity | 422 | JSON does not our match schema. |
Rate Limited | 429 | Too many requests being made in quick succession (max 100 RPS). |
Something went wrong | 500 | Internal server error. |
∞ Publishing a notification to user(s)
POST https://<YOUR_INSTANCE_ID>.pushnotifications.pusher.com/publish_api/v1/instances/<YOUR_INSTANCE_ID>/publishes/users
∞ Request headers
The following headers are necessary:
Authorization
: with the value in the following format:Bearer <YOUR_SECRET_KEY>
.Content-Type
: with the value always set toapplication/json
.
∞ Request body
A JSON object with the following keys:
- ∞ usersArray<string> Required
-
Array of user IDs to send the push notification to, ranging from 1 to 1000 per publish request. User IDs are UTF-8 encoded strings of no more than 164 bytes
At least one of:
- ∞ apnsobject
-
The payload to be sent to APNs. The full set of options for the APNs section of the
notify
call is described in Apple docs Payload Key Reference. For further examples, visit Apple docs Creating the Remote Notification Payload.
- ∞ fcmobject
-
The payload to be sent to FCM. The full set of options is described in Google docs under FCM downstream HTTP messages.
- ∞ webobject
-
The payload to be sent to the web push gateway. Refer to the Beams web push format reference.
∞ Response Body
A JSON object with the following fields:
- ∞ publishIdstring Required
-
Unique string used to identify this publish request.
∞ Error Responses
Title | Status Code | Description |
---|---|---|
Invalid content type | 400 | Only application/json is supported. |
Incomplete Request | 400 | instance-id param is missing from path. |
Incomplete Request | 400 | Authorization header is missing. |
Bad request | 400 | Request body size is too large (max 200KiB). |
Bad request | 400 | Failed to read body as a JSON object. |
Unauthorized | 401 | Incorrect API Key. |
Payment Required | 402 | Publishing has been blocked due to being over plan limits. Refer to Beams plan limits articlein our Support knowledge base. |
Instance not found | 404 | Could not find the instance. |
Unprocessable Entity | 422 | JSON does not our match schema. |
Rate Limited | 429 | Too many requests being made in quick succession (max 100 RPS). |
Something went wrong | 500 | Internal server error. |