Skip to main content

Content server integration

To trigger dispatch of a push notification to all subscribers, there needs to be some code running when the content authors publish a new article or other content item. This can typically be implemented using a webhook, but will vary between CMS-es and depend the availablity of development resources and server code access.

Step 1​

To initiate a dispatch of a push notification, you will notify the Subrite API. The body below reaches every subscribed device for your tenant. To send to only a part of your audience, you can add a topic filter — read Topics are an audience filter below before you do.

  • Method: POST
  • Route: {baseUrl}/api/v1/app-push/pushcontent
  • Authorization: Bearer token (using the M2M generated in Basic setup, step 5)
  • Body: See example below

Example of body :​

{
"title": "Subrite",
"body": "Breaking! Subrite has won the Platform of the year Award",
"data": {
// insert the data you need to open the app in the preferred state here
// it will be delivered as part of the payload
}
}

Topics are an audience filter​

Two optional fields let you send to a part of your audience instead of all of it:

  • topic — a single string, for example "news"
  • topics — an array of strings, for example ["news", "sport"]

They do the same thing, and if you send both, topic wins and topics is ignored. While topic filtering is on (the default), the values are matched against the topics each device subscribed with in App integration, step 3, and only devices subscribed to at least one of them are notified.

They are an audience filter, not metadata attached to the message. Nothing you put here reaches the app. Anything the app needs — article id, tags, categories, deep link — belongs in data.

  • Omit the field, or send an empty array, to reach all subscribers.
  • Only send values your app actually subscribes devices to. The field is not validated against your topic list: an unknown value is accepted, matches nobody, and the campaign is stored with status skipped. No notification is sent, and POST /pushcontent still answers 201.
  • A device that subscribed without topics, or with an empty topics array, matches no filter at all. It is reached only by a send that has no topic filter.
  • Never forward article tags, categories or keywords from your CMS into this field. That is the most common way to end up with a campaign that silently reaches no one.

Example of body with a topic filter :​

{
"title": "Subrite",
"body": "Breaking! Subrite has won the Platform of the year Award",
"data": {
// insert the data you need to open the app in the preferred state here
},
"topics": ["news"]
}

If you never want topic filtering, a tenant administrator can turn on the Discard topics setting in the admin dashboard, under Account settings, Settings, Communications, Push notifications, see Basic setup. Every send then goes to all subscribed devices, whatever topic or topics contains.

After dispatching, check the outcome with the endpoints in Step 2: read the campaign status with Get a single campaign — a status of skipped means the send matched no devices at all, which for a filtered send usually means nothing is subscribed to those topics — and see how many notifications were actually queued and sent with Get campaign delivery stats.

Step 2​

Once a campaign has been dispatched, you can read it back from the Subrite API. All three endpoints below accept the same M2M token as step 1, and require the Push Content section with Read selected (push-content:read) on the M2M client.

The endpoints only return campaigns belonging to the tenant the M2M token was issued for.

List campaigns​

  • Method: GET
  • Route: {baseUrl}/api/v1/app-push/pushcampaign
  • Authorization: Bearer <M2M token>
  • Query parameters: page (default 1), take (page size, default 10, max 50), orderDirection (ASC or DESC by creation date, default DESC)

Example of response :​

{
"items": [
{
"id": 1234,
"createdAt": "2026-08-12T09:15:00.000Z",
"updatedAt": "2026-08-12T09:16:04.000Z",
"title": "Breaking news",
"body": "A new article has just been published",
"data": {
// the payload delivered to the app, as supplied when dispatching
},
"tenantId": 1,
"status": "dispatched",
"topics": ["news"],
"segmentId": null,
"scheduledAt": null
}
],
"meta": {
"page": 1,
"take": 10,
"count": 1,
"pageCount": 1,
"hasPreviousPage": false,
"hasNextPage": false
}
}

Get a single campaign​

  • Method: GET
  • Route: {baseUrl}/api/v1/app-push/pushcampaign/{id}
  • Authorization: Bearer <M2M token>

The response is a single campaign object, identical to one entry of the items array above.

Get campaign delivery stats​

  • Method: GET
  • Route: {baseUrl}/api/v1/app-push/pushcampaign/{id}/stats
  • Authorization: Bearer <M2M token>

Example of response :​

{
"total": 1500, // notifications queued for this campaign
"sending": 0, // still in flight
"sent": 1476, // delivered to the push provider
"failed": 24, // permanently failed, e.g. expired device tokens
"opened": 412 // opened in the app, as reported by the open tracking call
}

And you're done, good luck!