Skip to content
Agentpost robot in sunglasses on a red circleAgentpost

Inbox

Manage notifications in the inbox your credential names. List and count them, mark them read, seen, or archived, set inbox preferences, and receive new notifications live.

For what an inbox shows, who may read it, and which inbox a delegated token reaches, read Notifications.

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

GET /inbox

Your delivered notifications, newest first.

  • Who may call: A signed-in caller can use a user token, an IdentityHound session token, an IdentityHound API key, or an IdentityHound delegated token to reach the inbox that credential names.
  • Credential: the examples send a signed-in principal’s user token, ut_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
unread "true" or "false" No
archived "true" or "false" No
topic string No
after string No
limit integer No 1–200; default 50.

Response

200 OK, with:

Name Type Present Description
notifications NotificationRecord array Always
next string When set

Errors

Any operation can also answer with the codes Conventions lists.

Count your notifications

GET /inbox/count

How many inbox notifications are unread, and how many are newer than the last one you saw. Phone badges keep separate seen positions.

  • Who may call: A signed-in caller can use a user token, an IdentityHound session token, an IdentityHound API key, or an IdentityHound delegated token to reach the inbox that credential names.
  • Credential: the examples send a signed-in principal’s user token, ut_test_…, as Authorization: Bearer <token>.

Response

200 OK, with InboxCount.

Errors

Only the codes any operation can answer with, which Conventions lists.

Mark all read

POST /inbox/read-all

Marks every unread notification read, or one topic’s.

  • Who may call: A signed-in caller can use a user token, an IdentityHound session token, an IdentityHound API key, or an IdentityHound delegated token to reach the inbox that credential names.
  • Credential: the examples send a signed-in principal’s user token, ut_test_…, as Authorization: Bearer <token>.
  • Idempotency-Key: optional. Retrying a write has the rule.

Body

The body is optional.

Name Type Required Description
topic string No

Response

200 OK, with ReadAllResponse.

Errors

Any operation can also answer with the codes Conventions lists.

Mark seen

POST /inbox/seen

Marks everything through one notification seen in the inbox. Leaves phone badges alone. A position older than the one stored changes nothing.

  • Who may call: A signed-in caller can use a user token, an IdentityHound session token, an IdentityHound API key, or an IdentityHound delegated token to reach the inbox that credential names.
  • Credential: the examples send a signed-in principal’s user token, ut_test_…, as Authorization: Bearer <token>.
  • Idempotency-Key: optional. Retrying a write has the rule.

Body

Name Type Required Description
through string Yes 1–100 characters.

Response

200 OK, with SeenResponse.

Errors

Any operation can also answer with the codes Conventions lists.

Mark a notification read

POST /inbox/:id/read

Marks one notification read.

  • Who may call: A signed-in caller can use a user token, an IdentityHound session token, an IdentityHound API key, or an IdentityHound delegated token to reach the inbox that credential names.
  • Credential: the examples send a signed-in principal’s user token, ut_test_…, as Authorization: Bearer <token>.
  • Idempotency-Key: optional. Retrying a write has the rule.

Path parameters

Name Type Required Description
id string Yes A notification ID, ntf_…. The id of a NotificationRecord.

Response

200 OK, with:

Name Type Present Description
notification NotificationRecord Always

Errors

Any operation can also answer with the codes Conventions lists.

Archive a notification

POST /inbox/:id/archive

Archives one notification. GET /inbox?archived=true lists archived ones.

  • Who may call: A signed-in caller can use a user token, an IdentityHound session token, an IdentityHound API key, or an IdentityHound delegated token to reach the inbox that credential names.
  • Credential: the examples send a signed-in principal’s user token, ut_test_…, as Authorization: Bearer <token>.
  • Idempotency-Key: optional. Retrying a write has the rule.

Path parameters

Name Type Required Description
id string Yes A notification ID, ntf_…. The id of a NotificationRecord.

Response

200 OK, with:

Name Type Present Description
notification NotificationRecord Always

Errors

Any operation can also answer with the codes Conventions lists.

Get your preferences

GET /inbox/preferences

Your preferences for every topic. A required topic is shown with required: true, and setting it changes nothing.

  • Who may call: A signed-in caller can use a user token, an IdentityHound session token, an IdentityHound API key, or an IdentityHound delegated token to reach the inbox that credential names.
  • Credential: the examples send a signed-in principal’s user token, ut_test_…, as Authorization: Bearer <token>.

Response

200 OK, with:

Name Type Present Description
topics TopicPreference array Always

Errors

Only the codes any operation can answer with, which Conventions lists.

Set your preferences

PUT /inbox/preferences

Sets your preferences for the topics given; topics you leave out keep theirs, and null goes back to the topic’s default. A preference for a required topic is kept, and changes nothing while the topic is required.

  • Who may call: A signed-in caller can use a user token, an IdentityHound session token, an IdentityHound API key, or an IdentityHound delegated token to reach the inbox that credential names.
  • Credential: the examples send a signed-in principal’s user token, ut_test_…, as Authorization: Bearer <token>.
  • Idempotency-Key: optional. Retrying a write has the rule.

Body

Name Type Required Description
topics object Yes
topics.{key}.inbox boolean or null No
topics.{key}.push boolean or null No

Response

200 OK, with:

Name Type Present Description
topics TopicPreference array Always

Errors

Any operation can also answer with the codes Conventions lists.

Stream your notifications

GET /inbox/stream

Server-Sent Events: each new notification as a NotificationRecord whose message id is its ID, and a heartbeat message with your InboxCount. The stream sends a message with only an id after any catch-up, and each heartbeat has an id too. These IDs are cursors in digits that mark how far the stream has read. Reconnect with the last id you received as Last-Event-ID, or after for a client that can’t set it, to resume from that point within the retained history. Your credential is checked again at each heartbeat, and once it stops working the stream ends with an error message: unauthenticated when your user token expired, so reconnect with a fresh one, or forbidden when access was withdrawn. Notification retention explains how the stream handles removed notifications.

  • Who may call: A signed-in caller can use a user token, an IdentityHound session token, an IdentityHound API key, or an IdentityHound delegated token to reach the inbox that credential names.
  • Credential: the examples send a signed-in principal’s user token, ut_test_…, as Authorization: Bearer <token>.
  • Last-Event-ID: Optional. The last message id you received: a notification ID or a cursor.

Query parameters

Name Type Required Description
after string No The last message id you received, a notification ID or a cursor, for a client that can’t set Last-Event-ID.

Response

200 OK, with no body.

Errors

Any operation can also answer with the codes Conventions lists.

The NotificationRecord object

One notification: rendered, with a title, or erased, with erasedAt and no text.

Name Type Present Description
id string Always A notification ID, ntf_….
recipientId string Always
topic string Always
status "delivered" or "skipped" Always skipped notifications are recorded, never shown in an inbox.
skipReason "preference_off" When set
eventSequence number Always
subscriptionId string Always A subscription ID, sub_….
readAt string When set
archivedAt string When set
createdAt string Always
title string When set Present on every notification but an erased one, which has none.
body string When set
url string When set
erasedAt string When set When the notification’s event was erased. Present only on an erased notification, which has no title, body, or url.

The InboxCount object

What is waiting in an inbox, archived notifications left out.

Name Type Present Description
unread number Always
unseen number Always Newer than the recipient’s inbox seen position. Phone badges have their own positions.

The ReadAllResponse object

Name Type Present Description
read number Always Notifications marked read by this call.