Api reference
Dry-run usage events
Validate usage events without persisting them. Returns acceptance/rejection reasons that mirror real ingestion rules.
Related endpoints
POST /usage-events— Ingest usage eventsGET /usage-events— Query usage eventsGET /usage-events/aggregate/{meterId}— Get aggregated usage
Common errors
400 invalid_request— malformed payload or failed validation.401 unauthenticated— missing, malformed, or revoked API key.
Idempotency
Pass an Idempotency-Key header (UUID v4 recommended) to make retries safe. Keys are valid for 24 hours; see the idempotency guide.
Authorization
apiKey x-api-key<token>
Your RevKeen API key (powered by Unkey). Get it from Dashboard > Settings > API Keys. Use rk_sandbox_* for test mode and rk_live_* for production.
In: header
Request Body
application/json
TypeScript Definitions
Use the request body type in TypeScript.
Response Body
application/json
application/json
application/json
curl -X POST "https://api.revkeen.com/v2/usage-events/dry-run" \ -H "x-api-key: $REVKEEN_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "events": [ { "name": null, "customer_id": null, "external_customer_id": null, "subscription_id": null, "meter_id": null, "quantity": null, "timestamp": null, "idempotency_key": null, "metadata": null } ] }'{
"object": "usage_event_dry_run_result",
"summary": {
"would_ingest": 0,
"would_skip": 0,
"would_fail": 0
},
"data": [
{
"index": 0,
"status": "would_ingest",
"validationDetails": {
"meterMatched": true,
"customerMatched": true,
"billableQuantity": 0,
"filtersPassed": true
},
"reason": "string"
}
]
}{
"error": "string"
}{
"error": "string"
}