Skip to main content
POST
/
external
/
event
Ingest events
curl --request POST \
  --url https://platform.runonatlas.com/external/event/ \
  --header 'Content-Type: application/json' \
  --header 'x-api-key: <api-key>' \
  --data '
{
  "customerId": "atlas-internal-customer-id-123",
  "data": {
    "quantity": 10
  },
  "eventName": "api-usage",
  "generatedAt": "2022-01-01T00:00:00.000Z",
  "idempotencyKey": "idempotency-key-123",
  "userId": "atlas-internal-user-id-123"
}
'

Authorizations

x-api-key
string
header
required

You can obtain this key from the Atlas dashboard. It must be of type secret

Body

application/json
customerId
string
required

The Atlas customer ID. It must be the Atlas customer ID, not your system's customer ID.

Minimum string length: 1
Example:

"atlas-internal-customer-id-123"

data
object
required

The event data. Used to report specific data about the events that can be used to identify it or even compute the usage.

Example:
{ "quantity": 10 }
eventName
string
required

The event name. Together with data, it is used to process the event. It is usually the slug of the feature that generated the event.

Minimum string length: 1
Example:

"api-usage"

generatedAt
string
required

The event generation date

Example:

"2022-01-01T00:00:00.000Z"

idempotencyKey
string

The event idempotency key. Used to ensure that the event is not processed multiple times. Each event must have a unique idempotency key. If not provided, an idempotency key will be automatically generated hashing the event payload.

Minimum string length: 1
Example:

"idempotency-key-123"

userId
string | null

The id of the user that generated the event

Example:

"atlas-internal-user-id-123"

Response

The events have been accepted and will be processed asynchronously.