Skip to main content

Documentation Index

Fetch the complete documentation index at: https://guide.withvayu.com/llms.txt

Use this file to discover all available pages before exploring further.

Vayu processes events in batches. If some events in a batch are invalid, only those are discarded — valid events are still ingested.

Event structure

Each event requires four fields:
FieldTypeDescription
namestringEvent label (e.g. api_call, storage_used)
timestampISO 8601 datetimeWhen the event occurred (UTC)
customerAliasstringIdentifies the customer (external ID or alias)
refstringUnique reference for idempotency
dataobject (optional)Arbitrary key-value metadata

Batch limits

  • Minimum events: 1
  • Maximum events: 1,000
  • Total payload size: 256 KB

Example

import { Vayu } from 'vayu-ts';

const vayu = new Vayu(process.env.VAYU_API_KEY);

const result = await vayu.events.send([
  {
    name: 'api_call',
    timestamp: new Date(),
    customerAlias: 'customer-123',
    ref: 'evt_abc123',
    data: { endpoint: '/users', method: 'GET' },
  },
]);

console.log('Valid:', result.validEvents.length);
console.log('Invalid:', result.invalidEvents.length);

Response structure

The response includes two arrays:
  • validEvents — events that were successfully ingested
  • invalidEvents — events that failed validation, each with an error message
{
  "validEvents": [ { "name": "api_call", "ref": "evt_abc123", ... } ],
  "invalidEvents": []
}

Immediate availability

Events are available in the API and UI immediately after ingestion.
Invalid events do not cause the entire request to fail. They are returned in the invalidEvents array while valid events are still processed.