---
title: "EventWolf API: Events"
description: "Publish an event, import event history, validate an event, list events, look up an event, stream events, get an event, get an event timeline, erase event fields, or list event erasures, with the EventWolf API."
url: "https://agentpost.tools/docs/eventwolf/reference/events"
kind: reference
---

# Events

Publish CloudEvents, import another system’s history, and read them back: the history by filter, one event by sequence or by its source and ID, what it caused, and a live tail. Erase personal fields from a stored event, and list its erasures.

[Events](/docs/eventwolf/concepts/events.md) explains the envelope, what EventWolf adds, and when an event is a duplicate, and [Filters](/docs/eventwolf/concepts/filters.md) the filter every read takes.

Paths are relative to `https://api.agentpost.tools/v1/events`, and every request follows the [API basics](/docs/platform/api-basics.md). [Who may call](/docs/eventwolf/reference.md#who-may-call) explains each kind of caller.

## Publish an event

`POST /events`

Publishes one event as `application/cloudevents+json`, or up to 100 as an array in `application/cloudevents-batch+json`. An event is idempotent on its `source` and `id`: publishing it again answers `duplicate` with the first sequence, which is left out when your credential may not publish the stored event. One event answers `201` when accepted, `200` when a duplicate, and its rejection’s error when rejected; a batch answers `200` with a result for each event, in order.

-   **Who may call:** Your server, with your project’s secret key.
-   **Credential:** the examples send your project’s `dev` secret key, `sk_test_…`, as `Authorization: Bearer <token>`.
-   **Idempotency-Key:** not taken. Publish takes no `Idempotency-Key`: an event is idempotent on its `source` and `id`.
-   **Content-Type:** `application/cloudevents+json` for one event, `application/cloudevents-batch+json` for a batch.

### Body

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `specversion` | `"1.0"` | Yes |  |
| `id` | `string` | No | 1–500 characters. |
| `source` | `string` | Yes | 1–2048 characters. |
| `type` | `string` | Yes | 1–500 characters. |
| `subject` | `string` | No | 1–500 characters. |
| `time` | `string` | No | An ISO 8601 date and time. |
| `datacontenttype` | `string` | No |  |
| `dataschema` | `string` | No | 1–2048 characters. |
| `data` | `any` | No |  |

### Response

`201 Created`, with [`PublishOutcome`](/docs/eventwolf/reference/events.md#the-publishoutcome-object).

### Errors

-   [`payload_too_large`](/docs/eventwolf/errors.md#payload_too_large) (413)
-   [`invalid_request`](/docs/eventwolf/errors.md#invalid_request) (400)
-   [`invalid_envelope`](/docs/eventwolf/errors.md#invalid_envelope) (422)
-   [`unknown_type`](/docs/eventwolf/errors.md#unknown_type) (422)
-   [`invalid_data`](/docs/eventwolf/errors.md#invalid_data) (422)
-   [`data_too_large`](/docs/eventwolf/errors.md#data_too_large) (413)

Any operation can also answer with the codes [Conventions](/docs/eventwolf/reference.md#conventions) lists.

```bash tab="curl"
curl -X POST https://api.agentpost.tools/v1/events/events \
  -H "Authorization: Bearer sk_test_…" \
  -H "Content-Type: application/cloudevents+json" \
  -d '{
    "specversion": "1.0",
    "id": "01JD4Z3XK6R0V8C2YQ7M5N9P1T",
    "source": "/support/backend",
    "type": "request.assigned",
    "subject": "r_9",
    "actor": "user:u_ben",
    "refs": "request:r_9 user:u_ana",
    "severity": "normal",
    "data": {
      "summary": "Ben assigned “Refund for order 1042” to you",
      "assignee": {
        "id": "u_ana"
      }
    }
  }'
```

```json title="Response"
{
  "result": "accepted",
  "sequence": 42,
  "id": "01JD4Z3XK6R0V8C2YQ7M5N9P1T",
  "source": "/support/backend"
}
```

## Import event history

`POST /events/import`

Imports up to 100 historical events in a request of at most 1 MB, with a result per entry. Keeps each event’s `time` and its original receipt time, records the batch and origin in `imported`, and gives each a new sequence after the events already stored. Omit an entry’s `receivedAt` only when it is unknown; the import time is used. Each event needs its original `id`. Unregistered types and data that fails today’s schema still import, and a type’s `refPaths` add no references. Imported events are history only: they make no matches, deliveries, notifications, or pushes, and the live tail leaves them out. An event carrying a record field, such as `sequence` or `projectId`, is rejected. A `source` and `id` already in this project answers `duplicate` and leaves the first record unchanged; its sequence is left out when your credential may not import the stored event.

-   **Who may call:** Your server, with your project’s secret key.
-   **Credential:** the examples send your project’s `dev` secret key, `sk_test_…`, as `Authorization: Bearer <token>`.
-   **Idempotency-Key:** not taken. Import takes no `Idempotency-Key`: each event is idempotent on its `source` and `id` within this project.

### Body

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `batchId` | `string` | Yes | Your import batch ID, scoped to this project. Keep it when resuming the batch; 1–500 characters. |
| `origin` | `string` | Yes | The system or export the history came from; 1–2048 characters. |
| `events` | `any[]` | Yes | Up to 100 entries, each { event: CloudEvent, receivedAt?: ISO timestamp }. Each event needs its original id. Entry errors are returned per event; up to 100 items. |

### Response

`200 OK`, with:

| Name | Type | Present | Description |
| --- | --- | --- | --- |
| `results` | [`PublishOutcome`](/docs/eventwolf/reference/events.md#the-publishoutcome-object) array | Always |  |

### Errors

-   [`payload_too_large`](/docs/eventwolf/errors.md#payload_too_large) (413)
-   [`invalid_request`](/docs/eventwolf/errors.md#invalid_request) (400)

Any operation can also answer with the codes [Conventions](/docs/eventwolf/reference.md#conventions) lists.

```bash tab="curl"
curl -X POST https://api.agentpost.tools/v1/events/events/import \
  -H "Authorization: Bearer sk_test_…" \
  -H "Content-Type: application/json" \
  -d '{
    "batchId": "support-export-2026-11",
    "origin": "legacy-support",
    "events": [
      {
        "event": {
          "specversion": "1.0",
          "id": "01JD4Z3XK6R0V8C2YQ7M5N9P1T",
          "source": "/support/backend",
          "type": "request.assigned",
          "subject": "r_9",
          "actor": "user:u_ben",
          "refs": "request:r_9 user:u_ana",
          "severity": "normal",
          "data": {
            "summary": "Ben assigned “Refund for order 1042” to you",
            "assignee": {
              "id": "u_ana"
            }
          },
          "time": "2026-11-12T09:41:07.000Z"
        },
        "receivedAt": "2026-11-12T09:41:07.000Z"
      }
    ]
  }'
```

```json title="Response"
{
  "results": [
    {
      "result": "accepted",
      "sequence": 42,
      "id": "01JD4Z3XK6R0V8C2YQ7M5N9P1T",
      "source": "/support/backend"
    }
  ]
}
```

## Validate an event

`POST /events/validate`

What publishing this event would answer, with nothing written and no failure recorded.

-   **Who may call:** Your server, with your project’s secret key.
-   **Credential:** the examples send your project’s `dev` secret key, `sk_test_…`, as `Authorization: Bearer <token>`.
-   **Idempotency-Key:** not taken. This route writes nothing, so it takes no `Idempotency-Key`.

### Body

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `specversion` | `"1.0"` | Yes |  |
| `id` | `string` | No | 1–500 characters. |
| `source` | `string` | Yes | 1–2048 characters. |
| `type` | `string` | Yes | 1–500 characters. |
| `subject` | `string` | No | 1–500 characters. |
| `time` | `string` | No | An ISO 8601 date and time. |
| `datacontenttype` | `string` | No |  |
| `dataschema` | `string` | No | 1–2048 characters. |
| `data` | `any` | No |  |

### Response

`200 OK`, with [`ValidateResponse`](/docs/eventwolf/reference/events.md#the-validateresponse-object).

### Errors

-   [`payload_too_large`](/docs/eventwolf/errors.md#payload_too_large) (413)
-   [`invalid_request`](/docs/eventwolf/errors.md#invalid_request) (400)

Any operation can also answer with the codes [Conventions](/docs/eventwolf/reference.md#conventions) lists.

```bash tab="curl"
curl -X POST https://api.agentpost.tools/v1/events/events/validate \
  -H "Authorization: Bearer sk_test_…" \
  -H "Content-Type: application/json" \
  -d '{
    "specversion": "1.0",
    "id": "01JD4Z3XK6R0V8C2YQ7M5N9P1T",
    "source": "/support/backend",
    "type": "request.assigned",
    "subject": "r_9",
    "actor": "user:u_ben",
    "refs": "request:r_9 user:u_ana",
    "severity": "normal",
    "data": {
      "summary": "Ben assigned “Refund for order 1042” to you",
      "assignee": {
        "id": "u_ana"
      }
    }
  }'
```

```json title="Response"
{
  "valid": true,
  "issues": []
}
```

## List events

`GET /events`

The events that match a filter, in sequence order by default. Use `sort=receivedAt` to place imported history beside live events by receipt time, with sequence breaking ties. Both sorts are newest first unless `order=asc`. Pass `next` as `after` with the same sort, order, and filters; a cursor from the other sort is refused. The `from` and `to` bounds always filter occurrence time, not receipt time. Every page is also held to what your credential may read.

-   **Who may call:** Your server, with your project’s secret key.
-   **Credential:** the examples send your project’s `dev` secret key, `sk_test_…`, as `Authorization: Bearer <token>`.
-   **Pages:** `limit`, 1 to 200, default 50, with `next` and `after`. [Lists](/docs/platform/api-basics.md#lists) has the rule.

### Query parameters

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `from` | `string` | No | An ISO 8601 date and time. |
| `to` | `string` | No | An ISO 8601 date and time. |
| `after` | `string` | No | The next cursor from a page with the same sort; 1–100 characters. |
| `sort` | `string` | No | `sequence` pages in the order the project accepted events. `receivedAt` pages by receipt time, with sequence breaking ties, so imported history sits beside live events; default `"sequence"`. One of `"sequence"` or `"receivedAt"`. |
| `order` | `"asc"` or `"desc"` | No | `desc` is newest first, `asc` oldest first; default `"desc"`. |
| `limit` | `integer` | No | 1–200; default `50`. |
| `types` | `string` | No | Event types, comma-separated. A trailing `.*` matches every type below it, so `request.*` matches `request.created` but not `request`, and `*` matches every type. |
| `sources` | `string` | No | Sources, comma-separated. A source is exact, or ends with one `*`, such as `/support/*`. |
| `workspace` | `string` | No | Only events whose `workspace` extension is this. |
| `subject` | `string` | No | Only events with this `subject`. |
| `ref` | `string` | No | A reference, `type:id` such as `request:r_9`, or a type alone, such as `request`. Repeat `ref` for any of several. |
| `ext[name]` | `string` | No | An extension attribute’s value, such as `ext[severity]=warning`. The name matches `^[a-z0-9]{1,20}$`. A comma separates values: any of them matches. `true`, `false`, and numbers are read as themselves. |
| `where[path]` | `string` | No | The value at a data path, such as `where[assignee.id]=u_ana`. The path matches `^[A-Za-z0-9_$-]+(?:\.[A-Za-z0-9_$-]+)*$`, up to 10 paths. A comma separates values: any of them matches. `true`, `false`, and numbers are read as themselves. |

### Response

`200 OK`, with:

| Name | Type | Present | Description |
| --- | --- | --- | --- |
| `events` | [`EventRecord`](/docs/eventwolf/reference/events.md#the-eventrecord-object) array | Always |  |
| `next` | `string` | When set |  |

### Errors

-   [`query_timeout`](/docs/eventwolf/errors.md#query_timeout) (408)
-   [`invalid_request`](/docs/eventwolf/errors.md#invalid_request) (400)
-   [`invalid_filter`](/docs/eventwolf/errors.md#invalid_filter) (400)

Any operation can also answer with the codes [Conventions](/docs/eventwolf/reference.md#conventions) lists.

```bash tab="curl"
curl 'https://api.agentpost.tools/v1/events/events?ref=request%3Ar_9&sort=receivedAt&order=asc&limit=50' \
  -H "Authorization: Bearer sk_test_…"
```

```json title="Response"
{
  "events": [
    {
      "sequence": 42,
      "receivedAt": "2026-11-12T09:41:07.000Z",
      "publishedBy": {
        "actor": {
          "id": "key:backend"
        },
        "via": "host"
      },
      "refs": [
        {
          "type": "request",
          "id": "r_9",
          "role": "ref"
        },
        {
          "type": "user",
          "id": "u_ana",
          "role": "ref"
        },
        {
          "type": "user",
          "id": "u_ben",
          "role": "actor"
        }
      ],
      "typeVersion": 1,
      "event": {
        "specversion": "1.0",
        "id": "01JD4Z3XK6R0V8C2YQ7M5N9P1T",
        "source": "/support/backend",
        "type": "request.assigned",
        "subject": "r_9",
        "time": "2026-11-12T09:41:06.512Z",
        "datacontenttype": "application/json",
        "actor": "user:u_ben",
        "refs": "request:r_9 user:u_ana",
        "severity": "normal",
        "data": {
          "summary": "Ben assigned “Refund for order 1042” to you",
          "assignee": {
            "id": "u_ana"
          }
        },
        "sequence": 42
      }
    },
    {
      "sequence": 57,
      "receivedAt": "2026-11-12T16:20:31.000Z",
      "publishedBy": {
        "actor": {
          "id": "key:backend"
        },
        "via": "host"
      },
      "refs": [
        {
          "type": "request",
          "id": "r_9",
          "role": "ref"
        },
        {
          "type": "user",
          "id": "u_ana",
          "role": "actor"
        }
      ],
      "event": {
        "specversion": "1.0",
        "id": "01JD5KQ2W8E1G3H4J5K6M7N8P9",
        "source": "/support/backend",
        "type": "request.resolved",
        "subject": "r_9",
        "time": "2026-11-12T16:20:30.884Z",
        "datacontenttype": "application/json",
        "actor": "user:u_ana",
        "refs": "request:r_9",
        "data": {
          "resolution": "refunded"
        },
        "sequence": 57
      }
    }
  ]
}
```

## Look up an event

`GET /events/lookup`

One event by the `source` and `id` its producer gave it, as a producer checks whether an event was accepted.

-   **Who may call:** Your server, with your project’s secret key.
-   **Credential:** the examples send your project’s `dev` secret key, `sk_test_…`, as `Authorization: Bearer <token>`.

### Query parameters

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `source` | `string` | Yes |  |
| `id` | `string` | Yes |  |

### Response

`200 OK`, with:

| Name | Type | Present | Description |
| --- | --- | --- | --- |
| `event` | [`EventRecord`](/docs/eventwolf/reference/events.md#the-eventrecord-object) | Always |  |

### Errors

-   [`invalid_request`](/docs/eventwolf/errors.md#invalid_request) (400)
-   [`not_found`](/docs/eventwolf/errors.md#not_found) (404)

Any operation can also answer with the codes [Conventions](/docs/eventwolf/reference.md#conventions) lists.

```bash tab="curl"
curl 'https://api.agentpost.tools/v1/events/events/lookup?source=%2Fsupport%2Fbackend&id=01JD4Z3XK6R0V8C2YQ7M5N9P1T' \
  -H "Authorization: Bearer sk_test_…"
```

```json title="Response"
{
  "event": {
    "sequence": 42,
    "receivedAt": "2026-11-12T09:41:07.000Z",
    "publishedBy": {
      "actor": {
        "id": "key:backend"
      },
      "via": "host"
    },
    "refs": [
      {
        "type": "request",
        "id": "r_9",
        "role": "ref"
      },
      {
        "type": "user",
        "id": "u_ana",
        "role": "ref"
      },
      {
        "type": "user",
        "id": "u_ben",
        "role": "actor"
      }
    ],
    "typeVersion": 1,
    "event": {
      "specversion": "1.0",
      "id": "01JD4Z3XK6R0V8C2YQ7M5N9P1T",
      "source": "/support/backend",
      "type": "request.assigned",
      "subject": "r_9",
      "time": "2026-11-12T09:41:06.512Z",
      "datacontenttype": "application/json",
      "actor": "user:u_ben",
      "refs": "request:r_9 user:u_ana",
      "severity": "normal",
      "data": {
        "summary": "Ben assigned “Refund for order 1042” to you",
        "assignee": {
          "id": "u_ana"
        }
      },
      "sequence": 42
    }
  }
}
```

## Stream events

`GET /events/stream`

Server-Sent Events: each new event that matches the filter, as an `EventRecord` whose message `id` is its sequence, and a `heartbeat` message with `{ "through": <sequence> }` while nothing matches. Reconnect with `Last-Event-ID`, or `after` for a client that can’t set it, to resume with retained matching events after that sequence. Without either, the tail sends only events published after it opens. [Event retention](/docs/eventwolf/concepts/events.md#limits) explains what happens when events age out.

-   **Who may call:** Your server, with your project’s secret key.
-   **Credential:** the examples send your project’s `dev` secret key, `sk_test_…`, as `Authorization: Bearer <token>`.
-   **Last-Event-ID:** Optional. The sequence of the last event you received.

### Query parameters

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `after` | `string` | No |  |
| `types` | `string` | No | Event types, comma-separated. A trailing `.*` matches every type below it, so `request.*` matches `request.created` but not `request`, and `*` matches every type. |
| `sources` | `string` | No | Sources, comma-separated. A source is exact, or ends with one `*`, such as `/support/*`. |
| `workspace` | `string` | No | Only events whose `workspace` extension is this. |
| `subject` | `string` | No | Only events with this `subject`. |
| `ref` | `string` | No | A reference, `type:id` such as `request:r_9`, or a type alone, such as `request`. Repeat `ref` for any of several. |
| `ext[name]` | `string` | No | An extension attribute’s value, such as `ext[severity]=warning`. The name matches `^[a-z0-9]{1,20}$`. A comma separates values: any of them matches. `true`, `false`, and numbers are read as themselves. |
| `where[path]` | `string` | No | The value at a data path, such as `where[assignee.id]=u_ana`. The path matches `^[A-Za-z0-9_$-]+(?:\.[A-Za-z0-9_$-]+)*$`, up to 10 paths. A comma separates values: any of them matches. `true`, `false`, and numbers are read as themselves. |

### Response

`200 OK`, with no body.

### Errors

-   [`invalid_request`](/docs/eventwolf/errors.md#invalid_request) (400)
-   [`query_timeout`](/docs/eventwolf/errors.md#query_timeout) (408)
-   [`invalid_filter`](/docs/eventwolf/errors.md#invalid_filter) (400)

Any operation can also answer with the codes [Conventions](/docs/eventwolf/reference.md#conventions) lists.

```bash tab="curl"
curl 'https://api.agentpost.tools/v1/events/events/stream?types=request.*' \
  -H "Authorization: Bearer sk_test_…"
```

```text title="Response"
200 OK
```

## Get an event

`GET /events/:sequence`

One event by its sequence.

-   **Who may call:** Your server, with your project’s secret key.
-   **Credential:** the examples send your project’s `dev` secret key, `sk_test_…`, as `Authorization: Bearer <token>`.

### Path parameters

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `sequence` | `string` | Yes | An event’s sequence, such as `42`. The `sequence` of a [`EventRecord`](/docs/eventwolf/reference/events.md#the-eventrecord-object). |

### Response

`200 OK`, with:

| Name | Type | Present | Description |
| --- | --- | --- | --- |
| `event` | [`EventRecord`](/docs/eventwolf/reference/events.md#the-eventrecord-object) | Always |  |

### Errors

-   [`not_found`](/docs/eventwolf/errors.md#not_found) (404)
-   [`invalid_request`](/docs/eventwolf/errors.md#invalid_request) (400)

Any operation can also answer with the codes [Conventions](/docs/eventwolf/reference.md#conventions) lists.

```bash tab="curl"
curl https://api.agentpost.tools/v1/events/events/42 \
  -H "Authorization: Bearer sk_test_…"
```

```json title="Response"
{
  "event": {
    "sequence": 42,
    "receivedAt": "2026-11-12T09:41:07.000Z",
    "publishedBy": {
      "actor": {
        "id": "key:backend"
      },
      "via": "host"
    },
    "refs": [
      {
        "type": "request",
        "id": "r_9",
        "role": "ref"
      },
      {
        "type": "user",
        "id": "u_ana",
        "role": "ref"
      },
      {
        "type": "user",
        "id": "u_ben",
        "role": "actor"
      }
    ],
    "typeVersion": 1,
    "event": {
      "specversion": "1.0",
      "id": "01JD4Z3XK6R0V8C2YQ7M5N9P1T",
      "source": "/support/backend",
      "type": "request.assigned",
      "subject": "r_9",
      "time": "2026-11-12T09:41:06.512Z",
      "datacontenttype": "application/json",
      "actor": "user:u_ben",
      "refs": "request:r_9 user:u_ana",
      "severity": "normal",
      "data": {
        "summary": "Ben assigned “Refund for order 1042” to you",
        "assignee": {
          "id": "u_ana"
        }
      },
      "sequence": 42
    }
  }
}
```

## Get an event timeline

`GET /events/:sequence/timeline`

One event with what caused it and what it caused, through `causationid`, and what EventWolf did with it: its matches, deliveries with each attempt in brief, and notifications.

-   **Who may call:** Your server, with your project’s secret key.
-   **Credential:** the examples send your project’s `dev` secret key, `sk_test_…`, as `Authorization: Bearer <token>`.

### Path parameters

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `sequence` | `string` | Yes | An event’s sequence, such as `42`. The `sequence` of a [`EventRecord`](/docs/eventwolf/reference/events.md#the-eventrecord-object). |

### Response

`200 OK`, with [`TimelineRecord`](/docs/eventwolf/reference/events.md#the-timelinerecord-object).

### Errors

-   [`not_found`](/docs/eventwolf/errors.md#not_found) (404)
-   [`query_timeout`](/docs/eventwolf/errors.md#query_timeout) (408)
-   [`invalid_request`](/docs/eventwolf/errors.md#invalid_request) (400)

Any operation can also answer with the codes [Conventions](/docs/eventwolf/reference.md#conventions) lists.

```bash tab="curl"
curl https://api.agentpost.tools/v1/events/events/57/timeline \
  -H "Authorization: Bearer sk_test_…"
```

```json title="Response"
{
  "event": {
    "sequence": 57,
    "receivedAt": "2026-11-12T16:20:31.000Z",
    "publishedBy": {
      "actor": {
        "id": "key:backend"
      },
      "via": "host"
    },
    "refs": [
      {
        "type": "request",
        "id": "r_9",
        "role": "ref"
      },
      {
        "type": "user",
        "id": "u_ana",
        "role": "actor"
      }
    ],
    "event": {
      "specversion": "1.0",
      "id": "01JD5KQ2W8E1G3H4J5K6M7N8P9",
      "source": "/support/backend",
      "type": "request.resolved",
      "subject": "r_9",
      "time": "2026-11-12T16:20:30.884Z",
      "datacontenttype": "application/json",
      "actor": "user:u_ana",
      "refs": "request:r_9",
      "data": {
        "resolution": "refunded"
      },
      "sequence": 57
    }
  },
  "causes": [],
  "effects": [],
  "matches": [
    {
      "id": "mat_01M77MA4BADJB617FSKAKFB062",
      "eventSequence": 57,
      "subscriptionId": "sub_01M78RJ7EYFM9WGJ5F35VT6GM7",
      "subscriptionVersion": 1,
      "cause": "ingest",
      "decidedAt": "2026-11-12T16:20:31.000Z"
    }
  ],
  "deliveries": [
    {
      "id": "dlv_01M784Y1DPQHMAWEB637FMPYWZ",
      "kind": "webhook",
      "eventSequence": 57,
      "matchId": "mat_01M77MA4BADJB617FSKAKFB062",
      "subscriptionId": "sub_01M78RJ7EYFM9WGJ5F35VT6GM7",
      "endpointId": "end_01M7A4A7MV7ACEEPN21HTHJE6Y",
      "status": "succeeded",
      "attempts": [
        {
          "id": "att_01M79H5NGPEGZF2FB3WE90H645",
          "n": 1,
          "trigger": "automatic",
          "outcome": "failed",
          "startedAt": "2026-11-12T16:20:31.000Z",
          "duration": "212ms",
          "status": 503
        },
        {
          "id": "att_01M78DATBYZV18RDVFT6Z5EKWR",
          "n": 2,
          "trigger": "automatic",
          "outcome": "succeeded",
          "startedAt": "2026-11-12T16:20:36.000Z",
          "duration": "148ms",
          "status": 200
        }
      ],
      "createdAt": "2026-11-12T16:20:31.000Z",
      "finishedAt": "2026-11-12T16:20:37.000Z"
    }
  ],
  "notifications": []
}
```

## Erase event fields

`POST /events/:sequence/erase`

Removes named personal fields, their parsed references, and frozen notification and push text, and records the erasure atomically. Each notification the event made keeps its record with `erasedAt` and no title, body, or URL, and a push not yet sent is skipped with `event_erased`. Answers with only the erasure record, with no event values. Repeating paths is safe. Event records expose cumulative erased paths.

-   **Who may call:** Your server, with your project’s secret key.
-   **Credential:** the examples send your project’s `dev` secret key, `sk_test_…`, as `Authorization: Bearer <token>`.
-   **Idempotency-Key:** optional. [Retrying a write](/docs/platform/api-basics.md#retrying-a-write) has the rule.

### Path parameters

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `sequence` | `string` | Yes | An event’s sequence, such as `42`. The `sequence` of a [`EventRecord`](/docs/eventwolf/reference/events.md#the-eventrecord-object). |

### Body

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `paths` | `string[]` | Yes | Fields on the public event, such as data.customer.email, subject, actor, refs, or summary. Dotted data keys follow filter syntax, up to 64 segments; **proto**, prototype, and constructor are refused. Object fields are removed; erased array slots become null. No values belong in this request; 1–100 items. |

### Response

`200 OK`, with:

| Name | Type | Present | Description |
| --- | --- | --- | --- |
| `erasure` | [`ErasureRecord`](/docs/eventwolf/reference/events.md#the-erasurerecord-object) | Always |  |

### Errors

-   [`not_found`](/docs/eventwolf/errors.md#not_found) (404)
-   [`invalid_request`](/docs/eventwolf/errors.md#invalid_request) (400)
-   [`payload_too_large`](/docs/eventwolf/errors.md#payload_too_large) (413)

Any operation can also answer with the codes [Conventions](/docs/eventwolf/reference.md#conventions) lists.

```bash tab="curl"
curl -X POST https://api.agentpost.tools/v1/events/events/42/erase \
  -H "Authorization: Bearer sk_test_…" \
  -H "Content-Type: application/json" \
  -d '{
    "paths": [
      "actor",
      "data.assignee.id",
      "data.summary"
    ]
  }'
```

```json title="Response"
{
  "erasure": {
    "id": "ers_01M79Z4K8R2T6V0X3B5D7F9H1J",
    "eventSequence": 42,
    "paths": ["actor", "data.assignee.id", "data.summary"],
    "erasedAt": "2026-11-13T09:30:00.000Z",
    "requestedBy": {
      "actor": {
        "id": "key:backend"
      },
      "via": "host"
    }
  }
}
```

## List event erasures

`GET /events/:sequence/erasures`

The event’s erasure records, newest first, including after the event ages out of retention. Kept until project deletion; records hold paths, time, and caller, never erased values.

-   **Who may call:** Your server, with your project’s secret key.
-   **Credential:** the examples send your project’s `dev` secret key, `sk_test_…`, as `Authorization: Bearer <token>`.
-   **Pages:** `limit`, 1 to 200, default 50, with `next` and `after`. [Lists](/docs/platform/api-basics.md#lists) has the rule.

### Path parameters

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `sequence` | `string` | Yes | An event’s sequence, such as `42`. The `sequence` of a [`EventRecord`](/docs/eventwolf/reference/events.md#the-eventrecord-object). |

### Query parameters

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `after` | `string` | No |  |
| `limit` | `integer` | No | 1–200; default `50`. |

### Response

`200 OK`, with:

| Name | Type | Present | Description |
| --- | --- | --- | --- |
| `erasures` | [`ErasureRecord`](/docs/eventwolf/reference/events.md#the-erasurerecord-object) array | Always |  |
| `next` | `string` | When set |  |

### Errors

-   [`invalid_request`](/docs/eventwolf/errors.md#invalid_request) (400)
-   [`query_timeout`](/docs/eventwolf/errors.md#query_timeout) (408)

Any operation can also answer with the codes [Conventions](/docs/eventwolf/reference.md#conventions) lists.

```bash tab="curl"
curl https://api.agentpost.tools/v1/events/events/42/erasures \
  -H "Authorization: Bearer sk_test_…"
```

```json title="Response"
{
  "erasures": [
    {
      "id": "ers_01M79Z4K8R2T6V0X3B5D7F9H1J",
      "eventSequence": 42,
      "paths": ["actor", "data.assignee.id", "data.summary"],
      "erasedAt": "2026-11-13T09:30:00.000Z",
      "requestedBy": {
        "actor": {
          "id": "key:backend"
        },
        "via": "host"
      }
    }
  ]
}
```

## The PublishOutcome object

| Name | Type | Present | Description |
| --- | --- | --- | --- |
| `result` | `string` | Always | One of `"accepted"`, `"duplicate"`, or `"rejected"`. |
| `sequence` | `number` | When set | With `result: "accepted"` or `result: "duplicate"`. |
| `id` | `string` | When set |  |
| `source` | `string` | When set |  |
| `code` | `string` | When set | With `result: "rejected"`. One of `"invalid_envelope"`, `"unknown_type"`, `"invalid_data"`, `"data_too_large"`, or `"forbidden"`. |
| `issues` | `string[]` | When set | With `result: "rejected"`. |
| `failureId` | `string` | When set | With `result: "rejected"`. An ingestion failure ID, `ifl_…`. |

```json title="The PublishOutcome object"
{
  "result": "accepted",
  "sequence": 42,
  "id": "01JD4Z3XK6R0V8C2YQ7M5N9P1T",
  "source": "/support/backend"
}
```

## The ValidateResponse object

| Name | Type | Present | Description |
| --- | --- | --- | --- |
| `valid` | `boolean` | Always |  |
| `code` | `string` | When set | One of `"invalid_envelope"`, `"unknown_type"`, `"invalid_data"`, `"data_too_large"`, or `"forbidden"`. |
| `issues` | `string[]` | Always |  |

```json title="The ValidateResponse object"
{
  "valid": true,
  "issues": []
}
```

## The EventRecord object

One accepted event, with EventWolf’s record context around it.

| Name | Type | Present | Description |
| --- | --- | --- | --- |
| `sequence` | `number` | Always | The project’s total order. Breaks receipt-time ties and resumes the live tail. |
| `receivedAt` | `string` | Always |  |
| `publishedBy` | `object` | Always | How a publisher is recorded beside the `source` it claimed. |
| `publishedBy.actor` | `object` | Always | The principal that made the request with its own credential. Your project’s secret key is `key:` and the key’s name, with no `kind`. |
| `publishedBy.actor.id` | `string` | Always | The principal’s ID. |
| `publishedBy.actor.kind` | `string` | When set | The kind a principal may declare. A principal that declared none has no `kind`. One of `"human"`, `"agent"`, or `"service"`. |
| `publishedBy.onBehalfOf` | `object` | When set | The delegator, when the actor acted under a delegation. |
| `publishedBy.onBehalfOf.id` | `string` | Always | The principal’s ID. |
| `publishedBy.onBehalfOf.kind` | `string` | When set | The kind a principal may declare. A principal that declared none has no `kind`. One of `"human"`, `"agent"`, or `"service"`. |
| `publishedBy.via` | `string` | Always | One of `"host"`, `"in_process"`, or `"import"`. |
| `refs` | `object[]` | Always |  |
| `refs[].type` | `string` | Always |  |
| `refs[].id` | `string` | Always |  |
| `refs[].role` | `string` | Always | The envelope attribute the reference came from. One read from a `refPaths` data path is `ref`. One of `"subject"`, `"actor"`, `"onbehalfof"`, or `"ref"`. |
| `refs[].path` | `string` | When set | The data path a registry `refPaths` entry named, when that’s where it came from. |
| `typeVersion` | `number` | When set |  |
| `erased` | `object` | When set | Removed fields, including requested paths that were already absent. |
| `erased.paths` | `string[]` | Always |  |
| `erased.lastErasedAt` | `string` | Always |  |
| `imported` | `object` | When set | Present only on history imported from another system. |
| `imported.batchId` | `string` | Always |  |
| `imported.origin` | `string` | Always |  |
| `imported.originalReceivedAt` | `string` | When set |  |
| `event` | `object` | Always | The event after any erasures, with `sequence` added as an extension. |
| `event.specversion` | `"1.0"` | Always |  |
| `event.id` | `string` | Always |  |
| `event.source` | `string` | Always |  |
| `event.type` | `string` | Always |  |
| `event.subject` | `string` | When set |  |
| `event.time` | `string` | Always |  |
| `event.datacontenttype` | `"application/json"` | Always |  |
| `event.dataschema` | `string` | When set |  |
| `event.data` | `any` | When set |  |
| `event.sequence` | `number` | Always |  |

```json title="The EventRecord object"
{
  "sequence": 42,
  "receivedAt": "2026-11-12T09:41:07.000Z",
  "publishedBy": {
    "actor": {
      "id": "key:backend"
    },
    "via": "host"
  },
  "refs": [
    {
      "type": "request",
      "id": "r_9",
      "role": "ref"
    },
    {
      "type": "user",
      "id": "u_ana",
      "role": "ref"
    },
    {
      "type": "user",
      "id": "u_ben",
      "role": "actor"
    }
  ],
  "typeVersion": 1,
  "event": {
    "specversion": "1.0",
    "id": "01JD4Z3XK6R0V8C2YQ7M5N9P1T",
    "source": "/support/backend",
    "type": "request.assigned",
    "subject": "r_9",
    "time": "2026-11-12T09:41:06.512Z",
    "datacontenttype": "application/json",
    "actor": "user:u_ben",
    "refs": "request:r_9 user:u_ana",
    "severity": "normal",
    "data": {
      "summary": "Ben assigned “Refund for order 1042” to you",
      "assignee": {
        "id": "u_ana"
      }
    },
    "sequence": 42
  }
}
```

## The TimelineRecord object

| Name | Type | Present | Description |
| --- | --- | --- | --- |
| `event` | [`EventRecord`](/docs/eventwolf/reference/events.md#the-eventrecord-object) | Always |  |
| `causes` | [`EventRecord`](/docs/eventwolf/reference/events.md#the-eventrecord-object) array | Always | The causation chain upward, nearest cause first, at most 20 deep. |
| `effects` | [`EventRecord`](/docs/eventwolf/reference/events.md#the-eventrecord-object) array | Always | Events whose causation points at this one, in sequence order, at most 100. |
| `matches` | [`MatchRecord`](/docs/eventwolf/reference/subscriptions.md#the-matchrecord-object) array | When set | Present when the caller may manage deliveries. |
| `deliveries` | `object[]` | When set | Present when the caller may manage deliveries. |
| `deliveries[].id` | `string` | Always | Also the `webhook-id` header on every attempt of a webhook. |
| `deliveries[].kind` | `"webhook"` or `"push"` | Always | What a delivery sends: a signed webhook to an endpoint, or a push to one of a recipient’s devices. |
| `deliveries[].eventSequence` | `number` | Always |  |
| `deliveries[].matchId` | `string` | When set | Absent for an endpoint’s test ping, which has no subscription. |
| `deliveries[].subscriptionId` | `string` | When set | A subscription ID, `sub_…`. |
| `deliveries[].endpointId` | `string` | When set | A webhook’s endpoint. |
| `deliveries[].notificationId` | `string` | When set | A push’s notification, whose text and `url` it carries. |
| `deliveries[].pushAddressId` | `string` | When set | A push’s address: one device of the notification’s recipient. |
| `deliveries[].status` | `string` | Always | A push stays `pending` after it is sent until the provider reports whether it reached the device. One of `"pending"`, `"succeeded"`, `"failed"`, `"skipped"`, or `"canceled"`. |
| `deliveries[].skipReason` | `string` | When set | Why a delivery was skipped: the endpoint was disabled, the event is about that endpoint, the push address was invalid, or the event was erased before the push was sent. One of `"endpoint_disabled"`, `"about_endpoint"`, `"address_invalid"`, or `"event_erased"`. |
| `deliveries[].nextAttemptAt` | `string` | When set |  |
| `deliveries[].createdAt` | `string` | Always |  |
| `deliveries[].finishedAt` | `string` | When set |  |
| `deliveries[].attempts` | `object[]` | Always |  |
| `deliveries[].attempts[].id` | `string` | Always | An attempt ID, `att_…`. |
| `deliveries[].attempts[].n` | `number` | Always |  |
| `deliveries[].attempts[].trigger` | `string` | Always | One of `"automatic"`, `"manual"`, `"recover"`, or `"replay"`. |
| `deliveries[].attempts[].outcome` | `"succeeded"` or `"failed"` | Always |  |
| `deliveries[].attempts[].startedAt` | `string` | Always |  |
| `deliveries[].attempts[].duration` | `string` | Always | How long the attempt took, such as `"240ms"`. |
| `deliveries[].attempts[].status` | `number` | When set | The HTTP status the receiver answered, when it answered. |
| `deliveries[].attempts[].error` | `string` | When set | Why there was no answer, or why the answer did not count. One of `"timeout"`, `"dns"`, `"connection"`, `"tls"`, `"redirect"`, `"ssrf_blocked"`, `"push_send_failed"`, `"push_delivery_failed"`, or `"device_not_registered"`. |
| `notifications` | [`NotificationRecord`](/docs/eventwolf/reference/inbox.md#the-notificationrecord-object) array | When set | Present when the caller may manage recipients: every notification the event made, skipped ones included, at most 500. |

```json title="The TimelineRecord object"
{
  "event": {
    "sequence": 57,
    "receivedAt": "2026-11-12T16:20:31.000Z",
    "publishedBy": {
      "actor": {
        "id": "key:backend"
      },
      "via": "host"
    },
    "refs": [
      {
        "type": "request",
        "id": "r_9",
        "role": "ref"
      },
      {
        "type": "user",
        "id": "u_ana",
        "role": "actor"
      }
    ],
    "event": {
      "specversion": "1.0",
      "id": "01JD5KQ2W8E1G3H4J5K6M7N8P9",
      "source": "/support/backend",
      "type": "request.resolved",
      "subject": "r_9",
      "time": "2026-11-12T16:20:30.884Z",
      "datacontenttype": "application/json",
      "actor": "user:u_ana",
      "refs": "request:r_9",
      "data": {
        "resolution": "refunded"
      },
      "sequence": 57
    }
  },
  "causes": [],
  "effects": [],
  "matches": [
    {
      "id": "mat_01M77MA4BADJB617FSKAKFB062",
      "eventSequence": 57,
      "subscriptionId": "sub_01M78RJ7EYFM9WGJ5F35VT6GM7",
      "subscriptionVersion": 1,
      "cause": "ingest",
      "decidedAt": "2026-11-12T16:20:31.000Z"
    }
  ],
  "deliveries": [
    {
      "id": "dlv_01M784Y1DPQHMAWEB637FMPYWZ",
      "kind": "webhook",
      "eventSequence": 57,
      "matchId": "mat_01M77MA4BADJB617FSKAKFB062",
      "subscriptionId": "sub_01M78RJ7EYFM9WGJ5F35VT6GM7",
      "endpointId": "end_01M7A4A7MV7ACEEPN21HTHJE6Y",
      "status": "succeeded",
      "attempts": [
        {
          "id": "att_01M79H5NGPEGZF2FB3WE90H645",
          "n": 1,
          "trigger": "automatic",
          "outcome": "failed",
          "startedAt": "2026-11-12T16:20:31.000Z",
          "duration": "212ms",
          "status": 503
        },
        {
          "id": "att_01M78DATBYZV18RDVFT6Z5EKWR",
          "n": 2,
          "trigger": "automatic",
          "outcome": "succeeded",
          "startedAt": "2026-11-12T16:20:36.000Z",
          "duration": "148ms",
          "status": 200
        }
      ],
      "createdAt": "2026-11-12T16:20:31.000Z",
      "finishedAt": "2026-11-12T16:20:37.000Z"
    }
  ],
  "notifications": []
}
```

## The ErasureRecord object

One completed request, including paths that were already absent. No erased values.

| Name | Type | Present | Description |
| --- | --- | --- | --- |
| `id` | `string` | Always | An erasure ID, `ers_…`. |
| `eventSequence` | `number` | Always |  |
| `paths` | `string[]` | Always |  |
| `erasedAt` | `string` | Always |  |
| `requestedBy` | `object` | Always | How a publisher is recorded beside the `source` it claimed. |
| `requestedBy.actor` | `object` | Always | The principal that made the request with its own credential. Your project’s secret key is `key:` and the key’s name, with no `kind`. |
| `requestedBy.actor.id` | `string` | Always | The principal’s ID. |
| `requestedBy.actor.kind` | `string` | When set | The kind a principal may declare. A principal that declared none has no `kind`. One of `"human"`, `"agent"`, or `"service"`. |
| `requestedBy.onBehalfOf` | `object` | When set | The delegator, when the actor acted under a delegation. |
| `requestedBy.onBehalfOf.id` | `string` | Always | The principal’s ID. |
| `requestedBy.onBehalfOf.kind` | `string` | When set | The kind a principal may declare. A principal that declared none has no `kind`. One of `"human"`, `"agent"`, or `"service"`. |
| `requestedBy.via` | `string` | Always | One of `"host"`, `"in_process"`, or `"import"`. |

```json title="The ErasureRecord object"
{
  "id": "ers_01M79Z4K8R2T6V0X3B5D7F9H1J",
  "eventSequence": 42,
  "paths": ["actor", "data.assignee.id", "data.summary"],
  "erasedAt": "2026-11-13T09:30:00.000Z",
  "requestedBy": {
    "actor": {
      "id": "key:backend"
    },
    "via": "host"
  }
}
```
