Guide

FCM HTTP v1 Setup for Firebase Projects

How to configure Firebase Cloud Messaging HTTP v1, enable required APIs, and prepare credentials for sending push notifications.

Last updated: May 2026

Cloud server racks in a data center running Google Cloud and Firebase services
Enable the Firebase Cloud Messaging API in Google Cloud Console

Google retired the FCM Legacy HTTP API (server key + fcm.googleapis.com/fcm/send). New and existing projects should migrate to HTTP v1, which offers better security, error reporting, and platform-specific message options.

Enable Firebase Cloud Messaging API

In Google Cloud Console, open APIs & Services → Library and enable "Firebase Cloud Messaging API". In Firebase Console → Project settings → Cloud Messaging, confirm your sender ID and app configurations are present.

Cloud infrastructure and global connectivity for Firebase services
Enable the FCM API in the same Google Cloud project as your Firebase app

Service account vs user OAuth token

Production backends typically use a service account JSON key and generate tokens with google-auth-library. For manual testing, a user OAuth token from gcloud auth print-access-token is sufficient. TestFCM accepts the short-lived user token for quick tests.

Grant the account the Firebase Cloud Messaging Admin role or a custom role with cloudmessaging.messages.create permission.

Message structure overview

HTTP v1 POST body wraps the payload in a message object: token (single device), topic, or condition. notification carries title and body for display notifications. data carries custom key-value pairs (all strings).

{
  "message": {
    "token": "DEVICE_TOKEN",
    "notification": {
      "title": "Hello",
      "body": "Test from HTTP v1"
    },
    "data": {
      "screen": "home"
    }
  }
}

Why TestFCM uses a server proxy

Browsers block direct calls to fcm.googleapis.com due to CORS. TestFCM's /api/send-fcm endpoint forwards your payload server-side so you can test from the web UI without running your own backend locally.

Continue with our complete testing guide or open the FCM tester to send a notification now.

Ready to test? Open the FCM tester · Browse all guides

Guide photos from Unsplash & Pexels (free license)