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:
teamobjectA minimal summary of the team the API key belongs to, or
nullif it could not be resolved.May be null.
api_keyobjectThe API key that authenticated the request.
limitsobjectThe limits in force for this team right now, or
nullif 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.dailyandmonthlyare send-volume caps, in messages. They use the same names as thescopefield of aquota_exceeded429, so the scope that rejected a send names the field that predicted it. Prepaid overage credits are spent pastmonthlyand are not counted here.delivery_rate_per_minuteis 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
| Status | Description |
|---|---|
200 | The resolved identity. |
401 | Missing or invalid credentials. |