Skip to main content
Use client.Webhooks to receive VZaps events via HTTP callbacks in your application. Common fields on every call:
FieldTypeRequiredDescription
InstanceIDstringYesInstance ID.
InstanceTokenstringYesInstance token.

Webhooks.Get(ctx, instanceID, options)

Reads the current webhook configuration.
webhook, err := client.Webhooks.Get(ctx, "VZ...", vzaps.InstanceOptions{
	InstanceToken: "instance-token",
})
fmt.Printf("%#v\n", webhook)
Return: envelope { code, success, data } with webhook and subscribe (events).

Webhooks.Set(ctx, req)

Sets the callback URL and subscribed events.
_, err := client.Webhooks.Set(ctx, vzaps.WebhookConfigRequest{
	InstanceScopedRequest: vzaps.InstanceScopedRequest{
		InstanceID:    "VZ...",
		InstanceToken: "instance-token",
	},
	WebhookURL: "https://example.com/webhooks/vzaps",
	Events:     []string{"Message", "ReadReceipt", "Connected", "Disconnected"},
})
Return: envelope { code, success, data } with configured webhook and events.
Field (JSON)Go fieldRequiredDescription
webhook_urlWebhookURLYesPublic URL that receives callbacks.
eventsEventsNoSubscribed events.
Common events: Message, ReadReceipt, Connected, Disconnected, Presence, ChatPresence, HistorySync, GroupParticipantsAdd, GroupParticipantsRemove, All.

Webhooks.SearchLogs(ctx, req)

Searches webhook delivery logs.
logs, err := client.Webhooks.SearchLogs(ctx, vzaps.WebhookLogSearchRequest{
	InstanceScopedRequest: vzaps.InstanceScopedRequest{
		InstanceID:    "VZ...",
		InstanceToken: "instance-token",
	},
})
fmt.Printf("%#v\n", logs)
Return: envelope { code, success, data } with paginated logs (content[], totals). For advanced filters such as status, use client.Request() with the search endpoint body from the API reference.

Webhooks.GetLog(ctx, req)

Reads one specific delivery log.
log, err := client.Webhooks.GetLog(ctx, vzaps.WebhookLogRequest{
	InstanceScopedRequest: vzaps.InstanceScopedRequest{
		InstanceID:    "VZ...",
		InstanceToken: "instance-token",
	},
	LogID: "log_123",
})
fmt.Printf("%#v\n", log)
Return: envelope { code, success, data } with one delivery log (status, payload, attempts, etc.).

Webhooks.RetryLog(ctx, req)

Retries a failed delivery.
_, err := client.Webhooks.RetryLog(ctx, vzaps.WebhookLogRequest{
	InstanceScopedRequest: vzaps.InstanceScopedRequest{
		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.