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

# Create a form webhook

> Create a webhook for a form. It fires on all events unless you give `events`.

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


## OpenAPI

````yaml bundled/webhooks.yaml POST /forms/{form_id}/webhooks
openapi: 3.0.3
info:
  title: NeetoForm Webhooks APIs
  version: 2.0.0
servers:
  - description: NeetoForm APIs
    url: https://{your-subdomain}.neetoform.com/api/external/v2
    variables:
      your-subdomain:
        default: spinkart
        description: >-
          Replace **spinkart** with your [workspace's
          subdomain](/api/workspace-subdomain).
security: []
tags:
  - name: Webhooks
    description: APIs to manage webhooks for a form and for the whole workspace.
paths:
  /forms/{form_id}/webhooks:
    post:
      tags:
        - Webhooks
      summary: Create a form webhook
      description: >-
        Create a webhook for a form. It fires on all events unless you give
        `events`.
      parameters:
        - $ref: '#/components/parameters/api_key_header'
        - $ref: '#/components/parameters/form_id_param'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/webhook_create_request'
      responses:
        '201':
          description: Created - Webhook created successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/webhook_response'
        '400':
          description: Bad Request - The `webhook` parameter is missing
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/error_response'
              example:
                error: 'param is missing or the value is empty: webhook'
        '404':
          description: Not Found - Form does not exist
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/error_response'
              example:
                error: Form does not exist.
        '422':
          description: >-
            Unprocessable Entity - The webhook is invalid, for example the
            endpoint is blank, already used, or an event is unknown
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/error_response'
              example:
                error: Endpoint can't be blank
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
    form_id_param:
      in: path
      name: form_id
      description: >-
        Unique ID of the form. Refer to [Getting the Form
        ID](/api/getting-form-id) for detailed instructions.
      required: true
      schema:
        type: string
  schemas:
    webhook_create_request:
      type: object
      properties:
        webhook:
          type: object
          properties:
            endpoint:
              type: string
              description: URL that receives the webhook calls.
              example: https://example.com/hook
            events:
              type: array
              items:
                type: string
              description: >-
                Events that trigger the webhook. When omitted, the webhook fires
                on all events. The only event is `submit`.
              example:
                - submit
            secret:
              type: string
              description: >-
                Secret used to sign the webhook calls. It is saved but never
                returned in responses.
          required:
            - endpoint
      required:
        - webhook
    webhook_response:
      type: object
      properties:
        webhook:
          $ref: '#/components/schemas/webhook'
    error_response:
      type: object
      properties:
        error:
          type: string
    webhook:
      type: object
      properties:
        id:
          type: string
          example: 7c1e9b2a-4f3d-4a8e-9b61-2d0f5e8c3a17
        endpoint:
          type: string
          example: https://example.com/hook
        is_active:
          type: boolean
          example: true
        version:
          type: string
          description: Payload version of the webhook.
          example: v2
        version_expired:
          type: boolean
          description: Whether the payload version is no longer supported.
          example: false
        entity_type:
          type: string
          description: '`Form` for a form webhook, `Organization` for a workspace webhook.'
          example: Form
        events:
          type: array
          items:
            type: string
          example:
            - submit
        form_id:
          type: string
          nullable: true
          description: ID of the form for a form webhook. `null` for a workspace webhook.
          example: 0b6f2d4e-91a3-4c57-8e2f-6a9d1c3b5e70
        created_at:
          $ref: '#/components/schemas/date_time_field'
    date_time_field:
      type: string
      format: date-time

````

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