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

# Register a URL to receive webhooks

> Needs the crypto:webhooks:manage scope. The URL must be https on a public host name or address. It is sent a signed `webhook.test` event first and is saved only if it answers with a 2xx status, so a mistyped URL is caught now. The signing secret is in the answer once and cannot be shown again: store it. Each account may have at most 5 active endpoints per environment.




## OpenAPI

````yaml /openapi.yaml post /v1/webhooks/endpoints
openapi: 3.1.0
info:
  title: Taramiz Crypto API (live gateway)
  version: 0.1.0
  description: >
    Generate crypto deposit addresses. Draft: describes the endpoint built so
    far. Must be kept in step with the gateway by hand until it is generated.
servers:
  - url: http://127.0.0.1:44010
    description: Local development (task dev)
security:
  - bearerAuth: []
paths:
  /v1/webhooks/endpoints:
    post:
      summary: Register a URL to receive webhooks
      description: >
        Needs the crypto:webhooks:manage scope. The URL must be https on a
        public host name or address. It is sent a signed `webhook.test` event
        first and is saved only if it answers with a 2xx status, so a mistyped
        URL is caught now. The signing secret is in the answer once and cannot
        be shown again: store it. Each account may have at most 5 active
        endpoints per environment.
      operationId: createWebhookEndpoint
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateWebhookEndpointRequest'
            example:
              url: https://example.com/webhooks/taramiz
              description: Production receiver
      responses:
        '201':
          description: The endpoint, with its signing secret.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/WebhookEndpointWithSecret'
        '400':
          description: >-
            The body is invalid, the URL is not allowed, or it did not answer
            the test event with 2xx.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '409':
          description: too_many_endpoints. Disable an endpoint first.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '503':
          $ref: '#/components/responses/Unavailable'
components:
  schemas:
    CreateWebhookEndpointRequest:
      type: object
      additionalProperties: false
      required:
        - url
      properties:
        url:
          type: string
          maxLength: 2048
          description: An https URL on a public host name or address.
        description:
          type: string
          maxLength: 200
    WebhookEndpointWithSecret:
      allOf:
        - $ref: '#/components/schemas/WebhookEndpoint'
        - type: object
          required:
            - secret
          properties:
            secret:
              type: string
              description: The signing secret (whsec_...). Shown only in this answer.
    Error:
      type: object
      required:
        - error
      properties:
        error:
          type: object
          required:
            - code
            - message
          properties:
            code:
              type: string
              description: Stable machine-readable code.
              enum:
                - invalid_request
                - unauthorized
                - product_not_enabled
                - insufficient_scope
                - idempotency_conflict
                - request_in_progress
                - payload_too_large
                - not_found
                - service_unavailable
                - internal_error
            message:
              type: string
    WebhookEndpoint:
      type: object
      required:
        - id
        - environment
        - url
        - description
        - status
        - secret_prefix
        - previous_secret_expires_at
        - created_at
      properties:
        id:
          type: string
          format: uuid
        environment:
          type: string
          enum:
            - live
            - sandbox
            - test
        url:
          type: string
        description:
          type:
            - string
            - 'null'
        status:
          type: string
          enum:
            - active
            - disabled
        secret_prefix:
          type: string
          description: The first characters of the current secret, to tell secrets apart.
        previous_secret_expires_at:
          type:
            - string
            - 'null'
          format: date-time
          description: >-
            While a rotation settles, the previous secret also works until this
            time.
        created_at:
          type: string
          format: date-time
  responses:
    Unauthorized:
      description: Missing or invalid API key.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    Forbidden:
      description: >-
        product_not_enabled, or insufficient_scope (the key lacks the scope this
        call needs).
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    Unavailable:
      description: Temporarily unavailable. Try again.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: 'API key, sent as `Authorization: Bearer <key>`.'

````

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