Topics
What notifications are about, such as assignments: each topic’s name, whether it reaches each channel by default, and whether it is required.
Notifications explains topics, recipients, preferences, and the inbox.
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.
Create or update a topic
PUT /topics/:key
Creates a topic, or replaces what it says.
- 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 |
|---|---|---|---|
key |
string |
Yes | A topic key, such as assignments. The key of a TopicRecord. |
Body
| Name | Type | Required | Description |
|---|---|---|---|
name |
string |
No | 1–200 characters. |
description |
string |
No | Up to 2000 characters. |
defaults |
object |
Yes | |
defaults. |
boolean |
Yes | |
defaults. |
boolean |
Yes | |
required |
boolean |
Yes |
Response
200 OK, with:
| Name | Type | Present | Description |
|---|---|---|---|
topic |
TopicRecord |
Always |
Errors
invalid_request(400)payload_too_large(413)
Any operation can also answer with the codes Conventions lists.
List topics
GET /topics
Topics, by key.
- 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 |
|---|---|---|---|
after |
string |
No | |
limit |
integer |
No | 1–200; default 50. |
Response
200 OK, with:
| Name | Type | Present | Description |
|---|---|---|---|
topics |
TopicRecord array |
Always | |
next |
string |
When set |
Errors
invalid_request(400)
Any operation can also answer with the codes Conventions lists.
Get a topic
GET /topics/:key
One topic.
- 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 |
|---|---|---|---|
key |
string |
Yes | A topic key, such as assignments. The key of a TopicRecord. |
Response
200 OK, with:
| Name | Type | Present | Description |
|---|---|---|---|
topic |
TopicRecord |
Always |
Errors
not_found(404)
Any operation can also answer with the codes Conventions lists.
Delete a topic
DELETE /topics/:key
Deletes a topic. A subscription that still notifies on it answers conflict: change it first.
- 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 |
|---|---|---|---|
key |
string |
Yes | A topic key, such as assignments. The key of a TopicRecord. |
Response
204 No Content, with no body.
Errors
Any operation can also answer with the codes Conventions lists.
The TopicRecord object
| Name | Type | Present | Description |
|---|---|---|---|
key |
string |
Always | |
name |
string |
Always | |
description |
string |
When set | |
defaults |
object |
Always | Each value is a boolean. |
required |
boolean |
Always | |
createdAt |
string |
Always | |
updatedAt |
string |
Always |