VoidhashDocs
DevelopersHelp centerGuidesAPI reference
Dashboard
Essentials
API overview
Authentication
Event capture
Push device API
Webhooks
Webhook delivery
Webhook events
Projects & keys
Projects
API keys
Audit log
Customers & access
Persons
Products
Perks
Sandbox
Paywalls
Paywalls
Paywall locations
Components
Component registry
Assets
Experiments & flags
Experiments
Feature flags
Analytics & events
Analytics
Analytics alerts
Cohorts
Group types
Groups
Events
Ingest policy
VoidQL
Tracking domains
Ads
Ads
Ad accounts
Meta measurement
Payments & stores
Payment providers
Payment provider products
Purchase history imports
Payment sources
Webhooks & notifications
Webhooks
Push notifications
Push configurations
Automations
Organization & team
Organizations
Members
Invitations
Billing
Your account
Profile
Session
Notices
Connected apps
Terms of Service
Developer tools
Schema
SDK
Event capture
Capture an event
Capture a batch of events

Capture a batch of events

Captures 1 to 100 events in one request, authorized like a single capture.

One invalid event rejects the whole request. Answers 202 with how many events were stored.

Guide: Event capture

More in Event capture

  • Capture an event POST

Something wrong or missing on this page? Tell us by email or on Discord.

PreviousCapture an eventNextPush device API

On this page

Header parametersRequest bodyExamplesResponse bodyMore in Event capture
POST
/i/v1/batch

Header parameters

x-secret-key?string

A project secret key, vh_sk_..., for requests from your servers. Leave it out when the body has a publishable token.

Request body

application/json

TypeScript definitions

Use the request body type in TypeScript.

events*array<>

The events, 1 to 100.

Items1 <= items
sent_at*string

When the request was sent, as an ISO 8601 timestamp. Voidhash compares it with when the request arrived to correct the events' times.

token?|

The project's publishable key, vh_pk_..., for clients that cannot hold a secret. Send it or the x-secret-key header; a secret key here is refused.

Examples

curl -X POST "https://api.voidhash.com/i/v1/batch" \  -H "x-secret-key: vh_sk_..." \  -H "Content-Type: application/json" \  -d '{    "events": [      {        "uuid": "018f6d2e-4c3a-7b1d-9e5f-2a8c1b0d4e6f",        "event": "paywall_viewed",        "context": {          "platform": "ios",          "app_version": "2.4.0"        },        "properties": {          "location": "onboarding-end",          "paywall": "annual-upsell"        },        "distinct_id": "user_8231",        "timestamp": "2026-03-14T09:25:40.000Z"      },      {        "uuid": "018f6d2e-4c3b-7a2e-8f10-3b9d2c1e5f70",        "event": "level_completed",        "context": {          "platform": "ios",          "app_version": "2.4.0"        },        "properties": {          "level": 4        },        "distinct_id": "user_8231",        "timestamp": "2026-03-14T09:31:02.000Z"      }    ],    "sent_at": "2026-03-14T09:31:05.000Z"  }'
{  "accepted": 2,  "rejected": 0}
{  "_tag": "CaptureInvalidRequestError",  "error": "string",  "code": "invalid_request"}
{  "_tag": "CaptureUnauthorizedError",  "error": "string",  "code": "unauthorized"}
{  "_tag": "CapturePayloadTooLargeError",  "error": "string",  "code": "payload_too_large"}
{  "_tag": "CaptureRateLimitedError",  "error": "string",  "code": "rate_limited",  "retry_after_ms": -9007199254740991}
{  "_tag": "CaptureInternalServerError",  "error": "string",  "code": "internal_error"}
{  "_tag": "CaptureDependencyUnavailableError",  "error": "string",  "code": "dependency_unavailable"}

Response body

application/json

application/json

application/json

application/json

application/json

application/json

application/json