Skip to content
Get Help

Events API

The Events API tracks conversions in your app. Attach metadata for Commerce, Content, Lifecycle, and Custom events to measure user behavior and attribute it to your campaigns.

Important considerations

  • Real-time only: You must send events in real time as they occur. Branch doesn't support backtracking or historical event ingestion. Events with timestamps in the past won't be backfilled into reports.
  • SKAdNetwork (SKAN): Your app must handle SKAN natively, not via the Branch SDK. Branch returns SKAN-relevant fields (such as coarse_key and update_conversion_value) in the API response so your app can update its conversion value accordingly. See the SKAdNetwork guide for details.

Rate limits

The Events API enforces rate limits on a per-app basis. If you exceed the limit, the API returns a 429 Rate Limit Reached error. Back off and retry with exponential delay.

Rate limits are enforced per app. Contact your Branch account manager for your app's specific limits.

Read the Events API overview

Log custom events

POST/event/custom

Use this endpoint to log custom events.

Important considerations

  • Real-time only: You must send events in real time as they occur. Branch doesn't support backtracking or historical event ingestion. Events with timestamps in the past won't be backfilled into reports.
  • SKAdNetwork (SKAN): Your app must handle SKAN natively, not via the Branch SDK. Branch returns SKAN-relevant fields (such as coarse_key and update_conversion_value) in the API response so your app can update its conversion value accordingly. See the SKAdNetwork guide for details.

Parameters

  • branch_keystringRequired

    The Branch Key of the originating app obtained in your Account Settings.

  • namestringRequired

    The name of the event to log. Can be a custom event name string, for example, "picture swiped".

  • Acceptstringheader

    Recommended. The media type the client expects in the response. Should be application/json.

  • Content-Typestringheader

    Recommended. The media type of the request body. Should be application/json.

  • custom_dataobjectExpandable

    Additional custom key-value pairs that you want attached to the event. Values may be of any JSON type. Attached to events retrieved via Exports and sent via Webhooks.

  • event_dataobjectExpandable
  • meta_dataobjectExpandable

    Additional metadata for the event.

  • user_dataobjectExpandable

    Information about the user and the device the event occurred on.

    Required identifiers: You must include at least one of the following in user_data:

    • developer_identity, or
    • browser_fingerprint_id, or
    • os=iOS AND idfa, or
    • os=iOS AND idfv, or
    • os=Android AND android_id, or
    • os=Android AND aaid
  • X-IP-Overridestringheader

    Optional. Override the IP address Branch uses for the event (for example, when forwarding events server-to-server from your own backend).

    Two requirements must be met for this header to function:

    • Branch must allowlist your app ID. The header is ignored until allowlisting is enabled. Open a support request to have your app ID allowlisted before sending this header in production.
    • You must also include user_data.ip in the request body with the same IP value. Sending the header alone isn't sufficient—the body field is what Branch persists for attribution.

Returns

Success. Returns 400 and 429 on failure — see the response panel for the error shape.

Log standard events

POST/event/standard

Use this endpoint to log standard events, that is, Commerce, Content, and User Lifecycle events.

Important considerations

  • Real-time only: You must send events in real time as they occur. Branch doesn't support backtracking or historical event ingestion. Events with timestamps in the past won't be backfilled into reports.
  • SKAdNetwork (SKAN): Your app must handle SKAN natively, not via the Branch SDK. Branch returns SKAN-relevant fields (such as coarse_key and update_conversion_value) in the API response so your app can update its conversion value accordingly. See the SKAdNetwork guide for details.

Parameters

  • branch_keystringRequired

    The Branch Key of the originating app obtained in your Account Settings.

  • nameenumRequired

    The name of the event to log. Must be one of the following standard Branch Event names:

    • Commerce:
    • ADD_TO_CART
    • ADD_TO_WISHLIST
    • VIEW_CART
    • INITIATE_PURCHASE
    • ADD_PAYMENT_INFO
    • CLICK_AD
    • PURCHASE
    • SPEND_CREDITS
    • VIEW_AD
    • Content:
    • SEARCH
    • VIEW_ITEM
    • VIEW_ITEMS
    • RATE
    • SHARE
    • INITIATE_STREAM
    • COMPLETE_STREAM
    • User Lifecycle:
    • COMPLETE_REGISTRATION
    • COMPLETE_TUTORIAL
    • ACHIEVE_LEVEL
    • UNLOCK_ACHIEVEMENT
    • INVITE
    • LOGIN
    • START_TRIAL
    • SUBSCRIBE
    ADD_TO_CARTADD_TO_WISHLISTVIEW_CARTINITIATE_PURCHASEADD_PAYMENT_INFOCLICK_ADPURCHASESPEND_CREDITSVIEW_ADSEARCHVIEW_ITEMVIEW_ITEMS
  • user_dataobjectRequiredExpandable

    Information about the user and the device the event occurred on.

    Required identifiers: You must include at least one of the following in user_data:

    • developer_identity, or
    • browser_fingerprint_id, or
    • os=iOS AND idfa, or
    • os=iOS AND idfv, or
    • os=Android AND android_id, or
    • os=Android AND aaid
  • Acceptstringheader

    Recommended. The media type the client expects in the response. Should be application/json.

  • content_itemsarray of objectExpandable
  • Content-Typestringheader

    Recommended. The media type of the request body. Should be application/json.

  • custom_dataobjectExpandable

    Additional custom key-value pairs that you want attached to the event. Values may be of any JSON type. Attached to events retrieved via Exports and sent via Webhooks.

  • customer_event_aliasstring

    The event alias that you define, used in addition to the event name defined above.

  • event_dataobjectExpandable
  • X-IP-Overridestringheader

    Optional. Override the IP address Branch uses for the event (for example, when forwarding events server-to-server from your own backend).

    Two requirements must be met for this header to function:

    • Branch must allowlist your app ID. The header is ignored until allowlisting is enabled. Open a support request to have your app ID allowlisted before sending this header in production.
    • You must also include user_data.ip in the request body with the same IP value. Sending the header alone isn't sufficient—the body field is what Branch persists for attribution.

Returns

Success. Returns 400 and 429 on failure — see the response panel for the error shape.