Create Webhook

Create a new webhook for an app.

const webhook = await vartiq.webhook.create({
  name: "Webhook name",
  url: "https://your-webhook-url.com",
  appId: "APP_ID",
  customHeaders: [{ key: "x-app", value: "x-value" }], // optional
  authMethod: "basic", // optional: "basic", "hmac", or "apiKey"
  userName: "username", // required if authMethod is "basic"
  password: "password", // required if authMethod is "basic"
  apiKey: "api-key", // required if authMethod is "apiKey"
  apiKeyHeader: "x-api-key", // required if authMethod is "apiKey"
  hmacHeader: "x-signature", // required if authMethod is "hmac"
  hmacSecret: "your-secret" // required if authMethod is "hmac"
});

Get Webhooks

Get all webhooks for an app.

const webhooks = await vartiq.webhook.list({
  appId: "APP_ID"
});

Get Webhook

Get a specific webhook by ID.

const webhook = await vartiq.webhook.get("WEBHOOK_ID");

Update Webhook

Update an existing webhook.

const webhook = await vartiq.webhook.update("WEBHOOK_ID", {
  name: "New name", // optional
  url: "https://new-url.com" // optional
});

Delete Webhook

Delete a webhook.

await vartiq.webhook.delete("WEBHOOK_ID");

Create Webhook

Create a new webhook for an app.

const webhook = await vartiq.webhook.create({
  name: "Webhook name",
  url: "https://your-webhook-url.com",
  appId: "APP_ID",
  customHeaders: [{ key: "x-app", value: "x-value" }], // optional
  authMethod: "basic", // optional: "basic", "hmac", or "apiKey"
  userName: "username", // required if authMethod is "basic"
  password: "password", // required if authMethod is "basic"
  apiKey: "api-key", // required if authMethod is "apiKey"
  apiKeyHeader: "x-api-key", // required if authMethod is "apiKey"
  hmacHeader: "x-signature", // required if authMethod is "hmac"
  hmacSecret: "your-secret" // required if authMethod is "hmac"
});

Get Webhooks

Get all webhooks for an app.

const webhooks = await vartiq.webhook.list({
  appId: "APP_ID"
});

Get Webhook

Get a specific webhook by ID.

const webhook = await vartiq.webhook.get("WEBHOOK_ID");

Update Webhook

Update an existing webhook.

const webhook = await vartiq.webhook.update("WEBHOOK_ID", {
  name: "New name", // optional
  url: "https://new-url.com" // optional
});

Delete Webhook

Delete a webhook.

await vartiq.webhook.delete("WEBHOOK_ID");