PushFyreAccelerate. Ignite. Broadcast.

Send a push notification from your own backend

8 min readPushFyre

Call POST /api/v1/push/send from the server that already knows the event, with the app id, tenant id, and server API key. PushFyre delivers the notification to subscribed Android, iOS, and web devices and records the campaign.

Your backend decides when to send

A shipped order, a paid invoice, or a score change already lives in your system. That system should be the one that fires the push notification. The portal is where you set up the app, the key, and the audience. It does not have to be where every message is composed.

PushFyre stays the delivery layer. Your server keeps the business rule: who, what, and when. One HTTPS call hands the title, the message, and the audience to the push API.

How do you send a push notification from your own backend?

Send POST /api/v1/push/send to your PushFyre API host. Three headers identify the app: x-app-id, x-tenant-id, and x-api-key. The body names the campaign, lists the channels, and carries the payload.

Keep the server key in the environment of the service that sends, for example PUSHFYRE_SERVER_KEY. A mobile app or a public web page is the wrong place for that key. Generating a new key revokes the previous one, so update every server that still has the old value. The steps are in API authentication.

Order shipped, from your server
curl -X POST https://push.example.com/api/v1/push/send \
  -H "x-app-id: app_49e692ad" \
  -H "x-api-key: $PUSHFYRE_SERVER_KEY" \
  -H "x-tenant-id: <your-tenant-id>" \
  -H "Content-Type: application/json" \
  -d '{
    "appId": "app_49e692ad",
    "campaignName": "order-shipped",
    "type": "simple",
    "channels": ["android", "ios", "web"],
    "payload": {
      "title": "Your order shipped",
      "message": "Track it from the Orders tab.",
      "deepLink": "myapp://orders/1042",
      "data": { "orderId": "1042" }
    }
  }'

Can one call reach Android, iOS, and the web?

Yes. channels accepts android, ios, and web together. A person with the app on a phone and a subscription in the browser can be reached from the same campaign. Leave a channel out when that platform should stay quiet.

The device still registers through the Android SDK, the iOS SDK, or the web script. Your backend does not collect push tokens itself. Web push and mobile push share the audience tools, including segments.

How do you reach one person, or a saved audience?

Omit the audience fields to reach every subscribed device on the channels you listed. Pass segmentId or segmentIds for a saved segment, and excludeSegmentId to leave a group out. Pass deviceIds when you already know the PushFyre subscription id. segmentQuery is an inline filter when you do not want to save a segment first.

If the person signed in with your own user id, target that id the same way you do from the portal. The field list is on the send API page. A successful call returns 201 and a campaign whose status is queued.

When should the message arrive?

Leave scheduleAt out and delivery starts as soon as the call is accepted. Set scheduleAt to an ISO 8601 time, with timezone, when the message should wait. receiveMode of perUserTimezone delivers at the same local time for each person.

A busy day can still be quiet for one person. Frequency capping skips someone who is already at the app limit and marks them capped. throttleRatePerMinute slows a large push. Omit it to use the app setting, or send 0 to ignore the throttle for this campaign.

How do you know it worked?

The campaign appears with sends you start in the portal. Analytics shows sent, delivered, and clicked. A follow-up can target people who were sent the message, confirmed it, missed it, clicked it, or failed, while those events are still kept.

An optional A/B test sends two versions of one push to the same audience. It is included on every plan. WhatsApp and email are separate calls, so an A/B test stays on push. Templates can be recorded with templateId. You still send the payload, so the backend remains the source of the words.

Do it in four steps

  1. Step 1

    Install the SDK

    Add the Android, iOS, or web SDK so devices subscribe and tokens refresh without your server storing them.

  2. Step 2

    Create a server key

    Generate an API key for the app and store it only on the backend that will call the send endpoint.

  3. Step 3

    Call POST /push/send

    From the service that owns the event, post the campaign name, channels, title, message, and deep link.

  4. Step 4

    Read the report

    Open the campaign in analytics. Sent, delivered, and clicked are recorded next to portal sends.

Questions

Do I still need the PushFyre portal?

Yes, for setup. You create the app, connect Android, iOS, or web, and generate the server key there. After that, each notification can start from your own backend. The portal remains the place to read results, manage segments, and rotate a key.

Can my backend send to one customer?

Yes. Pass that person's device id, a segment that contains them, or an inline segment query. A broadcast omits those fields and reaches subscribed devices on the channels you listed.

What does a 403 or a 400 mean?

A 403 means a header is missing, or the API key is invalid or revoked. A 400 means a field in the body is missing or invalid, and the response lists each problem.

Does this replace a journey?

Use this call when your system already knows the moment, such as a shipment scan. A journey is for a sequence that starts from an event, a segment, or a schedule and then waits, branches, and sends later steps.

Keep reading

Put the next send on your server

Create the app, generate a server key, and call the same endpoint your backend already knows how to reach.