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

# Registrar una suscripción de webhook

> Registra una suscripción de webhook para el tenant de la solicitud. El secreto en bruto se usa únicamente para derivar un hash SHA-256 (nunca se persiste en texto plano); en BYOC el secreto de firma real proviene del Secret de Kubernetes del cliente. La presencia/el tipo de los campos se valida contra el esquema (422); los fallos de reglas de negocio devuelven problem+json con código 400/409/422.



## OpenAPI

````yaml es/openapi/v3-current/slc.yaml post /webhooks
openapi: 3.1.0
info:
  description: >-
    API de Lerian SLC — el rail del lado del participante que conecta la
    institución con la liquidación de tarjetas por neto diferido SLC de Núclea.
    Cubre la admisión y el ciclo de vida de las operaciones de liquidación, las
    posiciones de compensación, el registro de participantes y arreglos, los
    informes generados, la consulta de esquemas XSD integrados, la recuperación
    de transmisión y la conectividad con Núclea, la importación de clave de
    firma BYOK Modelo A y los webhooks con alcance al tenant.
  title: Lerian SLC API
  version: 1.0.0
servers:
  - url: https://slc.sandbox.lerian.net
security:
  - BearerAuth: []
tags:
  - description: >-
      Ciclo de vida de las operaciones de liquidación — crea, lista, consulta y
      controla las operaciones de tarjeta rastreadas por NUliquid (NUliquid = el
      id de 21 posiciones que Núclea asigna a cada operación aceptada) a través
      de la máquina de estados.
    name: Operations
  - description: >-
      Catálogo de participantes — los adquirentes, subadquirentes, IF Domicílio
      (banco donde el establecimiento recibe sus ventas) y las IF de liquidación
      (instituciones financieras) que participan en la liquidación de tarjetas.
    name: Participants
  - description: >-
      Arreglos de tarjeta (configuraciones de bandeira/esquema, p. ej.
      Visa/Master/Elo) asociados a un participante.
    name: Arrangements
  - description: >-
      Orquestación de transporte regulado hacia Núclea/SILOC (la cámara de
      compensación privada de tarjetas que opera el sistema de liquidación
      SILOC) — despacho, recuperación, retransmisión y prueba de conectividad
      sobre transferencia de archivos gestionada, broker de mensajes y REST.
    name: Connectivity
  - description: >-
      Posiciones de compensación de neteo multilateral — el monto neto que cada
      participante liquida por ciclo STR (STR = sistema de transferencia de
      reservas del Banco Central).
    name: Clearing
  - description: >-
      Aprovisionamiento de clave de firma SaaS BYOK (Bring Your Own Key) —
      importa parámetros y registra el material del certificado ICP-Brasil A1
      del cliente (certificado de servidor de la PKI brasileña, validez de 1
      año) usado para firmar archivos ASLC; la clave privada nunca sale del
      HSM/KMS/Vault del cliente.
    name: SigningKey
  - description: >-
      Admisión y estado de archivos ASLC — envío en modo passthrough y estado de
      procesamiento de los archivos XML oficiales de liquidación de tarjetas de
      Núclea (ASLC = Arquivo do Sistema de Liquidação de Cartões).
    name: Files
  - description: >-
      Introspección de solo lectura de los esquemas XSD ASLC/RSFN (Red del
      Sistema Financiero Nacional) integrados de Núclea usados para validar los
      mensajes salientes y entrantes.
    name: XSD Schemas
  - description: >-
      Informes de liquidación regulatorios, de cumplimiento y operativos, de
      solo lectura.
    name: Reports
  - description: >-
      Suscripciones a webhooks de eventos de negocio salientes y gestión de
      entrega para los consumidores (Midaz, ledgers del cliente, Cabine — todos
      opcionales).
    name: Webhooks
  - description: >-
      Operaciones administrativas — configuración de tiempo de ejecución
      recargable en caliente, inspección/reenvío de la cola de mensajes muertos
      y redespacho del outbox.
    name: Admin
paths:
  /webhooks:
    post:
      tags:
        - Webhooks
      summary: Registrar una suscripción de webhook
      description: >-
        Registra una suscripción de webhook para el tenant de la solicitud. El
        secreto en bruto se usa únicamente para derivar un hash SHA-256 (nunca
        se persiste en texto plano); en BYOC el secreto de firma real proviene
        del Secret de Kubernetes del cliente. La presencia/el tipo de los campos
        se valida contra el esquema (422); los fallos de reglas de negocio
        devuelven problem+json con código 400/409/422.
      operationId: createWebhook
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateWebhookRequest'
        required: true
      responses:
        '201':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/WebhookResponse'
          description: Created
        '501':
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/Detail'
          description: >-
            Not Implemented: this capability is not part of this deployment.
            Operations are registered unconditionally so the published contract
            is identical across deploy shapes; when the capability behind one
            did not compose here (authentication disabled, no database, no
            outbound transport, or the feature switched off) it answers this
            coded SLC-0012 problem. It is definitive for this deployment:
            retrying does not help, and the `detail` is deliberately scrubbed
            (any status >= 500 is).
        default:
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/Detail'
          description: Error
components:
  schemas:
    CreateWebhookRequest:
      additionalProperties: false
      properties:
        active:
          description: Whether the subscription is active and eligible for delivery.
          examples:
            - true
          type: boolean
        description:
          description: Optional human-readable label for the subscription.
          examples:
            - Primary settlement consumer
          type: string
        events:
          description: Business event types this subscription is delivered.
          examples:
            - - operation.settled
              - operation.rejected
          items:
            type: string
          type:
            - array
            - 'null'
        headers:
          additionalProperties:
            type: string
          description: >-
            Optional static HTTP headers added to every delivery request to this
            endpoint.
          type: object
        secret:
          description: >-
            Raw signing secret used only to derive the SHA-256 HMAC signing key;
            never persisted or echoed in cleartext. In BYOC the real signing
            secret comes from the client's Kubernetes Secret.
          type: string
        timeoutSeconds:
          description: >-
            Optional per-delivery HTTP timeout in seconds; omitted or zero
            applies the service default (10s).
          examples:
            - 10
          format: int32
          type: integer
        url:
          description: >-
            HTTPS endpoint that receives webhook deliveries for the request
            tenant.
          examples:
            - https://client.example.com/webhooks/slc
          format: uri
          type: string
      required:
        - url
        - events
      type: object
    WebhookResponse:
      additionalProperties: false
      properties:
        active:
          description: Whether the subscription is active and eligible for delivery.
          examples:
            - true
          type: boolean
        createdAt:
          description: Subscription creation timestamp (RFC3339, UTC).
          examples:
            - '2026-06-15T07:50:00Z'
          format: date-time
          type: string
        description:
          description: Human-readable label for the subscription.
          examples:
            - Primary settlement consumer
          type: string
        events:
          description: Business event types this subscription is delivered.
          examples:
            - - operation.settled
              - operation.rejected
          items:
            type: string
          type:
            - array
            - 'null'
        failureCount:
          description: Cumulative count of failed delivery attempts.
          examples:
            - 3
          format: int64
          type: integer
        id:
          description: Subscription id (UUID).
          examples:
            - 018f8a3e-4b2c-7c1a-9e5d-2f6a1b3c4d5e
          type: string
        lastDeliveryAt:
          description: >-
            Timestamp of the most recent delivery attempt (RFC3339, UTC); null
            when none has occurred.
          examples:
            - '2026-06-15T07:50:00Z'
          format: date-time
          type:
            - string
            - 'null'
        lastDeliveryStatus:
          description: >-
            HTTP status code of the most recent delivery attempt; null when none
            has occurred.
          examples:
            - 200
          format: int32
          type:
            - integer
            - 'null'
        successCount:
          description: Cumulative count of successful deliveries.
          examples:
            - 128
          format: int64
          type: integer
        updatedAt:
          description: Subscription last-update timestamp (RFC3339, UTC).
          examples:
            - '2026-06-15T07:50:00Z'
          format: date-time
          type: string
        url:
          description: HTTPS endpoint that receives webhook deliveries.
          examples:
            - https://client.example.com/webhooks/slc
          type: string
      required:
        - id
        - url
        - events
        - active
        - successCount
        - failureCount
        - lastDeliveryAt
        - lastDeliveryStatus
        - createdAt
        - updatedAt
      type: object
    Detail:
      additionalProperties: false
      properties:
        code:
          description: >-
            Stable, machine-readable domain error code scoped to the emitting
            service (format: <SERVICE>-NNNN).
          examples:
            - ERR-0001
          type: string
        detail:
          description: >-
            A human-readable explanation specific to this occurrence of the
            problem.
          examples:
            - Property foo is required but is missing.
          type: string
        errors:
          description: Optional list of individual error details
          items:
            $ref: '#/components/schemas/ErrorDetail'
          type:
            - array
            - 'null'
        instance:
          description: >-
            A URI reference that identifies the specific occurrence of the
            problem.
          examples:
            - https://example.com/error-log/abc123
          format: uri
          type: string
        status:
          description: HTTP status code
          examples:
            - 400
          format: int64
          type: integer
        title:
          description: >-
            A short, human-readable summary of the problem type. This value
            should not change between occurrences of the error.
          examples:
            - Bad Request
          type: string
        type:
          default: about:blank
          description: A URI reference to human-readable documentation for the error.
          examples:
            - https://example.com/errors/example
          format: uri
          type: string
      type: object
    ErrorDetail:
      additionalProperties: false
      properties:
        location:
          description: >-
            Where the error occurred, e.g. 'body.items[3].tags' or
            'path.thing-id'
          type: string
        message:
          description: Error message text
          type: string
        value:
          description: The value at the given location
      type: object
  securitySchemes:
    BearerAuth:
      bearerFormat: JWT
      description: JWT bearer token issued by the identity provider.
      scheme: bearer
      type: http

````