> ## Documentation Index
> Fetch the complete documentation index at: https://docs.sendrealm.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Event Ingest

> Submit customer events and understand reserved system event rules.

## Endpoint

`POST /events`

## Request body

```json theme={null}
{
  "event": "order.completed",
  "contact_id": "c671f89b-3ec1-4c58-9ad2-4ef8c2917cda",
  "payload": {
    "order_id": "ord_123",
    "total": 4900
  },
  "correlation": {
    "key": "order_id",
    "value": "ord_123"
  },
  "occurred_at": "2026-06-08T14:15:00.000Z",
  "idempotency_key": "evt_order_completed_ord_123"
}
```

You can also identify a contact with `external_id` or `email`.

Use `correlation` when an identity can have more than one active business flow.
For checkout recovery, send the same `checkout_id` with both `checkout.started`
and `checkout.completed`; a correlated wait resumes only its matching checkout.

To create or merge an email contact while ingesting an event, opt in explicitly:

```json theme={null}
{
  "event": "checkout.started",
  "email": "olivia@example.com",
  "contact": {
    "mode": "upsert",
    "fields": {
      "first_name": "Olivia"
    }
  }
}
```

Without `contact.mode: "upsert"`, event ingestion resolves existing contacts only.

Identity resolution order is:

1. `contact_id`
2. `external_id`
3. normalized `email`

## Successful response

```json theme={null}
{
  "data": {
    "id": "4d978da0-4504-42e3-9d71-e9b9a2f9082d",
    "event": "order.completed",
    "resolved_identity_type": "contact_id",
    "resolved_identity_value": "c671f89b-3ec1-4c58-9ad2-4ef8c2917cda",
    "occurred_at": "2026-06-08T14:15:00.000Z"
  }
}
```

New customer events currently return `202 Accepted`.

## Idempotent replay response

If you reuse the same `idempotency_key`, Sendrealm returns the existing event instead of creating a new one:

```json theme={null}
{
  "data": {
    "id": "4d978da0-4504-42e3-9d71-e9b9a2f9082d",
    "event": "order.completed",
    "deduplicated": true,
    "occurred_at": "2026-06-08T14:15:00.000Z"
  }
}
```

## Reserved namespace

Customer-submitted events must not start with `sendrealm.`.

Examples of Sendrealm system events:

* `sendrealm.mail.delivery`
* `sendrealm.push.open`
* `sendrealm.contact.updated`
* `sendrealm.topic.subscribed`

## Guarantees and limits

* Event ingest is at-least-once.
* Idempotency is enforced by `project_id + idempotency_key`.
* Payload size is capped by the project's configured event payload limit.
* Processing retries use exponential backoff before a dead-letter handoff.
* Ordering across separate events is not guaranteed.

## Retention

* Default event retention is 90 days.
* Retention windows can be adjusted through backoffice-managed project automation settings.
