---
title: "Agentpost API reference"
description: "Find any Platform API route for signup, workspaces, projects, keys, sending domains, the test inbox, and user tokens, with the rules every route follows."
url: "https://agentpost.tools/docs/platform/reference"
kind: reference
---

# 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](/docs/platform/api-basics.md), and the [Platform guides](/docs/platform.md#where-to-start) walk through each task. Each service’s own operations are in its reference, such as [IdentityHound’s](/docs/identityhound/reference.md). 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](/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](/docs/identityhound/reference/auth.md), [principals](/docs/identityhound/reference/principals.md), [API keys](/docs/identityhound/reference/api-keys.md), [workspaces](/docs/identityhound/reference/workspaces.md), [members](/docs/identityhound/reference/members.md), [invitations](/docs/identityhound/reference/invitations.md), and [delegations](/docs/identityhound/reference/delegations.md) work as IdentityHound’s reference describes, with `/v1/platform` in place of `/v1/identity`, and answer with [IdentityHound’s errors](/docs/identityhound/errors.md). 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](/docs/identityhound/reference/api-keys.md#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](/docs/platform/concepts/workspaces.md#roles) 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](/docs/platform/api-basics.md) 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](/docs/identityhound/reference.md#conventions).
-   **Lists:** Every list takes `limit`, 1 to 200. [Read a workspace’s events](/docs/platform/reference/workspaces.md#read-a-workspaces-events) is a feed. [Lists](/docs/platform/api-basics.md#lists) has the rule.
-   **IDs:** each ID starts with its kind’s prefix, as [IDs](#ids) lists.
-   **Errors:** On the operations in this reference, an error’s `docs` link goes to its code’s entry on [Agentpost errors](/docs/errors.md). [API basics](/docs/platform/api-basics.md#errors) explains which errors page `/v1/platform` links to. Any operation can answer with [`invalid_request`](/docs/errors.md#invalid_request), [`unauthenticated`](/docs/errors.md#unauthenticated), [`secret_key_invalid`](/docs/errors.md#secret_key_invalid), [`origin_not_allowed`](/docs/errors.md#origin_not_allowed), [`not_ready`](/docs/errors.md#not_ready), or [`internal_error`](/docs/errors.md#internal_error); each operation lists the other codes it can answer with. [Errors](/docs/platform/api-basics.md#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](/docs/platform/reference/workspaces.md) | 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](/docs/platform/reference/projects.md) | 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](/docs/platform/reference/keys.md) | 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](/docs/platform/reference/sending-domain.md) | 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](/docs/platform/reference/test-inbox.md) | 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](/docs/platform/reference/user-tokens.md) | 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. |
