Skip to content
Agentpost robot in sunglasses on a red circleAgentpost

Agentpost API reference

Agentpost’s own API: signup, workspaces, projects, keys, sending domains, the test inbox, and user tokens. Every route follows the API basics, and the Platform guides walk through each task. Each service’s own operations are in its reference, such as IdentityHound’s. These pages are generated from the code that serves these routes, so they match the API.

For tools that read OpenAPI, /docs/platform/openapi.json describes every operation here as OpenAPI 3.1, with its credentials, schemas, examples, and error codes.

Signing in to Agentpost

Agentpost signs its own customers in with IdentityHound, at /v1/platform. Sign-in, principals, API keys, workspaces, members, invitations, and delegations work as IdentityHound’s reference describes, with /v1/platform in place of /v1/identity, and answer with IdentityHound’s errors. There, a principal is an agent or a human, and a workspace holds projects.

To issue another API key for yourself, send POST /v1/platform/principals/{id}/api-keys with your own API key or session. Create an API key gives the request body and response.

  • Credentials: a principal’s API key or session, or a delegate’s delegated token. A project’s keys and user tokens don’t reach /v1/platform.
  • Roles: Workspaces lists what each workspace role may do: an owner everything, an admin everything but deleting projects, archiving the workspace, and changing who the owners are, and a member views.

Conventions

What this API sets for every operation in this reference. API basics has the rules themselves, and its table compares the APIs.

  • Base path: /v1; signing in to Agentpost, its principals, workspaces, members, invitations, and delegations: /v1/platform.
  • Idempotency: No operation in this reference takes Idempotency-Key. Before you retry a write that may have succeeded, read the resource to see whether it did. Writes under /v1/platform are IdentityHound’s operations and follow its key rules.
  • Lists: Every list takes limit, 1 to 200. Read a workspace’s events is a feed. Lists has the rule.
  • IDs: each ID starts with its kind’s prefix, as IDs lists.
  • Errors: On the operations in this reference, an error’s docs link goes to its code’s entry on Agentpost errors. API basics explains which errors page /v1/platform links to. Any operation can answer with invalid_request, unauthenticated, secret_key_invalid, origin_not_allowed, not_ready, or internal_error; each operation lists the other codes it can answer with. Errors describes the body.

IDs

Kind Looks like
Principal prn_…
Workspace wsp_…
Project prj_…
Key key_…
Workspace key wkey_…
User token utk_…

Resources

Each resource has its own page, with its operations, their examples, and the objects they answer with.

Resource What it holds
Signup and workspaces A principal, an agent or a human, starts with one request: signup makes it a workspace it owns and its first API key. A principal that signed in with an emailed code creates a workspace through IdentityHound’s routes instead. A workspace holds its projects, keys, and members, each member with a role.
Projects A project is one product. It belongs to a workspace, adopts the services it uses, and has a dev and a prd environment with separate data.
Keys A project’s keys. A secret key, sk_test_… for dev or sk_live_… for prd, is for your server: it is shown once and stored as a hash. A publishable key, pk_test_… or pk_live_…, is for a browser or a native app: it is public, works only from the origins it lists or, when it allows native apps, with no origin, and reaches only a service’s sign-in operations. The workspace’s owners get an email whenever a key is issued or rotated, or its origins or native allowance change. A workspace key, wk_test_… or wk_live_…, belongs to a workspace rather than a project: it reads every project of the workspace in its environment, within the permissions it was issued with, and is shown once, stored as a hash, and rotated like a secret key.
Sending domain A project’s email, sign-in codes included, comes from a domain it verified; until one verifies, it sends none, except to a dev environment’s test inbox. Add the domain, then add the DNS records the answer lists. Agentpost checks every 5 minutes for the first hour, then hourly, for up to 72 hours, and emails the workspace’s owners when the domain verifies or fails. A domain belongs to the first workspace that adds it; if it fails to verify, another workspace may add it.
Test inbox In a dev environment, a project’s email to an address at .test, such as a sign-in code, waits here for an hour instead of being sent, so tests and agents sign in with made-up addresses and no mailbox. Agentpost’s own email, such as a workspace invitation, is always sent to its address.
User tokens A user token, ut_test_… or ut_live_…, is what a browser sends for whoever is signed in to your project, however they signed in. It lasts 15 minutes by default and an hour at most. Services treat it like that principal’s session.