Skip to main content
POST
/
events
Create events
curl --request POST \
  --url https://api.getenso.ai/events \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "CustomerEntityId": "ent_6CsgzAdRgTlzT_9O",
  "metric": "api_calls",
  "value": 42,
  "timestamp": "2026-04-01T12:00:00Z",
  "metadata": {
    "source": "billing-job"
  },
  "eventId": "evt_123",
  "JobId": "job_xI_wWRvcLpZzhiJF",
  "jobId": "job_xI_wWRvcLpZzhiJF"
}
'
{
  "CustomerEntityId": "ent_6CsgzAdRgTlzT_9O",
  "metric": "api_calls",
  "value": 42,
  "timestamp": "2026-04-01T12:00:00Z",
  "metadata": {
    "source": "billing-job"
  },
  "eventId": "evt_123",
  "JobId": "job_xI_wWRvcLpZzhiJF",
  "jobId": "job_xI_wWRvcLpZzhiJF"
}
SystemUser permission: EntityService:getEntityByIdentifier, EventService:createEvent, MeterService:createUsageByMeter

Authorizations

Authorization
string
header
required

JWT bearer token obtained from POST /auth/system-login using your client credentials.

Body

application/json

Event object that needs to be created

CustomerEntityId
string
required

Enso ID of the customer entity associated with the event. If Enso ID is not known, you can pass any unique identifier of the customer entity instead.

Example:

"ent_6CsgzAdRgTlzT_9O"

metric
string
required

Metric name

Example:

"api_calls"

value
number<float>
required

Value of the metric

Example:

42

timestamp
string<date-time>
required

Timestamp of the event

Example:

"2026-04-01T12:00:00Z"

metadata
object

Additional metadata for the event

Example:
{ "source": "billing-job" }
eventId
string

Unique identifier for the event. If not passed, an event ID may be generated from metric, value, timestamp, and CustomerEntityId.

Example:

"evt_123"

JobId
string

Job identifier for the event import or batch

Example:

"job_xI_wWRvcLpZzhiJF"

jobId
string

Job identifier for the event import or batch

Example:

"job_xI_wWRvcLpZzhiJF"

Response

Event created

CustomerEntityId
string
required

Enso ID of the customer entity associated with the event. If Enso ID is not known, you can pass any unique identifier of the customer entity instead.

Example:

"ent_6CsgzAdRgTlzT_9O"

metric
string
required

Metric name

Example:

"api_calls"

value
number<float>
required

Value of the metric

Example:

42

timestamp
string<date-time>
required

Timestamp of the event

Example:

"2026-04-01T12:00:00Z"

metadata
object

Additional metadata for the event

Example:
{ "source": "billing-job" }
eventId
string

Unique identifier for the event. If not passed, an event ID may be generated from metric, value, timestamp, and CustomerEntityId.

Example:

"evt_123"

JobId
string

Job identifier for the event import or batch

Example:

"job_xI_wWRvcLpZzhiJF"

jobId
string

Job identifier for the event import or batch

Example:

"job_xI_wWRvcLpZzhiJF"