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

# Create webhook endpoint

> Register a new webhook endpoint for the authenticated client. The plaintext signing secret is returned only in this response.



## OpenAPI

````yaml https://api.qa.nlbs.ai/api/openapi.json post /webhooks/endpoints
openapi: 3.1.0
info:
  description: >-
    NL Labs AI AML API. Use Bearer API keys for protected endpoints. The /live
    and /ready probes are public.
  title: NL Labs AI
  version: 0.1.0
servers:
  - url: https://api.qa.nlbs.ai/api
security:
  - ApiKeyAuth: []
tags:
  - description: Runtime health checks and source freshness endpoints.
    name: health
  - description: Canonical entity lookup endpoints used before starting analyses.
    name: entities
  - description: AML analysis creation, status, result, and debug endpoints.
    name: analyses
  - description: Regulatory report (Motor 2) creation, status, result, and debug endpoints.
    name: reports
  - description: Versioned deterministic rules catalog endpoints.
    name: rules
  - description: Versioned regulatory reference catalog endpoints.
    name: regulatory
  - description: Webhook endpoint configuration and delivery-event operations.
    name: webhooks
paths:
  /webhooks/endpoints:
    post:
      tags:
        - webhooks
      summary: Create webhook endpoint
      description: >-
        Register a new webhook endpoint for the authenticated client. The
        plaintext signing secret is returned only in this response.
      operationId: create_webhook_endpoint
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/WebhookEndpointCreateRequest'
        required: true
      responses:
        '201':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/WebhookEndpointCreateResponse'
          description: Successful Response
        '401':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
          description: Missing, malformed, expired, or invalid Bearer API key.
        '403':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
          description: The authenticated API key does not have the required scope.
        '422':
          description: >-
            Invalid request body, path parameter, query parameter, or business
            rule.
      security:
        - HTTPBearer: []
components:
  schemas:
    WebhookEndpointCreateRequest:
      examples:
        - name: Frontend callback
          subscribed_events:
            - webhook.test
          url: https://example.com/webhooks/nllabs
      properties:
        name:
          description: Human-readable webhook endpoint name.
          examples:
            - Frontend callback
          maxLength: 128
          minLength: 1
          title: Name
          type: string
        subscribed_events:
          description: Webhook event types delivered to this endpoint.
          examples:
            - - webhook.test
          items:
            type: string
          minItems: 1
          title: Subscribed Events
          type: array
        url:
          description: HTTPS destination URL that will receive webhook events.
          examples:
            - https://example.com/webhooks/nllabs
          maxLength: 2048
          minLength: 1
          title: Url
          type: string
      required:
        - name
        - url
        - subscribed_events
      title: WebhookEndpointCreateRequest
      type: object
    WebhookEndpointCreateResponse:
      description: >-
        Returned ONCE at creation — includes plaintext secret. Never returned
        again.
      properties:
        consecutive_failures:
          description: Current consecutive delivery failure count.
          title: Consecutive Failures
          type: integer
        created_at:
          description: Endpoint creation timestamp.
          format: date-time
          title: Created At
          type: string
        disabled_at:
          anyOf:
            - format: date-time
              type: string
            - type: 'null'
          description: Timestamp when the endpoint was disabled.
          title: Disabled At
        last_failure_at:
          anyOf:
            - format: date-time
              type: string
            - type: 'null'
          description: Last failed delivery timestamp.
          title: Last Failure At
        last_success_at:
          anyOf:
            - format: date-time
              type: string
            - type: 'null'
          description: Last successful delivery timestamp.
          title: Last Success At
        name:
          description: Human-readable webhook endpoint name.
          title: Name
          type: string
        secret:
          description: Plaintext signing secret returned only once.
          title: Secret
          type: string
        status:
          description: Endpoint lifecycle status.
          title: Status
          type: string
        subscribed_events:
          description: Subscribed webhook event types.
          items:
            type: string
          title: Subscribed Events
          type: array
        updated_at:
          description: Endpoint last update timestamp.
          format: date-time
          title: Updated At
          type: string
        url:
          description: Destination URL.
          title: Url
          type: string
        uuid:
          description: Webhook endpoint UUID.
          format: uuid
          title: Uuid
          type: string
      required:
        - uuid
        - name
        - url
        - status
        - subscribed_events
        - consecutive_failures
        - last_success_at
        - last_failure_at
        - disabled_at
        - created_at
        - updated_at
        - secret
      title: WebhookEndpointCreateResponse
      type: object
    ErrorResponse:
      properties:
        detail:
          description: Stable public error message.
          examples:
            - Resource not found.
          title: Detail
          type: string
      required:
        - detail
      title: ErrorResponse
      type: object
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: X-API-Key

````