Preview: the PushFleet API isn't live yet. Join the waitlist
Send
POST /v1/send
Send to one of your users, and PushFleet delivers to every device they’ve registered. Needs a secret key, or a restricted key with messages: write.
{"to":"user_8f3k","title":"Your order shipped","body":"Arriving Thursday"}That’s 74 bytes. With a template it’s 66:
{"to":"user_8f3k","template":"order_shipped","vars":{"eta":"Thu"}}await fleet.send({
to: "user_8f3k",
title: "Your order shipped",
body: "Arriving Thursday",
});fleet.send(
to="user_8f3k",
title="Your order shipped",
body="Arriving Thursday",
)fleet.Send(ctx, pushfleet.SendParams{
To: "user_8f3k",
Title: "Your order shipped",
Body: "Arriving Thursday",
})fleet
.send()
.to("user_8f3k")
.title("Your order shipped")
.body("Arriving Thursday")
.await?;fleet.push(
to: "user_8f3k",
title: "Your order shipped",
body: "Arriving Thursday"
)curl https://api.pushfleet.com/v1/send \
-H "Authorization: Bearer $PUSHFLEET_SECRET_KEY" \
-H "Content-Type: application/json" \
-d '{"to":"user_8f3k","title":"Your order shipped","body":"Arriving Thursday"}'Fields
Section titled “Fields”| Field | Type | Notes |
|---|---|---|
to |
string | Your user ID. Required unless device is set. |
device |
string | A dev_ ID, to target one device instead of a user. |
title, body |
string | One of title, body or template is required. |
template, vars |
string, object | A saved template and its variables. Fields sent alongside override the template. |
data |
object | Custom key/values delivered to your app. |
badge, sound, thread |
number, string, string | Map to the APNs and FCM equivalents. |
priority |
"normal" | "high" |
Default normal. |
ttl |
number | Seconds to keep trying. Default 86400. |
collapse |
string | Newer messages with the same key replace older ones on the device. |
apns, fcm |
object | Raw platform fields merged last, for anything the shared fields don’t cover. |
The whole notification has to fit in 4 KB once built for Apple or Google (Apple’s limit). Larger ones get 413 payload_too_large.
With a template
Section titled “With a template”await fleet.send({
to: "user_8f3k",
template: "order_shipped",
vars: { eta: "Thu" },
});fleet.send(
to="user_8f3k",
template="order_shipped",
vars={"eta": "Thu"},
)fleet.Send(ctx, pushfleet.SendParams{
To: "user_8f3k",
Template: "order_shipped",
Vars: map[string]any{"eta": "Thu"},
})fleet
.send()
.to("user_8f3k")
.template("order_shipped")
.vars(json!({ "eta": "Thu" }))
.await?;fleet.push(
to: "user_8f3k",
template: "order_shipped",
vars: { eta: "Thu" }
)curl https://api.pushfleet.com/v1/send \
-H "Authorization: Bearer $PUSHFLEET_SECRET_KEY" \
-H "Content-Type: application/json" \
-d '{"to":"user_8f3k","template":"order_shipped","vars":{"eta":"Thu"}}'Response
Section titled “Response”202 Accepted, as soon as the message is queued:
{"id":"msg_2Xk9fQ","status":"queued"}Use the ID to look up delivery. Add an Idempotency-Key header to make retries safe.