Instant Games

A2U (App-to-User) API

Updated: Sep 24, 2026
Copy for LLM
The A2U (App-to-User) API lets you send notifications to your players directly from your backend server using the Facebook Graph API.
A2U notifications are one of the most effective re-engagement tools available because they reach players where they already are: on Facebook. A well-timed, relevant notification can bring a lapsed player back into your game at exactly the right moment.
This API identifies the recipient by their player ID (FBInstant.player.getID()) and is called on your app node with an app access token. Because it does not depend on an App Scoped User ID, it works for all of your players -- including users who onboarded entirely in a Zero Permissions environment. It replaces the older endpoint that identified players by App Scoped User ID; new integrations should use the player-ID API described here.
This guide covers what A2U notifications are, how they differ from other notification channels, the API endpoint and parameters, scheduling, deep linking, bot messages, use cases, rate limits, and policies.

What Are A2U Notifications?

A2U notifications are server-initiated messages from your game to specific players. Unlike Custom Updates (which are sent from within the game client during a play session) or Game Updates via Messenger (which are delivered through Messenger only), A2U notifications are:
  • Sent from your backend server using the Facebook Graph API
  • Triggered by server-side logic (not by in-game player actions)
  • Targeted to a specific player by their player ID
  • Delivered across multiple channels -- the Facebook notifications jewel, the on-platform game notifications, and Messenger bot messages
A single call attempts delivery across the available channels; the actual channels used are subject to further filtering by Meta to protect the player experience.

How A2U Differs from Other Channels

AspectA2U APICustom UpdatesGame Updates (Messenger)
Origin
Your backend server
Game client (SDK)
Your backend server (Messenger API)
Delivery
Facebook notifications + Messenger
In-game conversation/context
Messenger inbox
Trigger
Server-side event or schedule
Player action in-game
Server-side event or schedule
Recipient
Player ID
Current session
Player ID
Content
Title, body, optional image or bot template
Rich image, text, CTA, data
Rich templates, images, buttons
Setup
Graph API + app access token
SDK call
Messenger bot + webhook

Sending Notifications

Send a notification by making a POST request to your app’s notifications edge with an app access token.

API Endpoint

POST https://graph.fb.gg/{app-id}/notifications
Authenticate the request with your app access token.

Request Parameters

ParameterRequiredDescription
player_id
Yes
The recipient’s player ID, obtained in the client with FBInstant.player.getID().
message
Yes
The notification content, as a JSON object (see Message Object below).
label
No
A label used to group similar notification types together. Useful for organizing and filtering notifications.
payload
No
Custom data (JSON) attached to your game’s URL. It is available when the player opens your game from the notification. See Deep Linking with payload.
schedule_interval
No
Delay, in seconds, before the notification is sent. Must be between 300 (5 minutes) and 2592000 (30 days). Omit it (or send 0) to deliver immediately. See Scheduling Notifications.
bot_message_payload_elements
No
Advanced configuration for the Messenger bot message. See Bot Messages.
button_title
No
Custom text for the Messenger play button. See Custom play button.

Message Object

The message parameter is a JSON object with the following fields:
FieldRequiredDescription
title
Yes
The notification title.
body
Yes
The notification body text.
media_url
No
A URL to an image shown with the notification. Recommended for Messenger bot messages when you are not supplying bot_message_payload_elements; the jewel and on-platform notifications render from title and body.

Basic Example

curl -X POST "https://graph.fb.gg/{app-id}/notifications" \
  -H "Content-Type: application/json" \
  -d '{
    "access_token": "{app-access-token}",
    "player_id": "{player-id}",
    "message": {
      "title": "Your energy is full!",
      "body": "Come back and play -- your lives have recharged.",
      "media_url": "https://www.example.com/img/energy_full.png"
    },
    "label": "energy_full",
    "payload": "{\"screen\":\"gameplay\",\"ref\":\"energy_full\"}"
  }'
// Node.js example
async function sendNotification(appId, appAccessToken, playerId, message, options = {}) {
  const response = await fetch(`https://graph.fb.gg/${appId}/notifications`, {
    method: 'POST',
    headers: { 'Content-Type': 'application/json' },
    body: JSON.stringify({
      access_token: appAccessToken,
      player_id: playerId,
      message, // { title, body, media_url? }
      label: options.label,
      payload: options.payload, // JSON string of custom launch data
      schedule_interval: options.scheduleInterval, // seconds, optional
    }),
  });

  return await response.json();
}

Response

On success, the endpoint returns the created notification’s ID:
{
  "success": true,
  "notification_id": "1234567890"
}

Scheduling Notifications

To schedule a notification for the future instead of sending it immediately, set schedule_interval to the number of seconds from now that the notification should be delivered.
  • Range:300 (5 minutes) to 2592000 (30 days).
  • Pending limit: A maximum of 5 pending scheduled notifications per recipient. Additional scheduled sends for that player are rejected until some are delivered.
  • Omitting schedule_interval (or setting it to 0) sends the notification immediately.
// Remind the player to return in 4 hours
await sendNotification(APP_ID, APP_ACCESS_TOKEN, playerId, {
  title: 'Your daily reward is waiting!',
  body: 'Log in to claim it before it expires.',
}, {
  label: 'daily_reward',
  scheduleInterval: 4 * 60 * 60, // 14400 seconds
});
Note: Canceling a scheduled notification is not currently available on this endpoint.

Deep Linking with payload

Use the payload parameter to deep-link the player to a specific screen or action in your game. Provide a JSON string; when the player opens your game from the notification, read it in the client with FBInstant.getEntryPointData().
async function handleNotificationEntry() {
  await FBInstant.initializeAsync();

  const entryPointData = FBInstant.getEntryPointData();

  if (entryPointData) {
    const data = typeof entryPointData === 'string'
      ? JSON.parse(entryPointData)
      : entryPointData;

    switch (data.ref) {
      case 'energy_full':
        showGameplayScreen();
        break;
      case 'daily_reward':
        showDailyRewardScreen();
        break;
      case 'tournament_start':
        showTournamentLobby();
        break;
      default:
        showMainMenu();
    }
  } else {
    showMainMenu();
  }

  await FBInstant.startGameAsync();
}

Bot Messages

When a notification is delivered as a Messenger bot message, you can control its appearance in the following ways:

Custom play button

Set a top-level button_title to send the notification as a single card built from message (title, body, and media_url), with your text on the play button. If you omit media_url, the card falls back to your game’s banner image. Tapping the button opens your game with the top-level payload; include context_id in game_metadata to open it in a game context. Normal Messenger button-title limits apply, so keep custom labels short. Do not include button_title with bot_message_payload_elements or notification_contents; those already define their own buttons.

Advanced bot templates

Set bot_message_payload_elements to send a richer Messenger XMA instead of the standard message built from title and body. This field takes the elements array from the Messenger generic template format.

Personalized content with user information

In a Zero Permissions environment you cannot access player profile data (name, photo) directly. Instead, use the SDK to create reusable notification content that renders an image overlay with user data resolved server-side, then reference it when sending.
Use FBInstant.player.createNEZPNotificationContentAsync() to generate the content and receive a notification_content_id:
const notificationContentId = await FBInstant.player.createNEZPNotificationContentAsync({
  imageOverlayPath: 'ig_views/profile_view.xml',
  pathToCSS: 'ig_views/styles.css',
  initialData: { wordSubmitted: 'APPLE' },
  notificationTitle: ' just took their turn!',
  notificationSubtitle: 'It is your turn now!',
  recipients: ['6719542978151885'],
});
Then send the notification by including notification_content_id (as message’s stored-content reference) with the player_id. The player_id must be one of the recipients specified in the SDK call. You can include an optional top-level button_title to customize the Messenger play button text for this single-card notification. Do not include button_title with bot_message_payload_elements; explicit payload elements already define their own buttons.
To send a Messenger bot-message carousel in a Zero Permissions environment, pass 2-5 cards in notification_contents when you call the A2U API. Each card either references stored content that you created with FBInstant.player.createNEZPNotificationContentAsync(), or carries an inline message that you supply directly in the request. Every card also includes a card-level payload, which is sent when the player taps that card’s play button.
const recipientPlayerId = '6719542978151885';

async function createCard(title, subtitle, wordSubmitted) {
  return await FBInstant.player.createNEZPNotificationContentAsync({
    imageOverlayPath: 'ig_views/profile_view.xml',
    pathToCSS: 'ig_views/styles.css',
    initialData: {wordSubmitted},
    notificationTitle: title,
    notificationSubtitle: subtitle,
    recipients: [recipientPlayerId],
  });
}

const cardOneContentId = await createCard(
  'Alex played WORD',
  'Can you beat this score?',
  'WORD',
);
const cardTwoContentId = await createCard(
  'Alex played GAME',
  'Your turn is waiting.',
  'GAME',
);

await fetch(`https://graph.fb.gg/${appId}/notifications`, {
  method: 'POST',
  headers: {'Content-Type': 'application/json'},
  body: JSON.stringify({
    access_token: appAccessToken,
    player_id: recipientPlayerId,
    notification_contents: [
      {
        notification_content_id: cardOneContentId,
        payload: JSON.stringify({card: 'one'}),
        button_title: 'Play turn',
        game_metadata: JSON.stringify({context_id: '1234567890'}),
      },
      {
        notification_content_id: cardTwoContentId,
        payload: JSON.stringify({card: 'two'}),
        game_metadata: JSON.stringify({player_id: recipientPlayerId}),
      },
    ],
    label: 'turn_reminder',
  }),
});
notification_contents must contain 2-5 entries. Do not include a top-level message, top-level payload, top-level game_metadata, bot_message_payload_elements, or top-level notification_content_id in the same A2U request. Each notification_content_id must belong to the calling app, must have been created for the target player_id, and must include a title, subtitle, and image. Each card’s payload value is required and must be nonempty; use it to pass custom launch data for that card. Each card can also include optional button_title and game_metadata values. In card-level game_metadata, include either context_id to open in a game context or player_id to open against a player; do not include both. Cards without button_title use the default button text, Play, and cards without game_metadata.context_id or game_metadata.player_id open in solo mode. Normal Messenger button-title limits apply, so keep custom labels short. When the player opens your game from the notification, read the payload with FBInstant.getEntryPointData().
For scheduled A2U notifications, the carousel content is captured when you create the A2U notification. The scheduled send uses that captured title, subtitle, image, payload, and button text data.
A carousel send counts as one A2U notification for quota and rate-limit purposes. The individual cards are part of the same notification request; they do not each consume a separate notification quota unit.

Inline message cards

A carousel card does not have to reference stored content. In place of notification_content_id, a card can carry an inline message object that you supply directly in the A2U request. Use an inline card when that card does not need an image overlay rendered with server-resolved player data -- for example, a static “your energy is full” card sent alongside a personalized turn reminder.
The card-level message object takes the same fields as the top-level Message Object:
FieldRequiredDescription
title
Yes
The card title.
body
Yes
The card body text.
media_url
No
A URL to the image shown on the card. If you omit it, the card falls back to your game’s banner image.
Each card must set exactly one of notification_content_id or message. A card that sets both, or neither, is rejected. You can mix stored-content cards and inline cards freely in the same carousel, and a carousel made up entirely of inline cards is allowed. The card-level payload is still required on an inline card, and button_title and game_metadata behave exactly as they do on a stored-content card.
await fetch(`https://graph.fb.gg/${appId}/notifications`, {
  method: 'POST',
  headers: {'Content-Type': 'application/json'},
  body: JSON.stringify({
    access_token: appAccessToken,
    player_id: recipientPlayerId,
    notification_contents: [
      {
        notification_content_id: cardOneContentId,
        payload: JSON.stringify({card: 'turn'}),
        button_title: 'Play turn',
      },
      {
        message: {
          title: 'Your energy is full',
          body: 'Come back and play, your lives have recharged.',
          media_url: 'https://example.com/energy.png',
        },
        payload: JSON.stringify({card: 'energy'}),
      },
    ],
    label: 'turn_reminder',
  }),
});
An inline card carries text that you write, so its title and body are checked against the Notification Guidelines -- including the 84-character limit, the restriction on emojis and exclamation points, and the requirement to write in complete sentences. If any inline card fails this check, the entire request is rejected, so validate your copy before sending. Stored-content cards are rendered by Meta from the title and subtitle you passed to createNEZPNotificationContentAsync() and are not rechecked at send time.
For the full API reference, see FBInstant.player.

Use Cases

A2U notifications are most effective when they are relevant to the specific player receiving them. Common use cases include:
  • Re-engage lapsed players: “Your energy is full,” “Your daily reward is waiting,” or a comeback bonus after several days of inactivity.
  • Social and friend activity: “A friend just beat your high score,” “A friend joined the Weekend Challenge,” or “A friend started playing.”
  • Time-sensitive events: A tournament starting, a limited-time event, or expiring in-game resources.
  • Scheduled reminders: Streak reminders or daily-login nudges, delivered with schedule_interval.
  • Turn-based prompts: “It is your turn” messages, personalized with user information through bot messages.
Segment your player base and send targeted notifications rather than the same generic message to everyone -- irrelevant notifications lead to higher opt-out rates.

Rate Limits and Policies

Rate Limits

Facebook enforces rate limits on A2U notifications to protect the player experience:
  • Per-player limits: You can send a limited number of notifications to each individual player within a given time window. Exceeding this limit results in the notification being rejected.
  • Per-app limits: Your app has an overall daily notification budget across all players. This budget scales with your app’s active user count.
  • Throttling: If you send a large volume of notifications in a short period, the API may throttle your requests. Implement backoff logic and spread sends over time.

Content Policies

  • Relevance: Notifications must be relevant to the player’s game activity. Do not send marketing messages, promotional content for other apps, or unrelated information.
  • Accuracy: Notification content must be truthful and accurately represent what the player will find when they open the game.
  • No deception: Do not use misleading language to trick players into opening the game.
  • Compliance: All notifications must comply with Facebook’s Platform Policies⁠ and Advertising Policies⁠.
Violating notification policies can result in throttling, your app being flagged for review, or, in severe cases, suspension from the platform.

Error Handling

async function sendNotificationWithErrorHandling(appId, appAccessToken, playerId, message) {
  try {
    const response = await fetch(`https://graph.fb.gg/${appId}/notifications`, {
      method: 'POST',
      headers: { 'Content-Type': 'application/json' },
      body: JSON.stringify({
        access_token: appAccessToken,
        player_id: playerId,
        message,
      }),
    });

    const data = await response.json();

    if (data.error) {
      switch (data.error.code) {
        case 4:
          console.warn('Rate limited. Retry later with backoff.');
          break;
        case 100:
          console.error('Invalid parameter:', data.error.message);
          break;
        default:
          console.error('Notification error:', data.error);
      }
    }

    return data;
  } catch (error) {
    console.error('Network error:', error);
    return null;
  }
}

Next Steps