Skip to content

API keys

Inspect the key you are using and manage widget tokens.

GET /api-keys/me

Returns the calling API key’s ID, its owner, its organisation, its scopes and its agent binding. Works with any valid key and accepts API keys only (a dashboard session token is refused).

Example request

Terminal window
curl -X GET "https://api.foan.ai/api/v1/api-keys/me" \
-H "Authorization: Bearer $FOAN_API_KEY"

Response 200

{
"success": true,
"data": {
"keyId": "cmf3k2j9x0006abcd1234efgh",
"userId": "cmf3k2j9x0002abcd1234efgh",
"email": "priya@example.com",
"organisationId": "cmf3k2j9x0001abcd1234efgh",
"organisationName": "Sharma Foods",
"scopes": [
"calls:read",
"agents:read",
"org:read"
],
"agentId": null
}
}

Errors

Code When
401 No key, not an API key (for example a JWT), invalid or revoked key, or the key’s owner is deactivated or no longer in the organisation
429 Rate limited