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

# Create Webhook



## OpenAPI

````yaml post /v1/webhooks
openapi: 3.0.0
info:
  version: 1.0.0
  title: Sohar API
  license:
    name: MIT
servers:
  - url: https://api.soharhealth.com
security: []
paths:
  /v1/webhooks:
    post:
      tags:
        - Webhooks
      summary: Create Webhook
      operationId: createWebhook
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/WebhookRequest'
            example:
              url: https://www.google.com
      responses:
        '201':
          description: A webhook config
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/WebhookCreatedResponse'
        '400':
          description: Invalid request
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                    enum:
                      - invalid_request_error
                    default: invalid_request_error
                  param:
                    type: string
                    example: url
        '403':
          description: Unauthorized
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                    enum:
                      - invalid_request_error
                    default: invalid_request_error
        '500':
          description: Internal error
      security:
        - BasicAuth: []
components:
  schemas:
    WebhookRequest:
      required:
        - url
      type: object
      properties:
        url:
          type: string
          description: The URL to which webhook would send requests
          format: string
          example: https://www.google.com
    WebhookCreatedResponse:
      required:
        - url
        - endpointId
        - events
      type: object
      properties:
        url:
          type: string
          description: The URL to which webhook would send requests
          format: string
          example: https://www.google.com
        endpointId:
          type: string
          description: Internal ID of endpoint
          format: string
          example: ep_2pqPuj665SJeVw8DkU3pkZq1njL
        events:
          type: array
          items:
            type: string
          example: []
  securitySchemes:
    BasicAuth:
      type: http
      scheme: bearer

````