Skip to content
Agentpost robot in sunglasses on a red circleAgentpost

Event types

The registry of your event types: a description, a JSON Schema for data with its versions, the data paths that hold references, and the types EventWolf has seen that nobody registered.

Event types explains schemas, versions, reference paths, and observed types.

Paths are relative to https://api.agentpost.tools/v1/events, and every request follows the API basics. Who may call explains each kind of caller.

List event types

GET /event-types

Registered and observed types.

  • 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 has the rule.

Query parameters

Name Type Required Description
origin string No One of "registered" or "observed".
status "active" or "deprecated" No
after string No 1–500 characters.
limit integer No 1–200; default 50.

Response

200 OK, with:

Name Type Present Description
eventTypes EventTypeRecord array Always
next string When set

Errors

Any operation can also answer with the codes Conventions lists.

Get an event type

GET /event-types/:type

One type, with every version of its schema.

  • 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
type string Yes An event type, such as request.assigned. The type of a EventTypeRecord.

Response

200 OK, with:

Name Type Present Description
eventType EventTypeRecord Always

Errors

Any operation can also answer with the codes Conventions lists.

Register an event type

PUT /event-types/:type

Registers a type or updates it; a field you leave out keeps its value. A schema different from the current one becomes a new version, and events published after it must match it.

  • 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 has the rule.

Path parameters

Name Type Required Description
type string Yes An event type, such as request.assigned. The type of a EventTypeRecord.

Body

Name Type Required Description
description string or null No
schema object or null No
refPaths object or null No
refPaths.{key}.type string Yes 1–100 characters.
status "active" or "deprecated" No

Response

200 OK, with:

Name Type Present Description
eventType EventTypeRecord Always

Errors

Any operation can also answer with the codes Conventions lists.

Check a schema

POST /event-types/:type/validate

Checks 1 to 200 items against a schema and answers with one result per item in order. The check writes nothing. To check stored events, read them with GET /events and send one item per event, with its data if it has any.

  • 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.

Path parameters

Name Type Required Description
type string Yes An event type, such as request.assigned. The type of a EventTypeRecord.

Body

Name Type Required Description
schema object No
items object[] Yes 1–200 items.
items[].data any No

Response

200 OK, with EventTypeValidateResponse.

Errors

Any operation can also answer with the codes Conventions lists.

Deprecate an event type

POST /event-types/:type/deprecate

Marks a type deprecated. Its events are still accepted; the mark tells producers to move off it.

  • 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 has the rule.

Path parameters

Name Type Required Description
type string Yes An event type, such as request.assigned. The type of a EventTypeRecord.

Response

200 OK, with:

Name Type Present Description
eventType EventTypeRecord Always

Errors

Any operation can also answer with the codes Conventions lists.

The EventTypeRecord object

Name Type Present Description
type string Always
origin string Always observed: first seen in accept mode, with nothing registered. One of "registered" or "observed".
description string When set
refPaths object When set
refPaths.{key}.type string Always
schema object When set
schema.version number Always
schema.jsonSchema object Always
versions object[] Always
versions[].version number Always
versions[].jsonSchema object Always
versions[].createdAt string Always
status "active" or "deprecated" Always
firstSeenAt string When set
lastSeenAt string When set
createdAt string Always
updatedAt string Always
updatedBy string When set

The EventTypeValidateResponse object

Name Type Present Description
schema object Always Which schema the check used.
schema.from string Always One of "request" or "registered".
schema.version number When set With from: "registered".
items object[] Always One result per item, in the order given.
items[].valid boolean Always
items[].issues string[] Always