Skip to content
Agentpost robot in sunglasses on a red circleAgentpost

Change feed

Read IdentityHound’s retained changes after a cursor, in order, as CloudEvents. Each event keeps who acted and for whom. Change feed retention explains how long the feed keeps changes and what happens when they expire.

Change feed explains what each event records and the feed’s guarantees. Sync records with the change feed processes pages and saves a cursor for the next run.

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

Read the change feed

GET /events

Events after a cursor, and the next cursor.

  • Who may call: Your server.
  • Credential: the examples send your project’s dev secret key, sk_test_…, as Authorization: Bearer <token>.
  • SDK: client.events.read(query)
  • Pages: limit, 1 to 500, default 100. A feed: every answer has next, to send as after. Lists has the rule.

Query parameters

Name Type Required Description
after integer or string or string No The seq to read after, or latest to start from now: no events, and next set to the newest seq. Start at 0, then pass each page’s next. Any integer or string, or "latest".
limit integer No The most events to answer with, from 1 to 500; 1–500; default 100.
types string No Full event types to keep, separated by commas. Without it, every type.

Response

200 OK, with EventsResponse.

Errors

Any operation can also answer with the codes Conventions lists.

The EventsResponse object

Name Type Present Description
events object[] Always
events[].id string Always A plain ULID, unique to the event.
events[].seq number Always The event’s place in the project’s feed, from 1. Pass it as after to read the events after it.
events[].specversion "1.0" Always
events[].type string Always The full type, tools.agentpost.identity.<event>.
events[].source "/identityhound" Always
events[].subject string When set The record the event is about.
events[].time string Always When the change was made.
events[].datacontenttype "application/json" Always
events[].data object Always
events[].data.context object Always Who made the change, and for whom.
events[].data.context.actor object Always Who made the request with its own credential: a principal’s ID, trusted_caller for your server’s secret key, or anonymous before sign-in.
events[].data.context.actor.id string Always A principal ID, prn_…, or one of "trusted_caller" or "anonymous".
events[].data.context.onBehalfOf object When set The delegator, when the actor acted under a delegation.
events[].data.context.onBehalfOf.id string Always A principal ID, prn_….
events[].data.context.delegationId string When set The delegation the actor acted under, with a delegated token.
events[].data.context.via string Always How the actor called: with a session, an API key, a delegated token, or your server’s secret key; system for IdentityHound’s own changes, such as an expiry sweep. One of "session", "api_key", "delegated_token", "trusted_caller", or "system".
events[].data.workspaceId string When set The workspace the change is in, when it is in one.
next number Always Pass as after to continue. Always present. A full page gives its last event’s seq. A shorter page has caught up, so it gives the newest seq read, past any events a types filter skipped; after=latest gives the newest seq.

Event types

GET /events returns these as CloudEvents. Each type is tools.agentpost.identity.<name>, and each event’s data.context says who acted and for whom.

  • principal.created
  • principal.imported
  • principal.updated
  • principal.suspended
  • principal.reactivated
  • principal.deleted
  • principal.upgraded
  • principal.merged
  • auth.code_requested
  • auth.signed_up
  • auth.signed_in
  • auth.signed_out
  • session.revoked
  • identity.linked
  • identity.removed
  • connection.created
  • connection.needs_reauth
  • connection.token_issued
  • connection.removed
  • api_key.created
  • api_key.rotated
  • api_key.revoked
  • workspace.created
  • workspace.updated
  • workspace.archived
  • membership.added
  • membership.role_changed
  • membership.suspended
  • membership.reactivated
  • membership.removed
  • invitation.created
  • invitation.accepted
  • invitation.revoked
  • invitation.expired
  • project_role.assigned
  • project_role.removed
  • resource_role.assigned
  • resource_role.removed
  • resource_role.expired
  • delegation.requested
  • delegation.approved
  • delegation.denied
  • delegation.revoked
  • delegation.expired
  • delegated_token.issued
  • bundle.created
  • bundle.updated
  • bundle.retired
  • grant.created
  • grant.revoked
  • grant.expired
  • access.denied
  • config.updated