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

# Create Webhook Endpoint

> Create a new webhook for a developer app.

The developer app must belong to the authenticated user (via X-API-Key).
Each app can have one webhook per service type.

**Supported service types**: sms, voice, otp, whatsapp

**Authentication**: X-API-Key header required



## OpenAPI

````yaml /openapi.json post /v1/webhooks/
openapi: 3.1.0
info:
  title: Briq API
  description: Karibu Briq API Documentation
  version: '0.8'
servers:
  - url: https://karibu.briq.tz
    description: Production
  - url: https://pre-release.karibu.briq.tz
    description: Pre-release
  - url: http://karibu.briq.tz
    description: LocalPass
security: []
paths:
  /v1/webhooks/:
    post:
      tags:
        - Karibu-Webhooks
      summary: Create Webhook Endpoint
      description: |-
        Create a new webhook for a developer app.

        The developer app must belong to the authenticated user (via X-API-Key).
        Each app can have one webhook per service type.

        **Supported service types**: sms, voice, otp, whatsapp

        **Authentication**: X-API-Key header required
      operationId: create_webhook_endpoint_v1_webhooks__post
      parameters:
        - name: X-API-Key
          in: header
          required: true
          schema:
            type: string
            title: X-Api-Key
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/WebhookCreate'
      responses:
        '201':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/WebhookOut'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
components:
  schemas:
    WebhookCreate:
      properties:
        app_id:
          type: string
          format: uuid
          title: App Id
          description: The ID of the developer app this webhook belongs to
          examples:
            - 550e8400-e29b-41d4-a716-446655440000
        service_type:
          type: string
          pattern: ^(sms|voice|otp|whatsapp|email)$
          title: Service Type
          description: >-
            Type of service for this webhook (e.g., 'sms', 'voice', 'otp',
            'whatsapp')
          examples:
            - sms
        url:
          type: string
          maxLength: 2083
          minLength: 1
          format: uri
          title: Url
          description: The URL where webhook events will be sent
          examples:
            - https://example.com/webhook
        secret_token:
          anyOf:
            - type: string
              maxLength: 255
              minLength: 16
            - type: 'null'
          title: Secret Token
          description: Secret token for signing outgoing webhook requests
          examples:
            - my_secret_token_123
      type: object
      required:
        - app_id
        - service_type
        - url
      title: WebhookCreate
      description: Schema for creating a new webhook.
    WebhookOut:
      properties:
        webhook_id:
          type: string
          title: Webhook Id
          description: Unique identifier for the webhook
        app_id:
          type: string
          title: App Id
          description: The ID of the developer app
        service_type:
          type: string
          title: Service Type
          description: Type of service
        url:
          type: string
          title: Url
          description: The webhook URL
        secret_token:
          anyOf:
            - type: string
            - type: 'null'
          title: Secret Token
          description: Secret token (masked for security)
        created_at:
          type: string
          format: date-time
          title: Created At
          description: When the webhook was created
        updated_at:
          type: string
          format: date-time
          title: Updated At
          description: When the webhook was last updated
      type: object
      required:
        - webhook_id
        - app_id
        - service_type
        - url
        - created_at
        - updated_at
      title: WebhookOut
      description: Schema for webhook response.
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError

````