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, along with the sending limits in force for that team. 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.

limitsobject

The limits in force for this team right now, or null if the team could not be resolved. These are effective values and can differ from your plan's defaults, so read them at runtime rather than hardcoding them.

daily and monthly are send-volume caps, in messages. They use the same names as the scope field of a quota_exceeded 429, so the scope that rejected a send names the field that predicted it. Prepaid overage credits are spent past monthly and are not counted here.

delivery_rate_per_minute is how fast accepted mail goes out, not a limit on how fast you may call the API. Nothing is rejected by it: mail beyond the rate queues and drains at the metered rate. See Sending limits.

May be null.

{
  "team": {
    "id": "team_550e8400-e29b-41d4-a716-446655440000",
    "name": "Acme Inc."
  },
  "api_key": {
    "id": "key_550e8400-e29b-41d4-a716-446655440000",
    "permissions": "full"
  },
  "limits": {
    "daily": 5000,
    "monthly": 100000,
    "delivery_rate_per_minute": 1000
  }
}

Responses

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