IdentityHound API reference
Every operation IdentityHound serves, generated from its contract, so these pages match the API. Every request follows the API basics. Start with the IdentityHound quickstart if you are new, and use the SDK from TypeScript.
For tools that read OpenAPI, /docs/identityhound/openapi.json describes every operation here as OpenAPI 3.1, with its credentials, schemas, examples, and error codes.
Who may call
Each operation names who may call it. Platform credentials explains each credential.
- Anyone needs no IdentityHound credential, but the request still names your project: your server sends the secret key, and a browser or a native app sends the publishable key. A publishable key reaches only the five sign-in operations that start a session (
POST /auth/email-code,POST /auth/email-code/verify,POST /auth/oauth/:providerKey/start,POST /auth/oauth/:providerKey/callback, andPOST /auth/guest) andPOST /invitations/preview, which lets a page show an invitation before the principal signs in. - A signed-in principal uses a session token, a user token, an API key, or a delegated token. IdentityHound checks its permissions.
- Your server is the project’s secret key, which is trusted.
Retrying a write
Retrying a write has the rule every API follows. IdentityHound adds two rules of its own. A refusal is a write’s answer too: it is kept and replayed with its Idempotency-Key for 24 hours, like a success. A refusal of the request, the caller, or the moment, such as invalid_request, forbidden, or conflict, is never replayed, and neither is throttled, guest_limit, provider_error, trusted_caller_required, or secret_key_invalid: a retry runs again.
A caller that is neither signed in nor your server, such as a browser with the publishable key, is known only by its IP address, which others may share. So IdentityHound saves no answer that holds a credential for such a caller: a retry of a sign-in, such as Verify a sign-in code, runs again.
Conventions
What this API sets for every operation in this reference. API basics has the rules themselves, and its table compares the APIs.
- Base URL: every path here starts with
https://api.agentpost.tools/v1/identity. - Idempotency: Every write (
POST,PUT,PATCH,DELETE) takesIdempotency-Key, except Validate a config, Introspect a token, Preview an invitation, Check an entitlement, Check access, and Check access in a batch, whose entries say why. A key’s first answer is kept for 24 hours. One operation adds its own rule, which its entry states: Create a grant. It is required on Create a grant. Retrying a write has the rule, with the codesidempotency_mismatchandconflictit answers with. - Lists: Every list takes
limit, 1 to 500, default 100. List workspaces, List members, List invitations, List resource roles, and List grants page withnextandafter. Read the change feed is a feed. List principals and List delegations answer with no cursor. Lists has the rule. - IDs: each ID starts with its kind’s prefix, as IDs lists.
- Errors: An error’s
docslink goes to its code’s entry on IdentityHound errors. Any operation can answer withinvalid_request,payload_too_large,unauthenticated, orinternal_error; each operation lists the other codes it can answer with. Errors describes the body.
IDs
| Kind | Looks like |
|---|---|
| Principal | prn_… |
| Identity | idn_… |
| Connection | con_… |
| Verification | ver_… |
| Session | ses_… |
| API key | key_… |
| Workspace | wsp_… |
| Membership | mem_… |
| Invitation | inv_… |
| Resource role | rro_… |
| Delegation | dlg_… |
| Grant | grt_… |
Resources
Each resource has its own page, with its operations, their examples, and the objects they answer with.
| Resource | What it holds |
|---|---|
| Config | The project’s one versioned config: resource types and their actions, roles, entitlements, sign-in and sign-up, providers, and URLs. |
| Sign-in | Emailed codes, OAuth providers, guests, sign-out, and introspection. The session-start operations, and an invitation’s preview, are the only ones a publishable key reaches. |
| The signed-in principal | The caller’s own profile, sign-in identities, and sessions. Of these, a delegated token reaches only GET /me and sign-out: a delegate acting for a principal never reaches the principal’s account. Elsewhere it acts within its delegation, such as in POST /access/check and GET /access/permissions. |
| Principals | Principals and their sign-in methods. A principal may declare a kind, human, agent, or service, as a label it can change at any time. Roles, grants, and invitations treat every kind alike. |
| API keys | A signed-in principal’s own credential. A key may be restricted to workspaces and permissions, which caps what it can do. |
| Connected accounts | A principal’s accounts at OAuth providers, such as Twitch, held so a trusted caller or a delegate can act for it there. Connect one with auth.oauthStart and purpose: connect. |
| Workspaces | Flat groups of principals, such as a team or a customer. The principal who creates one is its owner, and a workspace always keeps an owner. |
| Members | A workspace’s memberships and their roles. |
| Invitations | Invitations into a workspace, by email or by a code you pass on yourself. A principal previews an invitation, then accepts it. |
| Project roles | Roles a principal holds across the project. Only your server assigns or removes them. Read them in the principal’s projectRoles. |
| Resource roles | A role on one resource, such as editor of one report, held by a principal, by every principal that is not a guest, or by every guest. |
| Bundles | Named sets of entitlements, such as a plan, granted together. |
| Grants | What a principal, a workspace, every principal that is not a guest, or every guest has been given: a bundle, or one entitlement. |
| Entitlements | Whether a principal holds an entitlement, through any grant to it, its workspace, or every principal that is not a guest (every guest, for a guest). |
| Delegations | Permission for one principal to act for another, within listed permissions, a workspace, and an expiry. The delegate exchanges its API key or session for short-lived delegated tokens, and every check and event keeps both identities. |
| Access checks | One decision for “may this principal do this to that resource?”, with a reason an app or an agent can act on. Every answer names its config version. |
| 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. |