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

# Create a webhook subscription

> Create a webhook subscription by configuring an endpoint to receive notifications.




## OpenAPI

````yaml openapi/configurations.yaml post /v2/cpn/notifications/subscriptions
openapi: 3.0.3
info:
  version: '1.0'
  title: API Overview
  description: Common endpoints shared across all CPN APIs.
  license:
    name: Proprietary
    url: https://www.circle.com/legal
servers:
  - url: https://api.circle.com
security: []
tags:
  - name: Health
    description: Inspect the health of the API.
  - name: Webhook Subscriptions
    description: Manage subscriptions to notifications.
paths:
  /v2/cpn/notifications/subscriptions:
    post:
      tags:
        - Webhook Subscriptions
      summary: Create a webhook subscription
      description: >
        Create a webhook subscription by configuring an endpoint to receive
        notifications.
      operationId: createSubscription
      parameters:
        - $ref: '#/components/parameters/XRequestId'
      requestBody:
        $ref: '#/components/requestBodies/CreateSubscription'
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SubscriptionResponse'
          description: Successfully created a webhook subscription.
          headers:
            X-Request-Id:
              $ref: '#/components/headers/XRequestId'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/NotAuthorized'
      security:
        - BearerAuth: []
components:
  parameters:
    XRequestId:
      name: X-Request-Id
      description: >-
        Developer-provided parameter used to identify this request. Useful when
        communicating with Circle Support.
      in: header
      schema:
        $ref: '#/components/schemas/XRequestId'
  requestBodies:
    CreateSubscription:
      content:
        application/json:
          schema:
            description: Required parameters to create a new subscription.
            type: object
            required:
              - endpoint
            properties:
              endpoint:
                type: string
                description: >-
                  URL of the endpoint to subscribe to notifications. Must be
                  publicly accessible, use HTTPS, and respond with a 2XX status
                  to a POST request.
                example: https://example.org/handler/for/notifications
              notificationTypes:
                type: array
                description: >-
                  The notification types to subscribe to. If not provided, the
                  webhook will be unrestricted, and a notification is sent for
                  every notification type. If the wildcard (`*`) or any
                  combination of the wildcard and a set of notification types is
                  provided, the webhook will also be unrestricted. If a set of
                  notification types are provided, the webhook will be
                  restricted. The restricted status of the webhook is returned
                  in the response object. Each category of notification types
                  also has a wildcard, which will restrict to all notification
                  types from that category.
                items:
                  $ref: '#/components/schemas/NotificationType'
                example:
                  - '*'
      required: true
      description: Schema for the request payload to create a new subscription.
  schemas:
    SubscriptionResponse:
      title: SubscriptionResponse
      type: object
      properties:
        data:
          $ref: '#/components/schemas/Subscription'
    XRequestId:
      type: string
      description: >-
        A unique identifier, which can be helpful for identifying a request when
        communicating with Circle support.
      example: 2adba88e-9d63-44bc-b975-9b6ae3440dde
    NotificationType:
      type: string
      description: >
        The type of notification that can be subscribed to. 

        Supports wildcard patterns (e.g., 'cpn.payment.*') to subscribe to all
        notifications within a category.

        The '*' wildcard can be used to subscribe to all notifications.
      enum:
        - '*'
        - cpn.payment.*
        - cpn.payment.cryptoFundsPending
        - cpn.payment.fiatPaymentInitiated
        - cpn.payment.completed
        - cpn.payment.failed
        - cpn.payment.delayed
        - cpn.rfi.*
        - cpn.rfi.informationRequired
        - cpn.rfi.inReview
        - cpn.rfi.approved
        - cpn.rfi.rejected
        - cpn.transaction.*
        - cpn.transaction.broadcasted
        - cpn.transaction.completed
        - cpn.transaction.failed
      example: cpn.payment.completed
    Subscription:
      type: object
      title: Subscription
      description: Contains information about a webhook notification subscription.
      required:
        - id
        - name
        - endpoint
        - enabled
        - createDate
        - updateDate
      properties:
        id:
          $ref: '#/components/schemas/Id'
        name:
          type: string
          description: Name of the webhook notification subscription.
          example: Transactions Webhook
        endpoint:
          type: string
          description: >-
            URL of the endpoint subscribing to notifications. Must be enabled to
            receive notifications.
          example: https://example.org/handler/for/notifications
        enabled:
          type: boolean
          description: >-
            Whether the subscription is enabled. `true` indicates the
            subscription is enabled.
          example: true
        createDate:
          $ref: '#/components/schemas/CreateDate'
        updateDate:
          $ref: '#/components/schemas/UpdateDate'
        notificationTypes:
          type: array
          description: The notification types on which a notification will be sent.
          items:
            $ref: '#/components/schemas/NotificationType'
          example:
            - '*'
        restricted:
          type: boolean
          description: >-
            Whether the webhook is restricted to specific notification types. An
            unrestricted webhook will notify on all notification types. A
            restricted webhook will only notify on the notification types in the
            `notificationTypes` field.
          example: false
    ErrorCode:
      title: ErrorCode
      type: integer
      description: Code that corresponds to the error.
      enum:
        - -1
        - 0
        - 1
        - 2
        - 3
        - 290000
        - 290001
        - 290100
        - 290101
        - 290102
        - 290103
        - 290200
        - 290201
        - 290202
        - 290203
        - 290204
        - 290205
        - 290206
        - 290211
        - 290300
        - 290301
        - 290302
        - 290303
        - 290304
        - 290305
        - 290306
        - 290307
        - 290308
        - 290309
        - 290310
        - 290311
        - 290312
        - 290313
        - 290314
        - 290315
        - 290316
        - 290317
        - 290318
        - 290319
        - 290320
        - 290321
        - 290322
        - 290323
        - 290324
        - 290325
        - 290327
        - 290328
        - 290329
        - 290330
        - 290331
        - 290332
        - 290333
        - 290338
        - 290339
        - 290340
        - 290341
        - 290349
        - 290352
        - 290400
        - 290401
        - 290500
        - 290502
        - 290503
        - 290600
        - 290601
        - 290602
        - 290603
        - 290604
        - 290605
        - 290606
      x-enum-descriptions:
        - Unknown error
        - Success
        - API parameter missing
        - API parameter invalid
        - Forbidden
        - >-
          Parameters of request do not match the tenancy environment associated
          with request
        - A request with this idempotency key has already been processed.
        - Amount provided is outside our supported limits
        - No bfis available to create requested quote
        - Parameters of request do not match any supported payment routes
        - Route does not support the requested use case
        - Quote not found with provided id
        - Quote already used by another payment
        - Quote past timestamp at which it expires
        - Blockchain for sender address does not blockchain requested in quote
        - Provided wallet address is on sanctioned lists
        - Pending RFI verification
        - RFI rejected
        - Payment use case does not match the quote.
        - Payment already has an associated active or completed transaction
        - Blockchain is not supported by CPN
        - Blockchain is not supported for V2 transactions
        - Submitting a transaction not in submittable status
        - Payment not in correct status for processing a onchain transfer
        - The payment is not found
        - The transaction is not found
        - A signed transaction for the transaction has already been submitted
        - The payment is expired
        - >-
          The signed transaction is expired. Solana has a concept of recent
          blockhash in a transaction that expires after 150 blocks (~1 min)
        - >-
          The nonce in the signed transaction is lower than the current wallet
          nonce
        - The signed transaction payload does not match the payment
        - The sender's wallet balance is insufficient
        - The fee payer wallet lacks enough gas
        - >-
          The CPN Payment ID provided in the signed data (e.g., in the Solana
          memo or EIP-712 structure) does not match the expected value
        - >-
          The gas price in the signed transaction is below network thresholds.
          The fee must exceed the estimated high fee to ensure prompt
          confirmation
        - >-
          When resubmitting (e.g., for acceleration), the wallet address to sign
          the raw transaction or nonce does not match the original submission
        - >-
          The full node used by CPN is currently unavailable or returns an
          unexpected error during transaction validation
        - The Payment Ref ID has already been used on-chain
        - >-
          For EVM chains, the gas limit in the signed transaction is
          insufficient to cover the execution costs. For Solana, the allocated
          compute budget falls short of the transaction's requirements,
          preventing successful execution
        - >-
          The nonce has already been used with the same sender in another signed
          transaction submission for a CPN payment. The OFI must use a unique
          nonce
        - The signature in the transaction is invalid
        - Provided wallet address is on sanctioned lists
        - The blockchain is not supported by CPN
        - The cross-chain is not supported by CPN yet
        - Completed transaction exist. No need to accelerate
        - The signed transaction cannot be decoded or is invalid
        - The Solana account specified for transaction is not found
        - The targetted transaction for action is expired
        - >-
          Please sign existing transaction or wait for signed transaction to be
          broadcast
        - No broadcasted transaction to be accelerated
        - The Solana account specified for transaction is invalid
        - >-
          Another transaction for the same CPN payment has already been
          submitted and is being broadcasted
        - >-
          A signature for the transaction has already been submitted and
          accepted.
        - >-
          The submitted signature cannot be verified against the typed data to
          be signed. This typically indicates that the signature signed with the
          wrong private key, or the typed data gets manipulated before signing.
        - >-
          The ERC-20 allowance granted to the Permit2 contract is insufficient
          to cover the total required token amount for the payment, including
          both the payment amount and associated fees.
        - >-
          The Permit2 nonce included in the typed data for the sender has
          already been used.
        - >-
          Blockchain is not supported for V1 transactions; use
          transactionVersion=VERSION_2.
        - >-
          The signed transaction was submitted after the onchain settlement
          cutoff.
        - RFI is past timestamp at which it expires
        - RFI cannot be submitted in current status
        - >-
          The decryption process failed, possibly due to an invalid key or
          corrupted data
        - >-
          The JWE compact payload is not formatted correctly or is missing
          required components
        - >-
          The JWE compact payload was not encrypted with a supported encryption
          algorithm
        - Ticket reference ID is required for escalation tickets
        - Original ticket not found with provided reference ID
        - Issue type is not allowed for this origin
        - Payment not found with provided ID
        - Failed to create Circle Salesforce support ticket
        - Failed to create a BFI support ticket
        - Support ticket not found with provided ID
    DescriptiveError:
      title: DescriptiveError
      type: object
      required:
        - error
        - message
      properties:
        error:
          $ref: '#/components/schemas/DescriptiveErrorType'
        location:
          type: string
          nullable: true
          description: The key or path where the error occurred
        message:
          type: string
          description: Detailed description of the error
    Id:
      type: string
      format: uuid
      description: System-generated unique identifier of the resource.
      example: c4d1da72-111e-4d52-bdbf-2e74a2d803d5
    CreateDate:
      type: string
      format: date-time
      description: Date and time when the resource was created
      example: '2023-01-01T12:04:05Z'
    UpdateDate:
      type: string
      format: date-time
      description: Date and time when the resource was last updated
      example: '2023-01-01T12:04:05Z'
    DescriptiveErrorType:
      title: DescriptiveErrorType
      type: string
      enum:
        - MISSING_OR_INVALID_FIELD
      description: Type of descriptive error
  headers:
    XRequestId:
      description: >
        Circle-generated universally unique identifier (UUID v4). Useful for
        identifying a specific request when communicating with Circle Support.
      schema:
        $ref: '#/components/schemas/XRequestId'
  responses:
    BadRequest:
      content:
        application/json:
          schema:
            type: object
            title: BadRequestResponse
            required:
              - code
              - message
            properties:
              code:
                $ref: '#/components/schemas/ErrorCode'
              message:
                type: string
                description: Human-readable message that describes the error.
                example: Unknown error occurred
              errors:
                type: array
                description: Array of detailed error descriptions
                items:
                  $ref: '#/components/schemas/DescriptiveError'
            example:
              code: 400
              message: Bad request.
      description: Request cannot be processed due to a client error.
      headers:
        X-Request-Id:
          $ref: '#/components/headers/XRequestId'
    NotAuthorized:
      content:
        application/json:
          schema:
            type: object
            title: NotAuthorizedResponse
            required:
              - code
              - message
            properties:
              code:
                $ref: '#/components/schemas/ErrorCode'
              message:
                type: string
                description: Human-readable message that describes the error.
                example: Unknown error occurred
              errors:
                type: array
                description: Array of detailed error descriptions
                items:
                  $ref: '#/components/schemas/DescriptiveError'
            example:
              code: 401
              message: Malformed authorization.
      description: >-
        Request has not been applied because it lacks valid authentication
        credentials.
      headers:
        X-Request-Id:
          $ref: '#/components/headers/XRequestId'
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      bearerFormat: PREFIX:ID:SECRET
      description: >-
        Circle's API Keys are formatted in the following structure
        "PREFIX:ID:SECRET". All three parts are requred to make a successful
        request.

````