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

# Create webhook

> This API creates a webhook.

> [!NOTE]
>
> Replace `{your-subdomain}` with your workspace's subdomain. \
> Learn how to find your subdomain in [Workspace subdomain](https://apidocs.neetokb.com/api/workspace-subdomain.md).


## OpenAPI

````yaml bundled/webhooks.yaml POST /webhooks
openapi: 3.0.3
info:
  title: NeetoKB Webhooks API
  description: >-
    APIs to manage the webhooks of a workspace. For CLI sessions, every webhook
    endpoint, reads included, needs the Manage webhooks permission.
  version: 1.0.0
servers:
  - description: NeetoKB API
    url: https://{your-subdomain}.neetokb.com/api/external/v2
    variables:
      your-subdomain:
        default: spinkart
        description: >-
          Replace **spinkart** with your [workspace's
          subdomain](/api/workspace-subdomain).
security: []
paths:
  /webhooks:
    post:
      tags:
        - Webhooks
      summary: Create webhook
      description: This API creates a webhook.
      parameters:
        - $ref: '#/components/parameters/api_key_header'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/create_webhook_request'
      responses:
        '201':
          description: Created - Webhook created
          content:
            application/json:
              schema:
                type: object
                properties:
                  webhook:
                    $ref: '#/components/schemas/webhook'
        '401':
          $ref: '#/components/responses/unauthorized_response'
        '403':
          $ref: '#/components/responses/forbidden_response'
        '422':
          description: >-
            Unprocessable Entity - The endpoint is missing or already used, or
            an event is unknown
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                    example: 'Unknown event identifiers: x.'
components:
  parameters:
    api_key_header:
      in: header
      name: X-Api-Key
      description: >-
        Use the X-Api-Key header to provide your workspace API key. Refer to
        [Authentication](/api/authentication) for more information.
      required: true
      schema:
        type: string
        default: your-api-key
  schemas:
    create_webhook_request:
      type: object
      required:
        - webhook
      properties:
        webhook:
          type: object
          required:
            - endpoint
          properties:
            endpoint:
              type: string
              description: Address that receives the events. Unique in the workspace.
              example: https://example.com/hook
            secret:
              type: string
              description: Used to sign the payloads. It is never returned by the API.
            is_active:
              type: boolean
              description: Defaults to true.
            events:
              type: array
              items:
                $ref: '#/components/schemas/webhook_event'
              description: >-
                Events that trigger the webhook. See [List webhook
                events](/api/webhooks/events).
    webhook:
      type: object
      properties:
        id:
          type: string
          format: uuid
        sid:
          type: string
          example: abc
        endpoint:
          type: string
          example: https://example.com/hook
        is_active:
          type: boolean
        version:
          type: string
          example: v1
        version_expired:
          type: boolean
        version_deprecated:
          type: boolean
        events:
          type: array
          items:
            $ref: '#/components/schemas/webhook_event'
    webhook_event:
      type: string
      enum:
        - create
        - update
        - delete
        - publish
        - unpublish
  responses:
    unauthorized_response:
      description: Unauthorized - API key is missing or invalid
    forbidden_response:
      description: >-
        Forbidden - The CLI session does not have the permission this change
        needs

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.