Skip to main content
POST
/
v1
/
events
/
ingest
/
sync
ingest raw event synchronously for a feature
curl --request POST \
  --url https://api.unprice.dev/v1/events/ingest/sync \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "idempotencyKey": "idem_123",
  "eventSlug": "tokens_used",
  "properties": {
    "amount": 1
  },
  "featureSlug": "tokens",
  "id": "evt_123",
  "customerId": "cus_123",
  "timestamp": 1741454800000
}
'
{
  "allowed": true,
  "state": "processed",
  "rejectionReason": "LIMIT_EXCEEDED",
  "message": "Limit exceeded for meter meter_123"
}

Documentation Index

Fetch the complete documentation index at: https://docs.unprice.dev/llms.txt

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

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Body

application/json

The synchronous raw event ingestion payload

idempotencyKey
string
required

Logical idempotency key for deduplicating raw events

Example:

"idem_123"

eventSlug
string
required

The event slug

Example:

"tokens_used"

properties
object
required

Arbitrary event properties

Example:
{ "amount": 1 }
featureSlug
string
required

The feature slug to verify and ingest synchronously

Example:

"tokens"

id
string

Optional event id. If omitted, the API will generate an internal event id for processing.

Example:

"evt_123"

customerId
string

The unprice customer id

Example:

"cus_123"

timestamp
number

Event timestamp in epoch milliseconds, if not provided will use the time of the request

Example:

1741454800000

Response

The synchronous ingestion result for the targeted feature

allowed
boolean
required

Whether the event was accepted and synchronously ingested for the feature

Example:

true

state
enum<string>
required

Synchronous ingestion lifecycle state for the targeted feature

Available options:
processed,
rejected
Example:

"processed"

rejectionReason
enum<string>

Business rejection reason when the event could not be ingested

Available options:
CUSTOMER_NOT_FOUND,
EVENT_TOO_OLD,
INVALID_ENTITLEMENT_CONFIGURATION,
INVALID_AGGREGATION_PROPERTIES,
LIMIT_EXCEEDED,
LATE_EVENT_CLOSED_PERIOD,
NO_MATCHING_ENTITLEMENT,
UNROUTABLE_EVENT,
WALLET_EMPTY
Example:

"LIMIT_EXCEEDED"

message
string

Optional details about the synchronous ingestion result

Example:

"Limit exceeded for meter meter_123"