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

# Delete webhook endpoint

> Permanently deletes the endpoint and its delivery records.

> [!NOTE]
>
> API v2 is in beta. Endpoints return the `X-Lago-Endpoint-Status: beta` header.


## OpenAPI

````yaml https://swagger.getlago.com/openapi-v2.yaml DELETE /webhook_endpoints/{lago_id}
openapi: 3.1.0
info:
  title: Lago API v2 documentation
  description: >-
    Lago API v2. Documents native v2 endpoints for the product catalog, billing,
    customers, organizations, billing entities, billable metrics, events,
    features, privileges, entitlements, wallets, alerts, logs and webhook
    endpoints. Paginated lists use cursor pagination. Some lists, such as rates
    and phases, return the complete list without pagination. Native v2 endpoints
    use opt-in relationship expansions and structured error responses. Only the
    documented actions and expansions are supported. Some other /api/v2 paths
    still fall back to v1 controllers and are not described here.
  version: 2.0.0-beta
  license:
    name: AGPLv3
    url: https://github.com/getlago/lago-openapi/blob/main/LICENSE
  contact:
    email: tech@getlago.com
servers:
  - url: https://api.getlago.com/api/v2
    description: US Lago cluster
  - url: https://api.eu.getlago.com/api/v2
    description: EU Lago cluster
security:
  - bearerAuth: []
tags:
  - name: taxes
    description: Tax rates
  - name: product_categories
    description: product categories operations
  - name: products
    description: products operations
  - name: product_filters
    description: product filters operations
  - name: rate_cards
    description: rate cards operations
  - name: rate_card_rates
    description: rate card rates operations
  - name: catalog_plans
    description: catalog plans operations
  - name: plan_applied_rate_cards
    description: plan applied rate cards operations
  - name: plan_rate_phases
    description: plan rate phases operations
  - name: contract_applied_rate_cards
    description: contract applied rate cards operations
  - name: contract_rate_phases
    description: contract rate phases operations
  - name: contracts
    description: contracts operations
  - name: invoices
    description: invoices operations
  - name: fees
    description: fees operations
  - name: payments
    description: payments operations
  - name: payment_requests
    description: payment requests operations
  - name: payment_receipts
    description: payment receipts operations
  - name: credit_notes
    description: credit notes operations
  - name: customers
    description: customers operations
  - name: organizations
    description: Organization operations
  - name: billing_entities
    description: billing entities operations
  - name: billable_metrics
    description: billable metrics operations
  - name: events
    description: Event operations
  - name: activity_logs
    description: activity logs operations
  - name: api_logs
    description: api logs operations
  - name: security_logs
    description: security logs operations
  - name: webhook_endpoints
    description: webhook endpoints operations
  - name: features
    description: features operations
  - name: feature_privileges
    description: feature privileges operations
  - name: plan_wallets
    description: plan wallets operations
  - name: contract_wallets
    description: contract wallets operations
  - name: contract_wallet_transactions
    description: contract wallet transactions operations
  - name: plan_wallet_alerts
    description: plan wallet alerts operations
  - name: contract_wallet_alerts
    description: contract wallet alerts operations
  - name: contract_alerts
    description: contract alerts operations
  - name: plan_entitlements
    description: plan entitlements operations
  - name: contract_entitlements
    description: contract entitlements operations
externalDocs:
  description: Lago documentation
  url: https://getlago.com/docs
paths:
  /webhook_endpoints/{lago_id}:
    parameters:
      - name: lago_id
        in: path
        required: true
        description: Unique identifier created by Lago.
        schema:
          type: string
          description: Unique identifier created by Lago.
          example: 1a901a90-1a90-1a90-1a90-1a901a901a90
          format: uuid
    delete:
      tags:
        - webhook_endpoints
      summary: Delete webhook endpoint
      description: >-
        Permanently deletes the endpoint and its delivery records. Returns the
        deleted endpoint configuration without a deleted_at field. Expansions
        are not supported; a nonempty expands[] returns 400
        expand_not_supported.

        Requires the product catalog to be enabled and webhook_endpoint write
        permission on the API key.
      operationId: destroyWebhookEndpoint
      responses:
        '200':
          description: Successful response
          headers:
            X-Lago-Endpoint-Status:
              $ref: '#/components/headers/EndpointStatus'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/WebhookEndpoint'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '422':
          $ref: '#/components/responses/UnprocessableEntity'
components:
  headers:
    EndpointStatus:
      description: Indicates that the endpoint is in beta.
      schema:
        type: string
        enum:
          - beta
        example: beta
  schemas:
    WebhookEndpoint:
      type: object
      description: webhook endpoint response.
      required:
        - webhook_endpoint
      properties:
        webhook_endpoint:
          $ref: '#/components/schemas/WebhookEndpointObject'
    WebhookEndpointObject:
      type: object
      description: Webhook Endpoint.
      required:
        - lago_id
        - name
        - webhook_url
        - signature_algo
        - event_types
        - created_at
        - updated_at
      properties:
        lago_id:
          type: string
          description: Unique identifier created by Lago.
          example: 1a901a90-1a90-1a90-1a90-1a901a901a90
          format: uuid
        name:
          type:
            - string
            - 'null'
          description: Name.
          example: example
        webhook_url:
          type: string
          description: Public URL receiving webhook requests.
          example: https://hooks.acme.example/lago
          format: uri
        signature_algo:
          type: string
          description: Webhook signature algorithm.
          example: standard_webhooks
          enum:
            - jwt
            - hmac
            - standard_webhooks
        event_types:
          type:
            - array
            - 'null'
          items:
            $ref: '#/components/schemas/WebhookEventTypeEnum'
          description: >-
            Event types delivered to this endpoint. Null means all events; an
            empty array selects none.
        created_at:
          type: string
          format: date-time
          description: UTC creation timestamp, with microsecond precision.
          example: '2022-04-29T08:59:51.123456Z'
        updated_at:
          type: string
          description: UTC timestamp of the last update, with microsecond precision.
          example: '2022-04-29T08:59:51.123456Z'
          format: date-time
        signing_keys:
          type: array
          description: >-
            Signing keys of the endpoint, oldest first, used to verify the
            webhook-signature header of `standard_webhooks` deliveries. Included
            only with expands[]=signing_keys.
          items:
            $ref: '#/components/schemas/WebhookEndpointSigningKeyObject'
    ApiError:
      type: object
      required:
        - code
        - details
      properties:
        code:
          type: string
          pattern: ^[a-z][a-z0-9_]*$
          description: >-
            Code identifying the failure. The HTTP status is carried by the
            response, not the body.
          example: validation_errors
        details:
          type: array
          description: >-
            Details of the failure. The array is empty when no field details are
            available.
          items:
            type: object
            required:
              - code
              - field
              - meta
            properties:
              code:
                type: string
                pattern: ^[a-z][a-z0-9_]*$
                description: >-
                  Code identifying the field error or the reason a request
                  parameter was rejected.
                example: value_is_mandatory
              field:
                type: string
                description: >-
                  Request field or parameter. Nested fields use dots and
                  zero-based array indexes. A resource-level failure uses base.
                example: name
              meta:
                type: object
                description: >-
                  Information about the failure, such as the missing resource,
                  allowed values or bounds. The object is empty when no metadata
                  is available.
                additionalProperties: true
                example: {}
                properties:
                  min:
                    type: integer
                    description: Inclusive minimum value.
                    example: 0
                  max:
                    type: integer
                    description: Inclusive maximum value.
                    example: 100
                  min_length:
                    type: integer
                    description: Minimum string length, in characters.
                    example: 1
                  max_length:
                    type: integer
                    description: Maximum string length, in characters.
                    example: 255
                  max_items:
                    type: integer
                    description: Maximum number of items.
                    example: 100
                  allowed_values:
                    type: array
                    description: Values accepted for the field.
                    items:
                      type: string
                      description: Allowed value.
                      example: draft
                  invalid_values:
                    type: array
                    description: Values rejected by request validation.
                    items:
                      type: string
                      description: Rejected value.
                      example: unknown
                  value:
                    type: string
                    description: Query parameter value received.
                    example: unknown
                  resource:
                    type: string
                    description: Resource that could not be found.
                    example: customer
                  provider_name:
                    type: string
                    description: Name of the provider that failed.
                    example: stripe
                  provider_code:
                    type: string
                    description: Code of the provider connection.
                    example: stripe_eu
                  provider_error_code:
                    type: string
                    description: Error code returned by the provider.
                    example: resource_missing
    WebhookEventTypeEnum:
      type: string
      description: Webhook event type.
      example: add_on.created
      enum:
        - add_on.created
        - add_on.updated
        - add_on.deleted
        - alert.resolved
        - alert.triggered
        - billable_metric.created
        - billable_metric.updated
        - billable_metric.deleted
        - customer.created
        - customer.updated
        - customer.accounting_provider_created
        - customer.accounting_provider_error
        - customer.crm_provider_created
        - customer.crm_provider_error
        - customer.payment_provider_created
        - customer.payment_provider_error
        - customer.checkout_url_generated
        - customer.tax_provider_error
        - customer.vies_check
        - credit_note.created
        - credit_note.generated
        - credit_note.refund_failure
        - coupon.created
        - coupon.updated
        - coupon.deleted
        - coupon.terminated
        - dunning_campaign.finished
        - event.error
        - events.errors
        - feature.created
        - feature.updated
        - feature.deleted
        - fee.created
        - fee.tax_provider_error
        - invoice.created
        - invoice.one_off_created
        - invoice.paid_credit_added
        - invoice.generated
        - invoice.drafted
        - invoice.ready_to_finalize
        - invoice.voided
        - invoice.deleted
        - invoice.payment_dispute_lost
        - invoice.payment_status_updated
        - invoice.payment_overdue
        - invoice.payment_failure
        - invoice.resynced
        - integration.provider_error
        - order.created
        - order.executed
        - order_form.created
        - order_form.signed
        - order_form.expired
        - order_form.voided
        - payment.succeeded
        - payment.requires_action
        - payment_provider.error
        - payment_receipt.created
        - payment_receipt.generated
        - payment_request.created
        - payment_request.payment_failure
        - payment_request.payment_status_updated
        - plan.created
        - plan.updated
        - plan.deleted
        - product_category.created
        - product_category.updated
        - product_category.deleted
        - product.created
        - product.updated
        - product.deleted
        - product_filter.created
        - product_filter.updated
        - product_filter.deleted
        - rate_card.created
        - rate_card.updated
        - rate_card.deleted
        - rate_card_rate.created
        - rate_card_rate.updated
        - rate_card_rate.deleted
        - plan_rate_card.created
        - plan_rate_card.updated
        - plan_rate_card.deleted
        - contract_rate_card.created
        - contract_rate_card.updated
        - contract_rate_card.deleted
        - contract.created
        - contract.updated
        - contract.published
        - contract.started
        - contract.terminated
        - contract.canceled
        - quote.created
        - quote.approved
        - quote.voided
        - subscription.canceled
        - subscription.incomplete
        - subscription.terminated
        - subscription.started
        - subscription.updated
        - subscription.termination_alert
        - subscription.trial_ended
        - subscription.usage_threshold_reached
        - wallet.created
        - wallet.depleted_ongoing_balance
        - wallet.terminated
        - wallet.updated
        - wallet_transaction.created
        - wallet_transaction.updated
        - wallet_transaction.payment_failure
        - plan_entitlement.created
        - plan_entitlement.updated
        - plan_entitlement.deleted
        - contract_entitlement.created
        - contract_entitlement.updated
        - contract_entitlement.deleted
    WebhookEndpointSigningKeyObject:
      type: object
      description: Webhook endpoint signing key.
      required:
        - lago_id
        - secret_key
        - created_at
      properties:
        lago_id:
          type: string
          description: Unique identifier created by Lago.
          example: 1a901a90-1a90-1a90-1a90-1a901a901a90
          format: uuid
        secret_key:
          type: string
          pattern: ^whsec_
          description: >-
            Secret key to set up a Standard Webhooks library with, prefixed with
            `whsec_`.
          example: whsec_ZmFrZS1zZWNyZXQtZm9yLWRvY3VtZW50YXRpb24tb25seQ==
        created_at:
          type: string
          format: date-time
          description: UTC creation timestamp, with microsecond precision.
          example: '2022-04-29T08:59:51.123456Z'
  responses:
    BadRequest:
      description: Invalid request body, pagination or relationship expansion
      headers:
        X-Lago-Endpoint-Status:
          $ref: '#/components/headers/EndpointStatus'
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ApiError'
          example:
            code: invalid_expand
            details:
              - code: malformed
                field: expands
                meta:
                  allowed_values: []
    Unauthorized:
      description: Missing or invalid API key
      headers:
        X-Lago-Endpoint-Status:
          $ref: '#/components/headers/EndpointStatus'
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ApiError'
          example:
            code: unauthorized
            details: []
    Forbidden:
      description: Feature unavailable or insufficient API permissions
      headers:
        X-Lago-Endpoint-Status:
          $ref: '#/components/headers/EndpointStatus'
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ApiError'
          example:
            code: feature_unavailable
            details: []
    NotFound:
      description: Unknown resource or resource from another organization
      headers:
        X-Lago-Endpoint-Status:
          $ref: '#/components/headers/EndpointStatus'
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ApiError'
          example:
            code: resource_not_found
            details:
              - code: resource_not_found
                field: base
                meta:
                  resource: resource_name
    UnprocessableEntity:
      description: Invalid fields or filters
      headers:
        X-Lago-Endpoint-Status:
          $ref: '#/components/headers/EndpointStatus'
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ApiError'
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer

````

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