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

# Create a webhook endpoint

> Create a new webhook endpoint to receive events from Bridge. Webhook endpoints begin in a disabled state and can be enabled with a PUT request. A maximum of 5 webhooks can be active or disabled at one time. Webhook endpoints can be created in Sandbox, but no webhook events will be sent.



## OpenAPI

````yaml https://withbridge-image1-sv-usw2-monorail-openapi.s3.amazonaws.com/latest.json post /webhooks
openapi: 3.0.2
info:
  title: Bridge API
  description: APIs to move into, out of, and between any form of a dollar
  version: '1'
servers:
  - url: https://api.bridge.xyz/v0
    description: The base path for all resources
security:
  - ApiKey: []
tags:
  - name: Customers
  - name: Fiat Payout Configuration
  - name: External Accounts
  - name: Transfers
  - name: Prefunded Accounts
  - name: Balances
  - name: Liquidation Addresses
  - name: Developers
  - name: API Keys
  - name: Plaid
  - name: Virtual Accounts
  - name: Static Memos
  - name: Cards
  - name: Funds Requests
  - name: Webhooks
  - name: Lists
  - name: Crypto Return Policies
  - name: Rewards
  - name: Associated Persons
  - name: Sandbox
paths:
  /webhooks:
    post:
      tags:
        - Webhooks
      summary: Create a webhook endpoint
      description: >-
        Create a new webhook endpoint to receive events from Bridge. Webhook
        endpoints begin in a disabled state and can be enabled with a PUT
        request. A maximum of 5 webhooks can be active or disabled at one time.
        Webhook endpoints can be created in Sandbox, but no webhook events will
        be sent.
      parameters:
        - $ref: '#/components/parameters/IdempotencyKeyParameter'
      requestBody:
        description: Information about the webhook endpoint to be created
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateWebhook'
      responses:
        '201':
          description: Webhook endpoint created
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Webhook'
              examples:
                SuccessfulWebhookCreateResponse:
                  $ref: '#/components/examples/SuccessfulWebhookCreateResponse'
                  summary: Webhook created
        '400':
          $ref: '#/components/responses/BadRequestError'
        '401':
          $ref: '#/components/responses/AuthenticationError'
        '500':
          $ref: '#/components/responses/UnexpectedError'
components:
  parameters:
    IdempotencyKeyParameter:
      in: header
      name: Idempotency-Key
      required: true
      schema:
        type: string
  schemas:
    CreateWebhook:
      required:
        - url
        - event_epoch
      properties:
        url:
          description: >-
            The URL that the webhook will send events to. It must use the HTTPS
            scheme and have a valid X.509 certificate. The URL doesn't need to
            be live, but the host must be reachable.
          type: string
          minLength: 1
        event_epoch:
          description: >-
            Specifies the starting point from which this webhook will receive
            events. This should usually be set to "webhook_creation", unless
            there is a reason why this webhook needs to process events from
            before its creation. When this value is set to "webhook_creation",
            the webhook will receive a small number of events preceding its
            creation for convenience.
          type: string
          enum:
            - webhook_creation
            - beginning_of_time
        event_categories:
          type: array
          description: The list of event categories that the webhook endpoint will receive
          minItems: 0
          items:
            $ref: '#/components/schemas/WebhookEventCategory'
    Webhook:
      required:
        - id
        - url
        - status
        - public_key
      properties:
        id:
          type: string
          description: An identifier that uniquely identifies the webhook endpoint
          pattern: ^wep_[a-f0-9]+$
        url:
          type: string
          description: The URL that the webhook will send events to
        status:
          type: string
          description: >-
            The status of the webhook. Only active webhooks will receive events
            automatically.
          enum:
            - active
            - disabled
            - deleted
        public_key:
          type: string
          description: >-
            The public key (in PEM format) that should be used to verify the
            authenticity of webhook events
        event_categories:
          type: array
          description: The list of event categories that the webhook endpoint will receive
          minItems: 0
          items:
            $ref: '#/components/schemas/WebhookEventCategory'
    WebhookEventCategory:
      type: string
      description: The category of the webhook event
      enum:
        - customer
        - kyc_link
        - liquidation_address.drain
        - static_memo.activity
        - transfer
        - virtual_account.activity
        - bridge_wallet.activity
        - card_account
        - card_transaction
        - card_withdrawal
        - posted_card_account_transaction
        - external_account
    Error:
      required:
        - code
        - message
      properties:
        code:
          type: string
          minLength: 1
          maxLength: 256
        message:
          type: string
          minLength: 1
          maxLength: 512
        source:
          title: ErrorSource
          required:
            - location
            - key
          properties:
            location:
              type: string
              enum:
                - path
                - query
                - body
                - header
            key:
              type: string
              description: >-
                Comma separated names of the properties or parameters causing
                the error
  examples:
    SuccessfulWebhookCreateResponse:
      summary: Successful webhook endpoint creation
      value:
        id: wep_123
        url: https://my_endpoint.xyz/hooks
        status: disabled
        public_key: >-
          -----BEGIN PUBLIC
          KEY-----\nFJJ3hFnaPLmxxG4a5w0BAQEFAAOCAQ8AMIIBCgKCAQEAtYhc6PV2LOs/nqDRHi0B\nMKTsdMLHtg58a1NDxaYfw4IZJ3hpy1qIFUgt5X0HhCYZE0Y40MyLGIejPyitEjYw\ni9/aE+9F/PN+btqN7OK6cVuF9s/R9cZCtNc27UdTQXrUO5T8GXNAMmRr0KFh8yPv\nfIgpoZn5ZhnyRbZpDvrxHzLmcZJFAX8Ca+KZLzgGVybEqJtP6fKAT0zrrUS1z44s\nRDOLiXl543cRAmBnUyrT6cXiNz/PNbm4zRK5Nx7LGxBFrCWQCao4Yi8hrwWsnHxg\n0Tcy3UyZhAcgL6ydVJfLD5x58Ri4BN32WPBtgSSO6JxZZwCiX0d1BOgq7+eNgmzN\nJQIDAQAB\n-----END
          PUBLIC KEY-----\n
        event_categories:
          - customer
          - liquidation_address
          - virtual_account
          - virtual_account.activity
          - card_account
          - card_transaction
          - card_withdrawal
          - posted_card_account_transaction
  responses:
    BadRequestError:
      description: Request containing missing or invalid parameters.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          examples:
            BadCustomerRequestErrorExample:
              summary: Bad customer request
              value:
                code: bad_customer_request
                message: fields missing from customer body.
                name: first_name,ssn
    AuthenticationError:
      description: Missing or invalid API key
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          examples:
            MissingTokenError:
              summary: No Api-Key header
              description: The header may be missing or misspelled.
              value:
                code: required
                location: header
                name: Api-Key
                message: Missing Api-Key header
            InvalidTokenError:
              summary: Invalid key in Api-Key header
              value:
                code: invalid
                location: header
                name: Api-Key
                message: Invalid Api-Key header
    UnexpectedError:
      description: Unexpected error. User may try and send the request again.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          examples:
            UnexpectedError:
              summary: An unexpected error
              value:
                errors:
                  - code: unexpected
                    message: An expected error occurred, you may try again later
  securitySchemes:
    ApiKey:
      type: apiKey
      name: Api-Key
      in: header

````