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

# Create Webhook

### Body Parameters

<ParamField body="appId" type="string">
  The ID of the app to create the webhook for.<br />
  Required for webhooks in an app. Not required for global webhooks.
</ParamField>

<ParamField body="projectId" type="string">
  The ID of the app to create the webhook for.<br />
  Required for global webhooks.
</ParamField>

<ParamField body="url" type="string" required>
  The URL where webhook events will be sent
</ParamField>

<ParamField body="customHeaders" type="array">
  Array of custom headers to be sent with the webhook

  <Expandable title="Custom Header Object">
    <ParamField body="key" type="string" required>
      Header key
    </ParamField>

    <ParamField body="value" type="string" required>
      Header value
    </ParamField>
  </Expandable>
</ParamField>

<ParamField body="authMethod" type="string">
  Authentication method for the webhook. Must be one of: "basic", "hmac", or "apiKey"
</ParamField>

<ParamField body="userName" type="string">
  Username for basic authentication (required if authMethod is "basic")
</ParamField>

<ParamField body="password" type="string">
  Password for basic authentication (required if authMethod is "basic")
</ParamField>

<ParamField body="apiKey" type="string">
  API key for apiKey authentication (required if authMethod is "apiKey")
</ParamField>

<ParamField body="apiKeyHeader" type="string">
  Header name for the API key (required if authMethod is "apiKey")
</ParamField>

<ParamField body="hmacHeader" type="string">
  Header name for the HMAC signature (required if authMethod is "hmac")
</ParamField>

<ParamField body="hmacSecret" type="string">
  Secret for HMAC signature generation (required if authMethod is "hmac")
</ParamField>

### Response

<ResponseField name="success" type="boolean">
  Indicates if the request was successful
</ResponseField>

<ResponseField name="message" type="string">
  A message describing the result of the operation
</ResponseField>

<ResponseField name="data" type="object">
  The created webhook object

  <Expandable title="Properties">
    <ResponseField name="id" type="string">
      Unique identifier for the webhook
    </ResponseField>

    <ResponseField name="name" type="string">
      Name of the webhook
    </ResponseField>

    <ResponseField name="url" type="string">
      URL where webhook events will be sent
    </ResponseField>

    <ResponseField name="customHeaders" type="array">
      Array of custom headers

      <Expandable title="Header Object">
        <ResponseField name="key" type="string">
          Header key
        </ResponseField>

        <ResponseField name="value" type="string">
          Header value
        </ResponseField>
      </Expandable>
    </ResponseField>

    <ResponseField name="headers" type="array">
      Array of default headers

      <Expandable title="Header Object">
        <ResponseField name="key" type="string">
          Header key
        </ResponseField>

        <ResponseField name="value" type="string">
          Header value
        </ResponseField>
      </Expandable>
    </ResponseField>

    <ResponseField name="authMethod" type="object">
      Authentication method configuration

      <Expandable title="Properties">
        <ResponseField name="method" type="string">
          Authentication method type (hmac, api\_key, or basic)
        </ResponseField>

        <ResponseField name="hmacHeader" type="string">
          Custom header name for HMAC signature (if method is hmac)
        </ResponseField>

        <ResponseField name="hmacSecret" type="string">
          Secret used for HMAC signature generation (if method is hmac)
        </ResponseField>

        <ResponseField name="apiKey" type="string">
          API key value (if method is api\_key)
        </ResponseField>

        <ResponseField name="apiKeyHeader" type="string">
          Custom header name for API key (if method is api\_key)
        </ResponseField>

        <ResponseField name="userName" type="string">
          Username for basic authentication (if method is basic)
        </ResponseField>

        <ResponseField name="password" type="string">
          Password for basic authentication (if method is basic)
        </ResponseField>
      </Expandable>
    </ResponseField>

    <ResponseField name="createdAt" type="string">
      Timestamp when the webhook was created
    </ResponseField>

    <ResponseField name="updatedAt" type="string">
      Timestamp when the webhook was last updated
    </ResponseField>
  </Expandable>
</ResponseField>

### Response Example

```json theme={null}
{
  "success": true,
  "message": "Webhook created successfully",
  "data": {
    "id": "wh_01JT39DVQGKA1RV4QNJ1VFRNW2",
    "name": "heelo",
    "url": "https://exp.com",
    "secret": "01JT39DVQJW3A49TR3XXFVM939",
    "customHeaders": [
      {
        "key": "x-app",
        "value": "x-value"
      }
    ],
    "headers": [
      {
        "key": "Content-Type",
        "value": "application/json"
      }
    ],
    "authMethod": {
      "hmacHeader": "x-Vartiq-signature",
      "hmacSecret": "uPvKnaxMwD1gHs1uFNJh-UEn3D5ha5WZcS3WTMVUExY",
      "method": "hmac"
    },
    "createdAt": "2025-04-30T12:06:00.703Z",
    "updatedAt": "2025-04-30T12:06:00.703Z"
  }
}
```
