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

# Create a Webhook

> Create a global or pay link webhook using this endpoint. To create a global webhook, do not specify a paylinkId.

<Info>
  **Note:** When using the production environment at [moonpay.hel.io](http://app.hel.io), set your API endpoint to `api.hel.io/v1` and generate API keys there. For the development environment, use `api.dev.hel.io/v1` and generate API keys from [moonpay.dev.hel.io](http://app.dev.hel.io).
</Info>


## OpenAPI

````yaml POST /v1/webhook/paylink/api-key
openapi: 3.0.0
info:
  title: Helio Open API
  description: |-
    API schema and definitions for Helio API. <br/> 
          The API is using two types of Authentication, for dashboard endpoints we use <b>JSON Web Token (JWT)</b> that is generated by self custodial wallet signing a message from API.</br> 
          We also support authentication with <b>API Key and Secret</b> which can be generated on <a href='https://hel.io'>Helio dashboard</a>.
  version: 1.0.0
  contact: {}
servers:
  - description: Helio API (Mainnet)
    url: https://api.hel.io
  - description: Helio API (Devnet)
    url: https://api.dev.hel.io
security: []
tags:
  - name: Webhooks
  - name: Exports
  - name: Currencies
    description: >-
      Supported currencies endpoint, includes fiat and digital assets
      </br><i>Authentication: </i><b>None</b>
externalDocs:
  description: Helio product documentation
  url: https://docs.hel.io/
paths:
  /v1/webhook/paylink/api-key:
    post:
      tags:
        - Webhooks
      summary: Create a Webhook
      description: >-
        Create a global or pay link webhook using this endpoint. To create a
        global webhook, do not specify a paylinkId.
      operationId: PaylinkTransactionHookController_createWebHook
      parameters:
        - name: apiKey
          required: true
          in: query
          description: >-
            Your API key can be generated on the Helio Dashboard’s settings
            page.
          schema:
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateWebHookDto'
      responses:
        '201':
          description: Webhook created successfully.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PaylinkTransactionHookEntity'
              examples:
                webhookCreationResponse:
                  summary: Webhook creation response
                  value:
                    id: 1234567890abcdef12345678
                    name: Example Webhook
                    targetUrl: https://example.com/webhook
                    inactive: false
                    createdAt: '2025-06-25T00:00:00.000Z'
                    paylink: abcdef1234567890abcdef12
                    isGlobal: true
                    sharedToken: dummySharedToken1234567890+/exampletoken==
        '401':
          description: Provided API key has no access to the resource.
          content:
            application/json:
              examples:
                unauthorized:
                  summary: Invalid or missing API key
                  value:
                    message: Api key or token is invalid
                    code: 401
      security:
        - bearer: []
components:
  schemas:
    CreateWebHookDto:
      type: object
      properties:
        name:
          type: string
          description: The name of the webhook.
        paylinkId:
          type: string
          description: >-
            The ID of the pay link the webhook is associated with. This field is
            optional — leave it blank to create a global webhook.
        targetUrl:
          type: string
          description: The URL that will receive the webhook payload when the event occurs.
      required:
        - name
        - targetUrl
    PaylinkTransactionHookEntity:
      type: object
      properties:
        events:
          type: string
          enum:
            - CREATED
        id:
          type: string
        paylink:
          type: string
        company:
          type: string
        targetUrl:
          type: string
        sharedToken:
          type: string
        creator:
          type: string
      required:
        - events
        - id
        - paylink
        - company
        - targetUrl
        - sharedToken
  securitySchemes:
    bearer:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: Authentication using JWT token

````