Docs/API reference

Identity API

Inspect the identity behind the API key making the request.

Every request needs a bearer token and goes to a path under https://api.anypost.com/v1. See API conventions for the shared request, error, and pagination rules.

Identify the current API key

GET /v1/whoami

Returns the team and permission level behind the API key on the request. Unlike every other management endpoint, this one is reachable by send_only keys — it is the only way such a key can confirm its own identity. Takes no parameters.

Example request

curl https://api.anypost.com/v1/whoami \
  -H "Authorization: Bearer $ANYPOST_API_KEY"

Response body

On success (200), the response body is:

teamobject

A minimal summary of the team the API key belongs to, or null if it could not be resolved.

May be null.

api_keyobject

The API key that authenticated the request.

{
  "team": {
    "id": "team_550e8400-e29b-41d4-a716-446655440000",
    "name": "Acme Inc."
  },
  "api_key": {
    "id": "key_550e8400-e29b-41d4-a716-446655440000",
    "permissions": "full"
  }
}

Responses

StatusDescription
200The resolved identity.
401Missing or invalid credentials.