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

# Create a call webhook

> Registers a callback URL for the `on-call` or `post-call` event. Wavix sends a POST callback to the URL when the event occurs.



## OpenAPI

````yaml https://wavix.github.io/wavix-openapi/wavix-api.yaml post /v1/calls/webhooks
openapi: 3.1.0
info:
  title: Wavix APIs
  description: >-
    Wavix provides robust APIs that let you integrate voice and text messaging
    features directly into your app. Send text, place calls, and access detailed
    reports  programmatically.
  termsOfService: https://wavix.com/terms-and-conditions
  license:
    name: MIT
    identifier: MIT
  contact:
    name: Wavix
    url: https://wavix.com
    email: support@wavix.com
  version: '1.0'
servers:
  - url: https://api.wavix.com
    description: https://api.wavix.com
    variables: {}
security:
  - bearerAuth: []
tags:
  - name: SIP trunks
    description: SIP trunks
  - name: Buy
    description: Numbers
  - name: Cart
    description: Numbers
  - name: My numbers
    description: Numbers
  - name: Billing
    description: Billing, transactions, and invoices
  - name: Profile
    description: Account profile and customer information
  - name: CDRs
    description: Call detail records and call history
  - name: Speech Analytics
    description: Call transcription and speech analytics
  - name: SMS and MMS
    description: Messaging
  - name: Number Validator
    description: Phone number validation
  - name: Link shortener
    description: Short link and click metrics
  - name: 2FA
    description: Two-factor authentication
  - name: 10DLC
    description: 10DLC Campaigns and Brands
  - name: API Keys
    description: API key management
  - name: Call webhooks
    description: Webhook configuration for call events
  - name: Call control
    description: Programmable Voice
  - name: Call streaming
    description: Real-time call audio streaming over WebSocket
  - name: Call recording
    description: Call recording
  - name: Sub-accounts
    description: Sub-account management
  - name: Voice campaigns
    description: Outbound voice campaigns
  - name: Wavix Embeddable
    description: WebRTC embeddable widget
paths:
  /v1/calls/webhooks:
    post:
      tags:
        - Call webhooks
      summary: Create a call webhook
      description: >-
        Registers a callback URL for the `on-call` or `post-call` event. Wavix
        sends a POST callback to the URL when the event occurs.
      operationId: call_webhooks_create
      parameters: []
      requestBody:
        description: Attributes for the new call webhook.
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CallWebhooksCreateRequest'
        required: true
      responses:
        '201':
          description: Returns the created call webhook.
          headers: {}
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CallWebhook'
              examples:
                default:
                  value:
                    success: true
                    event_type: post-call
                    url: https://you-site.com/webhook
        '400':
          $ref: '#/components/responses/BadRequestErrorResponse'
        '401':
          $ref: '#/components/responses/UnauthorizedErrorResponse'
        '403':
          $ref: '#/components/responses/ForbiddenErrorResponse'
      deprecated: false
      security:
        - bearerAuth:
            - webhooks:write
components:
  schemas:
    CallWebhooksCreateRequest:
      type: object
      additionalProperties: false
      required:
        - url
        - event_type
      properties:
        url:
          type: string
          format: uri
          description: Webhook URL to send call events to.
          example: https://you-site.com/webhook
        event_type:
          type: string
          description: |-
            Allowed values: `on-call`, `post-call`.
             - `on-call`: Sends real-time status updates
              when a call starts, is answered, and ends.

             - `post-call`: Sends a callback after the call ends
              with disposition, duration, and cost.
          enum:
            - post-call
            - on-call
    CallWebhook:
      title: CallWebhook
      required:
        - success
        - event_type
        - url
      type: object
      additionalProperties: false
      properties:
        success:
          type: boolean
          description: Indicates whether the request was successful.
          example: true
        event_type:
          type: string
          description: >-
            Type of call event the webhook subscribes to. One of `post-call`
            (delivered once after the call ends) or `on-call` (delivered for
            in-call events while the call is active).
          enum:
            - post-call
            - on-call
          example: post-call
        url:
          type: string
          format: uri
          description: Webhook URL
          example: https://you-site.com/webhook
      description: A call webhook response
    ValidationErrorResponse:
      title: ValidationErrorResponse
      type: object
      properties:
        success:
          type: boolean
          description: >-
            Indicates whether the request was successful. Always `false` for
            this error.
          example: false
        message:
          type: string
          description: >-
            Human-readable description naming the missing or invalid request
            parameter.
          example: Missing or invalid parameter <param_name>
    UnauthorizedErrorResponse:
      title: UnauthorizedErrorResponse
      type: object
      properties:
        success:
          type: boolean
          description: >-
            Indicates whether the request was successful. Always `false` for
            this error.
          example: false
        error:
          type: boolean
          description: >-
            Indicates that the response represents an error. Always `true` for
            this error.
          example: true
        message:
          type: string
          description: >-
            Human-readable description stating that authentication is missing or
            invalid.
          example: Unauthorized
    ForbiddenErrorResponse:
      title: ForbiddenErrorResponse
      type: object
      properties:
        success:
          type: boolean
          description: >-
            Indicates whether the request was successful. Always `false` for
            this error.
          example: false
        message:
          type: string
          description: Human-readable description of why access is forbidden.
          example: The service is not provisioned for your account.
  responses:
    BadRequestErrorResponse:
      description: Request failed. Missing or invalid parameter <param_name>
      headers: {}
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ValidationErrorResponse'
    UnauthorizedErrorResponse:
      description: Unauthorized
      headers: {}
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/UnauthorizedErrorResponse'
    ForbiddenErrorResponse:
      description: Request failed. The feature is disabled for your account.
      headers: {}
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ForbiddenErrorResponse'
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: >
        Wavix API key. Pass as `Authorization: Bearer <api_key>`. Keys support
        per-resource scopes (none / read / write). See [Restricted keys and
        scopes](https://docs.wavix.com/api-reference/authentication#restricted-keys-and-scopes).

````