> ## Documentation Index
> Fetch the complete documentation index at: https://docs.backapp.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Receive a subscription event

> The assigned endpoint ID selects the app. Both providers send the endpoint secret in Authorization. Starting with release bf55ff2, Backapp checks the RevenueCat signature only when the endpoint has a signing secret configured. See the [RevenueCat guide](/integrations/revenuecat) or [Adapty guide](/integrations/adapty).



## OpenAPI

````yaml /openapi/backapp-public.json post /v2/webhooks/{source}/{public_id}
openapi: 3.1.0
info:
  title: Backapp API
  version: 2.0.0
  description: >-
    Backapp v2 API reference for authentication, files, image effects, and AI
    jobs.
servers:
  - url: https://api.backapp.dev
security: []
paths:
  /v2/webhooks/{source}/{public_id}:
    post:
      summary: Receive a subscription event
      description: >-
        The assigned endpoint ID selects the app. Both providers send the
        endpoint secret in Authorization. Starting with release bf55ff2, Backapp
        checks the RevenueCat signature only when the endpoint has a signing
        secret configured. See the [RevenueCat guide](/integrations/revenuecat)
        or [Adapty guide](/integrations/adapty).
      operationId: receiveSubscriptionWebhook
      parameters:
        - name: source
          in: path
          required: true
          schema:
            type: string
            enum:
              - adapty
              - revenuecat
        - name: public_id
          in: path
          required: true
          schema:
            type: string
            format: uuid
        - name: X-RevenueCat-Webhook-Signature
          in: header
          description: >-
            Required for RevenueCat endpoints with a configured signing secret.
            Otherwise Backapp ignores this header. RevenueCat sends t=<Unix
            seconds>,v1=<hex HMAC-SHA256> over the timestamp, a period, and the
            raw request body. Backapp accepts timestamps within five minutes.
          schema:
            type: string
      requestBody:
        required: true
        description: >-
          Send the payload for the provider named in the path. Adapty also
          accepts an empty test object.
        content:
          application/json:
            schema:
              anyOf:
                - type: object
                  properties:
                    customer_user_id:
                      type: string
                    event_type:
                      type: string
                    event_properties:
                      type: object
                  title: Adapty
                - title: RevenueCat
                  type: object
                  required:
                    - event
                  properties:
                    event:
                      type: object
                      properties:
                        id:
                          type: string
                        type:
                          type: string
                        app_user_id:
                          type: string
                        aliases:
                          type: array
                          items:
                            type: string
            examples:
              revenueCatTest:
                summary: RevenueCat test delivery
                value:
                  api_version: '1.0'
                  event:
                    id: evt-example
                    type: TEST
              adaptyTest:
                summary: Adapty test delivery
                value: {}
      responses:
        '200':
          description: >-
            RevenueCat returns {"ok":true} for accepted deliveries, including
            duplicate and record-only events. Adapty returns {} for an empty
            test, or ok with an optional ignored reason.
          content:
            application/json:
              schema:
                oneOf:
                  - type: object
                    maxProperties: 0
                  - type: object
                    properties:
                      ok:
                        const: true
                        type: boolean
                      ignored:
                        type: string
                    required:
                      - ok
        '401':
          description: >-
            Unknown or inactive endpoint, inactive app, or invalid or missing
            secret. For RevenueCat endpoints with a configured signing secret, a
            missing, invalid, or stale signature also returns 401.
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                    const: Unauthorized
                required:
                  - message
        '413':
          description: The request exceeds the 1 MB webhook body limit at the gateway.
        '500':
          description: >-
            Event processing failed. RevenueCat retries failed deliveries.
            Adapty returns {"ok":false,"error":"internal_error"}.
      security:
        - WebhookSecret: []
components:
  securitySchemes:
    WebhookSecret:
      type: apiKey
      in: header
      name: Authorization
      description: The assigned webhook secret, sent as whs_… or Bearer whs_….

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.