Tools / FCM Payload Builder

FCM Payload Builder.

Build and check Firebase Cloud Messaging HTTP v1 messages with Android and APNs overrides, plus a curl request.

Runs in your browser

Values are sent as strings, which is what FCM requires.

Ctrl/⌘ + Enter to run · Ctrl/⌘ + Shift + C to copy the result

Result
Checks
Request body
curl
Size (bytes)

About FCM Payload Builder

Firebase Cloud Messaging's HTTP v1 API expects a single message object posted to projects/PROJECT_ID/messages:send. It looks simple, but the error messages are vague when something is off: a number inside data, two targets in one message, a topic still written as /topics/news from the legacy API, or a TTL given as 3600 instead of "3600s". This builder writes the message for you and explains what each part does. Pick a target (device token, topic or condition), add the notification title, body and image, put custom values in data, and set Android priority, TTL, collapse key and channel, or iOS sound, badge and content-available. The output is the request body, a ready curl command for your project, the payload size and a list of checks. Paste an existing message in validate mode to review JSON your backend produces. For example, a chat app that sends a data message with chatId and high priority gets a note that iOS will not deliver a data-only message to a backgrounded app unless content-available is set in the APNs block. Checks cover exactly one target, topic name characters, up to five topics in a condition, string-only data values, reserved data keys such as from and anything starting with google or gcm, TTL format and the 28-day maximum, colour format and the 4096-byte payload limit. The tool does not send messages or create access tokens; it runs entirely in your browser.

How to Use

  1. Choose the target type and enter the token, topic or condition.
  2. Fill in the notification, data and platform options, or paste a message in validate mode.
  3. Copy the request body or the curl command and add your OAuth access token.

Frequently Asked Questions

Why does FCM reject my data payload?

In the HTTP v1 API every value in data must be a string. Numbers, booleans and nested objects cause INVALID_ARGUMENT; convert them with String() or JSON.stringify first.

Should I use notification or data messages?

Notification messages are shown by the system when your app is in the background. Data messages are always handed to your code, which must display them itself. You can combine both, but on Android the data then reaches the app only when the user taps the notification.

How do I authenticate the curl request?

HTTP v1 uses a short-lived OAuth 2.0 access token for a service account with the Firebase Cloud Messaging scope. Replace $ACCESS_TOKEN in the command with one; legacy server keys no longer work.

Is anything sent to Firebase?

No. The page only builds and checks the JSON in your browser.

Related Tools