Event Structure
Events are the basic unit of billable usage. Each event represents a single action a customer may be billed for.Fields
Example Event
Send via API
The recommended method for real-time event ingestion.POST /events always takes an events array — a single event is an array of one.
Single Event
Batch Events
Send multiple events in a single request (recommended for high volume). A request accepts up to 100 events:cURL Example
Response
The response echoes theunique_id of every event that was accepted and every one that was not:
Send via CSV
Upload a CSV in the dashboard for batch ingestion or historical data.CSV Format
Three columns are required —timestamp, account and event_name. Add one column per event property, each prefixed with prop_:
Upload via Dashboard
- Navigate to Events in the dashboard
- Click Upload via File
- Download the provided CSV template
- Add your events and export the file as CSV
- Upload the file
CSV Best Practices
- Use the downloaded template so the required headers match exactly
- Use RFC 3339 timestamps
- Prefix every property column with
prop_ - Leave no blank cells — rows with empty values are rejected
Send via Data Sources
Connect an external data source and let Alguna pull billable events in on a schedule.Customer Identification
Using the Alguna Customer ID
Using Aliases
Use your own customer identifiers by adding them as aliases on the customer:Idempotency & Deduplication
Unique ID Requirements
Theunique_id field is an idempotency key: an event that repeats a unique_id already ingested for the same customer, event name and timestamp is counted once, not twice. It is capped at 72 characters — hash longer natural keys before sending.
Timestamps
Requirements
- Must be RFC 3339 (ISO 8601) format
- Optional — omit it and Alguna stamps the event with the time it was received
- Use the time the usage actually occurred: the timestamp decides which billing period the event falls into
Examples
Backdating Events
Ingest historical events in batches of up to 100:Properties
Properties carry event data used for filtering and aggregation.properties is a flat key/value map of up to 50 keys.
Common Property Patterns
Property Types
Nesting is not supported. Flatten structured data into prefixed keys —
request_method, response_bytes — so metric filters and aggregations can reach it.Error Handling
The API returns errors as astatus and a detail message. See the API overview for the full status-code list.
ValidationError, AuthenticationError, NotFoundError, RateLimitError — all extending AlgunaError. See error handling in the SDK reference.
Partial Failures
A200 response does not mean every event landed. Check the failed array — it lists the unique_id of each event that could not be ingested, so you can correct and resend just those.
Retry Strategy
unique_id is deduplicated rather than double-counted.
High-Volume Ingestion
Batch Recommendations
A request carries at most 100 events, so scale by sending more requests rather than bigger ones.
For backfills and continuous high-volume feeds, prefer a data source integration over the API.
Best Practices
Batch Events
Send events in batches of up to 100 for better performance.
Unique IDs
Generate truly unique IDs, under 72 characters, to prevent duplicates.
Accurate Timestamps
Use the actual event time, not ingestion time.
Rich Properties
Include the flat properties needed for filtering and aggregation.
Troubleshooting
Events Not Appearing
- Check event timestamp is within the billing period
- Verify
accountis a known customer ID or a configured alias - Confirm
event_namematches your metric - Review the
failedarray in the API response
Usage Shows Zero
- Verify events are being sent successfully
- Check metric configuration and filters
- Confirm event properties match metric requirements
Duplicate Charges
- Ensure
unique_idis truly unique per event - Check for duplicate event sends in your code
- Review event logs for repeated ingestion
Next Steps
Define Metrics
Configure billable metrics.
Metrics Reference
Complete metrics configuration guide.