Skip to main content
PUT
/
v1
/
events
/
{idempotencyKey}
Overwrite event
curl --request PUT \
  --url https://api.useaira.com/v1/events/{idempotencyKey} \
  --header 'Content-Type: application/json' \
  --header 'X-API-KEY: <api-key>' \
  --data '
{
  "eventName": "api_request",
  "customerExternalId": "cust_1234567890abcdef",
  "properties": {
    "value": 3600,
    "endpoint": "/api/v1/users",
    "method": "GET",
    "status_code": 200
  },
  "occurredAt": "2024-01-01T12:00:00Z"
}
'
{
  "id": "<string>",
  "idempotencyKey": "123e4567-e89b-12d3-a456-426614174000",
  "eventName": "api_request",
  "customerExternalId": "cust_1234567890abcdef",
  "properties": {
    "value": 3600,
    "endpoint": "/api/v1/users",
    "method": "GET",
    "status_code": 200
  },
  "occurredAt": "2024-01-01T12:00:00Z",
  "createdAt": "2023-11-07T05:31:56Z",
  "archivedAt": "2023-11-07T05:31:56Z",
  "version": 123
}

Authorizations

X-API-KEY
string
header
required

API Key Authentication.

Path Parameters

idempotencyKey
string
required

Unique key to ensure idempotency of the event.

Pattern: ^[a-zA-Z0-9_-]+$

Body

application/json

Full replacement payload for the event identified by idempotencyKey. Frozen fields (eventName, customerExternalId, occurredAt) must match the existing event; properties (including properties.value) is overwritten.

eventName
string
required

Identifier of the event.

Pattern: ^[a-zA-Z0-9_-]+$
Example:

"api_request"

customerExternalId
string
required

External identifier of the customer involved in the event.

Pattern: ^[a-zA-Z0-9_-]+$
Example:

"cust_1234567890abcdef"

properties
object
required

A dictionary of additional properties associated with the event.

Example:
{
"value": 3600,
"endpoint": "/api/v1/users",
"method": "GET",
"status_code": 200
}
occurredAt
string<date-time>
required

ISO 8601 timestamp in UTC indicating when the event occurred.

Example:

"2024-01-01T12:00:00Z"

Response

Schema defining an event.

id
string
required

Unique identifier for the event.

idempotencyKey
string
required

Unique key to ensure idempotency of the event.

Pattern: ^[a-zA-Z0-9_-]+$
Example:

"123e4567-e89b-12d3-a456-426614174000"

eventName
string
required

Identifier of the event.

Pattern: ^[a-zA-Z0-9_-]+$
Example:

"api_request"

customerExternalId
string
required

External identifier of the customer involved in the event.

Pattern: ^[a-zA-Z0-9_-]+$
Example:

"cust_1234567890abcdef"

properties
object
required

A dictionary of additional properties associated with the event.

Example:
{
"value": 3600,
"endpoint": "/api/v1/users",
"method": "GET",
"status_code": 200
}
occurredAt
string<date-time>
required

ISO 8601 timestamp in UTC indicating when the event occurred.

Example:

"2024-01-01T12:00:00Z"

createdAt
string<date-time>
required

ISO 8601 timestamp in UTC indicating when the event was created.

archivedAt
null | string<date-time>
required

ISO 8601 timestamp in UTC indicating when the event was archived, or null if active.

version
integer
required

Version number. v1 is the original; subsequent versions are edits or archives.