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

# Create a new webhook

> Creates a webhook endpoint for receiving events. Only OWNERS and ADMINS can create webhooks.



## OpenAPI

````yaml https://api.timbrix.mx/api/openapi.json post /organizations/{organizationId}/webhooks
openapi: 3.0.0
info:
  title: Timbrix API
  description: >-
    API de facturación electrónica CFDI 4.0 para México, con servidor OAuth2
    para gestionar organizaciones, miembros y webhooks. Compatible con agentes
    de IA — ver la extensión `x-ai-agent-friendly` en la raíz de esta spec.


    REST API with OAuth2 server for managing organizations, members, and
    webhooks.
  version: '1.0'
  contact: {}
servers: []
security: []
tags:
  - name: organizations
    description: Organization management endpoints
  - name: oauth
    description: OAuth2 authentication and authorization
  - name: webhooks
    description: Webhook configuration and delivery
  - name: users
    description: User information endpoints
  - name: api-keys
    description: API Keys management and validation
paths:
  /organizations/{organizationId}/webhooks:
    post:
      tags:
        - webhooks
      summary: Create a new webhook
      description: >-
        Creates a webhook endpoint for receiving events. Only OWNERS and ADMINS
        can create webhooks.
      operationId: WebhooksController_create
      parameters:
        - name: organizationId
          required: true
          in: path
          schema:
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateWebhookDto'
      responses:
        '201':
          description: >-
            Webhook created successfully. Returns webhook configuration with
            signing secret.
        '400':
          description: Invalid input data. Check URL format and event types.
        '401':
          description: Authentication required. Provide a valid bearer token.
        '403':
          description: Access denied. Only owners and admins can create webhooks.
      security:
        - bearer: []
components:
  schemas:
    CreateWebhookDto:
      type: object
      properties:
        url:
          type: string
          description: Webhook endpoint URL
          example: https://example.com/webhooks
        events:
          type: array
          description: Events to subscribe to
          example:
            - organization.created
            - organization.updated
          items:
            type: string
            enum:
              - organization.created
              - organization.updated
              - organization.deleted
              - member.added
              - member.removed
              - member.role_updated
              - invite.created
              - invite.accepted
              - invite.cancelled
              - oauth_app.created
              - oauth_app.revoked
              - webhook.created
      required:
        - url
        - events
  securitySchemes:
    bearer:
      scheme: bearer
      bearerFormat: JWT
      type: http

````