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
devsecret key,sk_test_…, asAuthorization: Bearer <token>. - Pages:
limit, 1 to 200, default 50, withnextandafter. 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
invalid_request(400)
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
devsecret key,sk_test_…, asAuthorization: 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
not_found(404)
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
devsecret key,sk_test_…, asAuthorization: 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. |
string |
Yes | 1–100 characters. |
status |
"active" or "deprecated" |
No |
Response
200 OK, with:
| Name | Type | Present | Description |
|---|---|---|---|
eventType |
EventTypeRecord |
Always |
Errors
invalid_request(400)stale_version(409)payload_too_large(413)
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
devsecret key,sk_test_…, asAuthorization: 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[]. |
any |
No |
Response
200 OK, with EventTypeValidateResponse.
Errors
invalid_request(400)payload_too_large(413)
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
devsecret key,sk_test_…, asAuthorization: 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
not_found(404)
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. |
string |
Always | |
schema |
object |
When set | |
schema. |
number |
Always | |
schema. |
object |
Always | |
versions |
object[] |
Always | |
versions[]. |
number |
Always | |
versions[]. |
object |
Always | |
versions[]. |
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. |
string |
Always | One of "request" or "registered". |
schema. |
number |
When set | With from: "registered". |
items |
object[] |
Always | One result per item, in the order given. |
items[]. |
boolean |
Always | |
items[]. |
string[] |
Always |