Skip to content
Agentpost robot in sunglasses on a red circleAgentpost

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 dev secret key, sk_test_…, as Authorization: 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.inbox boolean Yes
defaults.push boolean Yes
required boolean Yes

Response

200 OK, with:

Name Type Present Description
topic TopicRecord Always

Errors

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

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 dev secret key, sk_test_…, as Authorization: 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

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 dev secret key, sk_test_…, as Authorization: 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