Publish API

Publishing a Notification to Interest(s)

1
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 to application/json.

Request Body

A JSON object with the following keys:

  • interests (Array<string>|required): Array of interests to send the push notification to, ranging from 1 to 100 per publish request.
  • webhookUrl (String|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:
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:

  • publishId (string|required): Unique string used to identify this publish request.

Error Responses

TitleStatus CodeDescription
Invalid content type400Only application/json is supported.
Incomplete Request400instance-id param is missing from path.
Incomplete Request400Authorization header is missing.
Bad request400Request body size is too large (max 10KiB).
Bad request400Failed to read body as a JSON object.
Unauthorized401Incorrect API Key.
Instance not found404Could not find the instance.
Unprocessable Entity422JSON does not our match schema.
Something went wrong500Internal server error.

Did you find this document useful?

We are always striving to create the most accurate and informative docs as possible. If there is something especially wrong (or right) here then please let us know.