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

# API per creare endpoint webhook

> Con Didit crea un endpoint webhook HTTPS per una lista di eventi, o per tutti quelli disponibili, e ottieni il segreto di firma in una chiamata.

L'API Create Webhook Endpoint di Didit aggiunge un endpoint HTTPS che riceve gli eventi indicati in `events`, oppure tutti gli eventi elencati da Didit con `["*"]`, e restituisce il suo `webhook_id` e il `secret` di firma.

L'endpoint è una [destinazione webhook](https://docs.didit.me/it/management-api/webhook/get-destination.md): `webhook_id` corrisponde al suo `destination_uuid`, quindi in seguito puoi modificarne gli eventi con [Aggiorna destinazione webhook](https://docs.didit.me/it/management-api/webhook/update-destination.md).

Conserva il segreto in modo sicuro e leggilo di nuovo come `secret_shared_key` da [Recupera destinazione webhook](https://docs.didit.me/it/management-api/webhook/get-destination.md). Consulta [Webhook](https://docs.didit.me/it/integration/webhooks.md) per gli eventi e per sapere come verificare una firma.


## OpenAPI

````yaml it/openapi-25.json POST /v3/webhooks/
openapi: 3.0.0
info:
  version: 3.0.0
  title: Didit Verification API
  description: Identity verification API. Authenticate with x-api-key header.
servers:
  - url: https://verification.didit.me
security: []
tags:
  - name: Bank Data
    description: >-
      Bank Link, connections, accounts, balances, transactions, institutions and
      coverage. One-time reads of real banks are open to live applications.
      Ongoing access with real banks is not open yet for live applications: it
      is available for sandbox applications with the Didit Test Bank, and opens
      country by country. Nothing is charged in sandbox. A call made with an API
      key needs a key that can reach Bank data: a full-access key can, and a
      scoped key needs `bank-data` in its scopes (read for reads, write for
      operations that change something). A scoped key without it is refused, and
      the call answers `403 bank_data_access_denied`. The account check is the
      exception: it needs write access to sessions, or full access, and not the
      Bank data scope. Raw bank data (accounts, balances, transactions and the
      change feed) also refuses a request that carries no API key.


      Every refusal under `/v3/bank/` except the account check's has the same
      JSON body (`code`, `message`, `request_id`, `field`, `next_action`,
      `retry_after`). A path that is not an operation, an id that is not a UUID
      or an unknown sub-resource answers `404 not_found` for every method, and
      any unexpected error answers `500 internal_error` with a `request_id`.
      Where Bank data is not available, every operation answers the platform's
      standard `404`, exactly as an unknown route does.
paths:
  /v3/webhooks/:
    post:
      tags:
        - Webhook
      summary: Add a webhook endpoint
      description: >-
        Create a webhook endpoint: an HTTPS endpoint that receives the events in
        `events`. Send the event types to deliver, or `["*"]` for every event
        Didit lists: `*` is expanded when the endpoint is created and the answer
        lists the event names it now carries. An event Didit does not know
        answers `400 invalid_events`.


        The endpoint it creates is the destination the Business Console lists
        and `GET /v3/webhook/destinations/` returns: `webhook_id` is that
        destination's `destination_uuid`, `secret` is the same signing secret as
        `secret_shared_key`, and `events` is its stored `subscribed_events`,
        changed later through `PATCH
        /v3/webhook/destinations/{destination_uuid}/`. `description` names it in
        the console; left out, it takes the host of `url`. The `(application,
        url)` pair must be unique among the application's destinations.


        Didit delivers events only to the HTTPS endpoint in `url`.


        **Errors.** `400 invalid_url`: `url` is not an HTTPS URL, or the
        application already has an endpoint at it. `400 invalid_events`: an
        event in `events` is not one Didit lists.


        A scoped API key needs `webhooks: write`.
      operationId: create_webhook
      parameters:
        - $ref: '#/components/parameters/IdempotencyKey'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/WebhookCreateRequest'
            examples:
              Phone events:
                summary: >-
                  An endpoint that receives session status changes and message
                  status updates
                value:
                  url: https://api.demo-app.example/didit/webhooks
                  events:
                    - status.updated
                    - message.status.updated
                  description: Phone events
      responses:
        '201':
          description: >-
            The signing secret is returned in `secret`. Store it securely. To
            retrieve it later, use the returned `webhook_id` as
            `destination_uuid` in `GET
            /v3/webhook/destinations/{destination_uuid}/`. That GET returns the
            signing secret in `secret_shared_key` for authorized callers.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/WebhookCreateResponse'
              examples:
                Created:
                  summary: >-
                    The endpoint's id, its signing secret and the events it
                    receives
                  value:
                    webhook_id: 8f14e45f-ceea-467f-a8d4-6f2b1c9b0d11
                    secret: tno2NTeRC1ZK3sBOYlBJDyEzBVENl3pQ1AcZyAW0xnQ
                    events:
                      - status.updated
                      - message.status.updated
        '400':
          description: >-
            `400 invalid_url`: `url` is not an HTTPS URL, or the application
            already has an endpoint at that URL. `400 invalid_events`: `events`
            names an event Didit does not know.
        '401':
          description: The supplied API key is wrong, revoked or expired.
        '403':
          description: >-
            The `x-api-key` header is missing, the key is scoped and does not
            carry write access to `webhooks`, or the request came from outside
            the key's allowed IP addresses.
        '429':
          $ref: '#/components/responses/RateLimitedWrite'
      security:
        - ApiKeyAuth: []
      x-codeSamples:
        - lang: curl
          label: curl
          source: |-
            curl -X POST 'https://verification.didit.me/v3/webhooks/' \
              -H 'x-api-key: YOUR_API_KEY' \
              -H 'Content-Type: application/json' \
              -d '{
                  "url": "https://api.demo-app.example/didit/webhooks",
                  "events": [
                    "status.updated",
                    "message.status.updated"
                  ],
                  "description": "Phone events"
                }'
components:
  parameters:
    IdempotencyKey:
      name: Idempotency-Key
      in: header
      required: false
      description: >-
        Optional retry-safety key you choose for one operation, up to 255
        characters (a UUID works). A request repeated with the same key,
        endpoint, query and body is answered with the first response, same
        status and same body, and runs and bills nothing a second time. The same
        key with another endpoint, query or body returns `409`
        `idempotency_key_reused`, and while the first request is still running,
        `409` `idempotency_key_in_progress` with `Retry-After`. A failed request
        (any `4xx` or `5xx`) is not stored, so you can send it again with the
        same key. Keys belong to your application, whether you call with an API
        key or an access token. See [Retries and
        idempotency](/integration/api-errors#retries-and-idempotency).
      schema:
        type: string
        minLength: 1
        maxLength: 255
  schemas:
    WebhookCreateRequest:
      type: object
      required:
        - url
        - events
      properties:
        url:
          type: string
          format: uri
          maxLength: 2000
          description: >-
            HTTPS endpoint that receives `POST` requests, one per event. Must be
            unique among the application's destinations. Use a stable, hardened
            endpoint: Didit retries failed deliveries on a backoff schedule.
        events:
          type: array
          minItems: 1
          uniqueItems: true
          items:
            anyOf:
              - $ref: '#/components/schemas/WebhookEvent'
              - type: string
                enum:
                  - '*'
          description: >-
            Event types to deliver, or `["*"]` for every event Didit lists. `*`
            is expanded when the endpoint is created, and the answer lists every
            event it covers. A value Didit does not know answers `400
            invalid_events`.
        description:
          type: string
          maxLength: 255
          description: >-
            Its name in the console, so you can tell endpoints apart. Left out,
            it takes the host of `url`.
    WebhookCreateResponse:
      type: object
      required:
        - webhook_id
        - secret
        - events
      properties:
        webhook_id:
          type: string
          format: uuid
          description: >-
            The endpoint's id. It is the destination's `destination_uuid`: `GET
            /v3/webhook/destinations/{destination_uuid}/` reads the endpoint
            back, and `PATCH` and `DELETE` on that path change it.
        secret:
          type: string
          description: >-
            Use this HMAC signing secret to verify `X-Signature-V2` on
            deliveries. Authorized callers can retrieve it as
            `secret_shared_key` with `GET
            /v3/webhook/destinations/{destination_uuid}/`.
        events:
          type: array
          items:
            $ref: '#/components/schemas/WebhookEvent'
          description: >-
            The events the endpoint now receives, with `*` already expanded to
            every event it covered when the endpoint was created.
    WebhookEvent:
      type: string
      description: >-
        Supported webhook event name. Use these exact strings in
        `subscribed_events`; unsupported values are rejected.
      enum:
        - status.updated
        - data.updated
        - user.status.updated
        - user.data.updated
        - business.status.updated
        - business.data.updated
        - activity.created
        - transaction.created
        - transaction.status.updated
        - travel_rule.status.updated
        - workflow.compliance_changed
        - transaction_rule_suggestions.created
        - auth.signup
        - auth.login
        - auth.login_failed
        - auth.password_reset_requested
        - auth.password_reset_completed
        - auth.mfa_changed
        - auth.new_device
        - auth.account_locked
        - investigator.report.ready
        - investigator.decision.automated
        - investigator.decision.overridden
        - investigator.decision.contested
        - investigator.question.raised
        - investigator.automation.paused
        - investigator.rfi.answered
        - investigator.rfi.overdue
        - investigator.drift.detected
        - investigator.sla.breached
        - investigator.qa.failed
        - investigator.external.report.ready
        - bank.link.completed
        - bank.link.cancelled
        - bank.link.expired
        - bank.link.failed
        - bank.connection.created
        - bank.connection.updated
        - bank.connection.consent_expiring
        - bank.connection.renewal_required
        - bank.connection.renewed
        - bank.connection.revoked
        - bank.connection.deleted
        - bank.connection.history_complete
        - bank.data.updated
        - bank.sync.completed
        - bank.sync.failed
        - bank.sync.recovered
        - message.status.updated
        - message.received
        - contact.consent.updated
    RateLimitBudgetError:
      type: object
      description: >-
        Returned only for a rate-limit middleware budget refusal. Other 429
        errors, including idempotency conflicts and endpoint-specific caps, do
        not promise these metadata fields.
      required:
        - detail
        - reference
        - limit
        - remaining
        - reset
        - window_seconds
      properties:
        detail:
          type: string
          description: Existing human-readable budget refusal message.
        reference:
          type: string
          pattern: ^RL-[0-9a-f]{32}$
          description: >-
            Opaque support reference: RL- followed by 32 lowercase UUID
            hexadecimal characters.
        limit:
          type: integer
          description: Budget for the exceeded scope; equals X-RateLimit-Limit.
        remaining:
          type: integer
          minimum: 0
          description: Remaining budget, clamped to zero; equals X-RateLimit-Remaining.
        reset:
          type: integer
          format: int64
          description: Window reset time in Unix seconds; equals X-RateLimit-Reset.
        window_seconds:
          type: integer
          description: >-
            Fixed-window duration in seconds, not the remaining wait. Honor
            Retry-After before retrying.
      example:
        detail: >-
          Write request rate limit exceeded. You can make up to 300 requests per
          minute.
        reference: RL-00000000000040008000000000000001
        limit: 300
        remaining: 0
        reset: 1794358860
        window_seconds: 60
  responses:
    RateLimitedWrite:
      description: >-
        The shared write limit of 300 requests per minute per API key was
        exceeded. Honor `Retry-After` before retrying.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/RateLimitBudgetError'
          example:
            detail: >-
              Write request rate limit exceeded. You can make up to 300 requests
              per minute.
            reference: RL-00000000000040008000000000000001
            limit: 300
            remaining: 0
            reset: 1794358860
            window_seconds: 60
      headers:
        Retry-After:
          $ref: '#/components/headers/BudgetRetryAfter'
        X-RateLimit-Scope:
          $ref: '#/components/headers/BudgetXRateLimitScope'
        X-RateLimit-Limit:
          $ref: '#/components/headers/BudgetXRateLimitLimit'
        X-RateLimit-Remaining:
          $ref: '#/components/headers/BudgetXRateLimitRemaining'
        X-RateLimit-Reset:
          $ref: '#/components/headers/BudgetXRateLimitReset'
  headers:
    BudgetRetryAfter:
      description: >-
        Seconds to wait, rounded up to the next window. Present on middleware
        budget refusals.
      schema:
        type: integer
    BudgetXRateLimitScope:
      description: >-
        The scope whose budget was exceeded. Present on middleware budget
        refusals.
      schema:
        type: string
    BudgetXRateLimitLimit:
      description: >-
        Budget for the exceeded scope; equals body limit. Present on middleware
        budget refusals.
      schema:
        type: integer
    BudgetXRateLimitRemaining:
      description: >-
        Remaining budget, clamped to zero; equals body remaining. Present on
        middleware budget refusals.
      schema:
        type: integer
    BudgetXRateLimitReset:
      description: >-
        Reset time in Unix seconds; equals body reset. Present on middleware
        budget refusals.
      schema:
        type: integer
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: x-api-key
      description: >-
        Your application's API key, from Developers -> API keys in the Business
        Console. The primary key has full access. A named key can be scoped:
        none, read or write per resource, limited to some workflows or to
        approved sessions, to a list of IP addresses, and to an expiry date. 401
        means the key is wrong, revoked or expired; 403 means no key was sent,
        the key has no access to this resource or action, or the request came
        from an address outside its IP list; 404 on a session route means the
        session is outside the key's workflows or statuses. A key without media
        access receives image, video and PDF URLs as null, and a key without
        sessions write receives session links and tokens as null. See
        https://docs.didit.me/console/api-keys.

````

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