API Reference
Events

Events API

The Events API accepts source-authenticated operational events and associates them with the project and Event Source represented by the supplied API key.

Endpoint

POST /v1/events/ingest

Use the API base URL configured for the target Lariba Cloud environment:

$LARIBA_API_BASE_URL/v1/events/ingest

Authentication

Send the source API key in the X-API-Key header. The key must be active, belong to an enabled Event Source, and include the events:write scope.

X-API-Key: YOUR_SOURCE_API_KEY

Runtime authorization failures include:

StatusCondition
401The API key is missing or invalid
403The source key is revoked
403The Event Source is disabled
403The key lacks events:write

Do not place source API keys in request bodies, URLs, logs, screenshots, browser bundles, or source control.

Headers

HeaderRequirementDescription
Content-TypeRequiredMust be application/json
X-API-KeyRequired at runtimeAuthenticates the source and project
Idempotency-KeyOptionalMakes retries deterministic

When supplied, Idempotency-Key must contain 1–200 nonblank characters and must identify only one normalized request.

Request body

{
  "event_type": "payment.failed",
  "source": "checkout-service",
  "event_id": "payment-attempt-001",
  "timestamp": "2026-07-24T00:00:00Z",
  "severity": "critical",
  "message": "Card authorization was declined",
  "status": "failed",
  "environment": "production",
  "payload": {
    "reason": "card_declined"
  },
  "properties": {
    "retryable": false
  }
}
FieldRequirementConstraintsDescription
event_typeRequired1–200 charactersOperational event name
sourceRequired1–200 charactersHuman-readable producer identity
event_idOptional1–200 charactersProducer-controlled external identity
timestampOptionalISO 8601 date-timeTime reported by the producer
severityOptional1–50 charactersApplication-defined severity
messageOptional1–2000 charactersHuman-readable message
statusOptional1–100 charactersApplication-defined state
environmentOptional1–100 charactersDeployment environment
payloadOptionalJSON objectEvent-specific data
propertiesOptionalJSON objectAdditional event properties

Lariba Cloud merges payload and properties. When both objects contain the same key, the value from properties takes precedence.

The supplied event_id is returned as external_event_id. Lariba Cloud also creates an internal ingested_event_id.

Example request

curl -X POST "$LARIBA_API_BASE_URL/v1/events/ingest" \
  -H "Content-Type: application/json" \
  -H "X-API-Key: YOUR_SOURCE_API_KEY" \
  -H "Idempotency-Key: payment-failed-001" \
  -d '{
    "event_type": "payment.failed",
    "source": "checkout-service",
    "event_id": "payment-attempt-001",
    "severity": "critical",
    "status": "failed",
    "environment": "production",
    "payload": {
      "reason": "card_declined"
    }
  }'

Successful response

A successful request returns HTTP 200.

{
  "accepted": true,
  "project_id": "PROJECT_ID",
  "api_key_id": "API_KEY_ID",
  "ingested_event_id": "INGESTED_EVENT_ID",
  "external_event_id": "payment-attempt-001",
  "event_type": "payment.failed",
  "timestamp": "2026-07-24T00:00:00Z",
  "properties": {
    "source": "checkout-service",
    "severity": "critical",
    "status": "failed",
    "environment": "production",
    "reason": "card_declined",
    "external_event_id": "payment-attempt-001"
  },
  "duplicate": false,
  "ingest_mode": "async",
  "persisted_synchronously": false
}

The response can also include X-Lariba-Ingest-Mode and X-Lariba-Persisted-Synchronously.

Idempotency

Lariba Cloud retains ingestion idempotency records for approximately 24 hours.

Reusing the same key with the same normalized request returns the stored response with duplicate set to true.

Reusing the same key with different request content returns HTTP 409:

{
  "detail": "Idempotency-Key already used with different request payload"
}

A concurrent request that is still being processed can return HTTP 409:

{
  "detail": "Idempotency-Key request is already in progress"
}

Validation errors

StatusCondition
422A required field is missing or blank
422A string exceeds its maximum length
422payload or properties is not a JSON object
422Idempotency-Key is blank or longer than 200 characters
409An idempotency key conflicts with another request
429The applicable ingestion limit has been exceeded

Related documentation