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

# Create webhook

> Creates a webhook endpoint for the organization.



## OpenAPI

````yaml /openapi.yaml post /v1/webhooks
openapi: 3.0.3
info:
  title: Quentli REST API
  version: 1.0.0
  description: OpenAPI spec for Quentli REST endpoints.
servers:
  - url: https://api.quentli.com
    description: Production API
  - url: https://api.staging.quentli.com
    description: Staging API for production-like validation
  - url: https://api.demo.quentli.com
    description: Demo API hostname served by staging
security:
  - organizationApiKey: []
tags:
  - name: Auth
  - name: Billing
  - name: Catalog
  - name: Customers
  - name: Invoices
  - name: Payment Methods
  - name: Payment Sessions
  - name: Payments
  - name: Subscriptions
  - name: Tax Invoices
  - name: Webhooks
paths:
  /v1/webhooks:
    post:
      tags:
        - Webhooks
      summary: Create webhook
      description: Creates a webhook endpoint for the organization.
      operationId: webhooks_create
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateWebhookArgs'
      responses:
        '200':
          description: Webhook created
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Webhook'
        '400':
          description: Invalid request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UserError'
        '401':
          description: Authentication required
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UserError'
        '403':
          description: Permission denied
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UserError'
components:
  schemas:
    CreateWebhookArgs:
      type: object
      properties:
        input:
          type: object
          properties:
            url:
              type: string
              format: uri
              description: Destination URL that will receive webhook calls.
            description:
              type: string
              description: Optional user-defined description.
            secret:
              type: string
              description: Secret used to sign webhook calls.
            enabledEvents:
              type: array
              items:
                type: string
                enum:
                  - INVOICE_CREATED
                  - INVOICE_CANCELED
                  - INVOICE_PAID
                  - INVOICE_PAID_OTHER
                  - INVOICE_UPDATED
                  - PAYMENT_CREATED
                  - PAYMENT_COMPLETED
                  - PAYMENT_REFUNDED
                  - PAYMENT_REMINDER_SENT
                  - PAYMENT_ATTEMPT_FAILED
                  - PAYMENT_ATTEMPT_SUCCEEDED
                  - CUSTOMER_CREATED
                  - CUSTOMER_UPDATED
                  - CUSTOMER_ARCHIVED
                  - SUBSCRIPTION_CREATED
                  - SUBSCRIPTION_UPDATED
                  - SUBSCRIPTION_CANCELED
                  - PAYMENT_METHOD_CREATED
              description: Event types to send to this webhook.
          required:
            - url
            - enabledEvents
          additionalProperties: false
      required:
        - input
      additionalProperties: false
      description: Request body for creating a webhook.
    Webhook:
      type: object
      properties:
        id:
          type: string
          description: Unique identifier of the webhook.
          example: w_1234567890abcdefghij
        createdAt:
          anyOf:
            - type: string
              description: Date string
            - type: string
              format: date-time
              description: Date object
          description: When the webhook was created.
        updatedAt:
          anyOf:
            - type: string
              description: Date string
            - type: string
              format: date-time
              description: Date object
          description: When the webhook was last updated.
        url:
          type: string
          description: Destination URL.
        description:
          type: string
          nullable: true
          description: Optional user-defined description.
          example: null
        status:
          type: string
          enum:
            - ENABLED
            - DISABLED
            - BROKEN
            - DELETED
          description: Current webhook status.
          example: ENABLED
        organizationId:
          type: string
          description: Owning organization identifier.
          example: org_1234567890abcdefghij
        enabledEvents:
          type: array
          items:
            $ref: '#/components/schemas/WebhookEnabledEvent'
          description: Event types currently enabled for this webhook.
        deletedAt:
          anyOf:
            - type: string
              description: Date string
            - type: string
              format: date-time
              description: Date object
            - nullable: true
          description: When this webhook was deleted, if any.
          example: null
        deletedById:
          type: string
          nullable: true
          description: User who deleted this webhook.
          example: null
      required:
        - id
        - createdAt
        - updatedAt
        - url
        - status
        - organizationId
      description: Webhook endpoint configured by the organization.
    UserError:
      type: object
      properties:
        error:
          type: object
          properties:
            message:
              type: string
          required:
            - message
      required:
        - error
      additionalProperties: false
      description: Standard user-facing error response envelope.
    WebhookEnabledEvent:
      type: object
      properties:
        id:
          type: string
          description: Unique identifier of the enabled event row.
        createdAt:
          anyOf:
            - type: string
              description: Date string
            - type: string
              format: date-time
              description: Date object
          description: When this enabled event was created.
        updatedAt:
          anyOf:
            - type: string
              description: Date string
            - type: string
              format: date-time
              description: Date object
          description: When this enabled event was last updated.
        webhookId:
          type: string
          description: Webhook identifier.
          example: w_1234567890abcdefghij
        type:
          type: string
          enum:
            - INVOICE_CREATED
            - INVOICE_CANCELED
            - INVOICE_PAID
            - INVOICE_PAID_OTHER
            - INVOICE_UPDATED
            - PAYMENT_CREATED
            - PAYMENT_COMPLETED
            - PAYMENT_REFUNDED
            - PAYMENT_REMINDER_SENT
            - PAYMENT_ATTEMPT_FAILED
            - PAYMENT_ATTEMPT_SUCCEEDED
            - CUSTOMER_CREATED
            - CUSTOMER_UPDATED
            - CUSTOMER_ARCHIVED
            - SUBSCRIPTION_CREATED
            - SUBSCRIPTION_UPDATED
            - SUBSCRIPTION_CANCELED
            - PAYMENT_METHOD_CREATED
          description: Enabled webhook event type.
      required:
        - id
        - createdAt
        - updatedAt
        - webhookId
        - type
      description: Event type enabled for a webhook endpoint.
  securitySchemes:
    organizationApiKey:
      type: http
      scheme: bearer
      description: 'Organization API key using `Authorization: Bearer sk_...`.'

````