Skip to main content
POST
/
webhooks
Create Webhook
curl --request POST \
  --url https://api.us.vartiq.com/webhooks \
  --header 'Content-Type: application/json' \
  --header 'x-api-key: <api-key>' \
  --data '{
  "appId": "<string>",
  "projectId": "<string>",
  "environmentId": "<string>",
  "url": "<string>",
  "customHeaders": [
    {
      "key": "<string>",
      "value": "<string>"
    }
  ],
  "authMethod": "<string>",
  "userName": "<string>",
  "password": "<string>",
  "apiKey": "<string>",
  "apiKeyHeader": "<string>",
  "hmacHeader": "<string>",
  "hmacSecret": "<string>"
}'
{
  "success": true,
  "message": "<string>",
  "data": {
    "id": "<string>",
    "name": "<string>",
    "url": "<string>",
    "customHeaders": [
      {
        "key": "<string>",
        "value": "<string>"
      }
    ],
    "headers": [
      {
        "key": "<string>",
        "value": "<string>"
      }
    ],
    "authMethod": {
      "method": "<string>",
      "hmacHeader": "<string>",
      "hmacSecret": "<string>",
      "apiKey": "<string>",
      "apiKeyHeader": "<string>",
      "userName": "<string>",
      "password": "<string>"
    },
    "createdAt": "<string>",
    "updatedAt": "<string>"
  }
}

Body Parameters

appId
string
The ID of the app to create the webhook for.
Required for webhooks in an app.
projectId
string
The ID of the app to create the webhook for.
Required for global webhooks.
environmentId
string
The ID of the app to create the webhook for.
Required for global webhooks.
url
string
required
The URL where webhook events will be sent
customHeaders
array
Array of custom headers to be sent with the webhook
authMethod
string
Authentication method for the webhook. Must be one of: “basic”, “hmac”, or “apiKey”
userName
string
Username for basic authentication (required if authMethod is “basic”)
password
string
Password for basic authentication (required if authMethod is “basic”)
apiKey
string
API key for apiKey authentication (required if authMethod is “apiKey”)
apiKeyHeader
string
Header name for the API key (required if authMethod is “apiKey”)
hmacHeader
string
Header name for the HMAC signature (required if authMethod is “hmac”)
hmacSecret
string
Secret for HMAC signature generation (required if authMethod is “hmac”)

Response

success
boolean
Indicates if the request was successful
message
string
A message describing the result of the operation
data
object
The created webhook object

Response Example

{
  "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"
  }
}