Skip to main content
Use vzaps.webhooks to receive VZaps events via HTTP callbacks in your application. Common fields on every call:
FieldTypeRequiredDescription
instanceIdstringYesInstance ID.
instanceTokenstringYesInstance token.

webhooks.get(instanceId, options?)

Reads the current webhook configuration.
const webhook = await vzaps.webhooks.get('VZ...', {
  instanceToken: 'instance-token',
});

console.dir(webhook, { depth: null });
Return: envelope { code, success, data } with webhook and subscribe (events).

webhooks.set(request)

Sets the callback URL and subscribed events.
await vzaps.webhooks.set({
  instanceId: 'VZ...',
  instanceToken: 'instance-token',
  webhookURL: 'https://example.com/webhooks/vzaps',
  events: ['Message', 'ReadReceipt', 'Connected', 'Disconnected'],
});
Return: envelope { code, success, data } with configured webhook and events.
FieldTypeRequiredDescription
webhookURLstringYesPublic URL that receives callbacks.
eventsstring[] or stringNoSubscribed events.
Common events: Message, ReadReceipt, Connected, Disconnected, Presence, ChatPresence, HistorySync, GroupParticipantsAdd, GroupParticipantsRemove, All.

webhooks.searchLogs(request)

Searches webhook delivery logs.
const logs = await vzaps.webhooks.searchLogs({
  instanceId: 'VZ...',
  instanceToken: 'instance-token',
  status: 'failed',
});

console.dir(logs, { depth: null });
Return: envelope { code, success, data } with paginated logs (content[], totals).

webhooks.getLog(request)

Reads one specific delivery log.
const log = await vzaps.webhooks.getLog({
  instanceId: 'VZ...',
  instanceToken: 'instance-token',
  logId: 'log_123',
});

console.dir(log, { depth: null });
Return: envelope { code, success, data } with one delivery log (status, payload, attempts, etc.).

webhooks.retryLog(request)

Retries a failed delivery.
await vzaps.webhooks.retryLog({
  instanceId: 'VZ...',
  instanceToken: 'instance-token',
  logId: 'log_123',
});
Return: envelope { code, success, data } confirming callback retry.

When to use webhooks

Use webhooks when:
  • your application already has a public URL for callbacks;
  • you want to process events asynchronously in the backend;
  • your integration pipeline already works with HTTP POST.
For bots, dashboards, and apps that need low latency without exposing a URL, prefer Realtime.