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

# Create Webhook



## OpenAPI

````yaml /api-reference/v2/openapi.json POST /v2/webhooks
openapi: 3.1.1
info:
  title: LoyaltyLion Admin API
  version: v2
servers:
  - url: https://api.loyaltylion.com
security: []
tags:
  - name: identity
  - name: activities
  - name: orders
  - name: transactions
  - name: customers
  - name: webhooks
  - name: emails
  - name: sites
  - name: reviews
  - name: rewards
  - name: integrations
  - name: gatsby
paths:
  /v2/webhooks:
    post:
      tags:
        - webhooks
      operationId: webhooks.createWebhook
      parameters: []
      requestBody:
        description: Body
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/WebhooksCreateWebhookRequestBody'
      responses:
        '201':
          description: '201'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/WebhooksCreateWebhookResponseBody'
        '400':
          $ref: '#/components/responses/ClientErrorBadRequest'
        '401':
          description: '401'
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: object
                    properties:
                      message:
                        type: string
                      details:
                        type: object
                        propertyNames:
                          type: string
                        additionalProperties:
                          type: string
                    required:
                      - message
                    additionalProperties: false
                required:
                  - error
                additionalProperties: false
        '403':
          description: '403'
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: object
                    properties:
                      message:
                        type: string
                    required:
                      - message
                    additionalProperties: false
                required:
                  - error
                additionalProperties: false
        '422':
          description: '422'
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: object
                    properties:
                      message:
                        type: string
                    required:
                      - message
                    additionalProperties: false
                required:
                  - error
                additionalProperties: false
      security:
        - ProgramApiKey: []
        - SiteTokenSecret: []
components:
  schemas:
    WebhooksCreateWebhookRequestBody:
      type: object
      properties:
        webhook:
          type: object
          properties:
            topic:
              type: string
              enum:
                - customers/update
                - loyalty_emails/unsubscribe
                - program_events/customer.enrolled
                - program_events/customer.tier_upgraded
                - program_events/customer.tier_downgraded
                - program_events/customer.points_earned
                - program_events/customer.reward_available_notification
                - program_events/customer.recurring_reward_available_reminder
                - program_events/customer.claimed_reward
                - program_events/customer.referral_complete
                - program_events/customer.rule_completed
                - program_events/customer.approaching_tier_upgrade
                - program_events/customer.moved_to_at_risk_segment
                - program_events/customer.moved_to_defected_segment
                - program_events/customer.moved_to_loyal_segment
                - program_events/customer.approaching_points_expiration
                - program_events/customer.approaching_reward_expiration
                - receipts/manual_approval_required
                - program_events/customer.receipt_approved
                - program_events/customer.receipt_declined
            address:
              example: https://example.com/webhook
              description: >-
                The full URL which will receive webhook requests. This should 
                start with `https://`
              type: string
              format: uri
            service_integration_id:
              type: number
          required:
            - topic
            - address
          additionalProperties: false
      required:
        - webhook
      additionalProperties: false
    WebhooksCreateWebhookResponseBody:
      type: object
      properties:
        webhook:
          type: object
          properties:
            id:
              type: number
            topic:
              type: string
              enum:
                - rewards/store_fulfilment
                - customers/update
                - loyalty_emails/unsubscribe
                - program_events/customer.enrolled
                - program_events/customer.tier_upgraded
                - program_events/customer.tier_downgraded
                - program_events/customer.points_earned
                - program_events/customer.reward_available_notification
                - program_events/customer.recurring_reward_available_reminder
                - program_events/customer.claimed_reward
                - program_events/customer.referral_complete
                - program_events/customer.rule_completed
                - program_events/customer.approaching_tier_upgrade
                - program_events/customer.moved_to_at_risk_segment
                - program_events/customer.moved_to_defected_segment
                - program_events/customer.moved_to_loyal_segment
                - program_events/customer.approaching_points_expiration
                - program_events/customer.approaching_reward_expiration
                - receipts/manual_approval_required
                - program_events/customer.receipt_approved
                - program_events/customer.receipt_declined
            address:
              example: https://example.com/webhook
              description: >-
                The full URL which will receive webhook requests. This should 
                start with `https://`
              type: string
            created_at:
              description: '`ISO 8601` timestamp indicating when the webhook was created'
              type: string
            updated_at:
              description: '`ISO 8601` timestamp indicating when the webhook was updated'
              type: string
            service_integration_id:
              description: The ID of the integration that owns this webhook, if any
              type: number
          required:
            - id
            - topic
            - address
            - created_at
            - updated_at
          additionalProperties: false
      required:
        - webhook
      additionalProperties: false
  responses:
    ClientErrorBadRequest:
      description: Bad Request
      content:
        application/json:
          schema:
            type: object
            properties:
              error:
                type: object
                properties:
                  message:
                    type: string
                  details:
                    type: object
                    additionalProperties:
                      type: string
                required:
                  - message
            required:
              - error
  securitySchemes:
    ProgramApiKey:
      type: http
      scheme: bearer
      description: >-
        An API key linked to a Program in LoyaltyLion, with a set of permissions
        (scopes). API keys can be created manually, or acquired through an
        OAuth2 flow. The API key should be provided as a `Bearer` token in the
        `Authorization` header
    SiteTokenSecret:
      type: http
      scheme: basic
      description: >-
        [DEPRECATED] Authenticate using a LoyaltyLion site's `token` as
        username, and its `secret` as the password. This authentication method
        is deprecated and will be removed in future. Use the `ProgramApiKey`
        authentication method instead

````