Identity
Check which organization an Unstract Flow API key belongs to, who it acts as, and what that person may do. Call it first when a request is refused with 403.
Check a key
GET /api/v1/external/accounts/<organization-id>/whoami
curl "$FLOW_URL/api/v1/external/accounts/$FLOW_ORG/whoami" \
-H "X-API-Key: $FLOW_API_KEY"
{
"organization_id": "…",
"key": {
"id": "…", "name": "Review desk", "prefix": "ufk_a1b2c3d4",
"expires_at": "2027-01-24T23:59:59+00:00",
"scopes": ["hitl:assign"]
},
"actor": {"user_id": "…", "email": "maya@example.com", "name": "Maya Lin"},
"permissions": ["hitl:assign"],
"actor_permissions": ["hitl:assign", "hitl:resolve"]
}
| Field | Type | Meaning |
|---|---|---|
organization_id | string | The organization the request addressed. |
key.id, key.name, key.prefix | string | The key's ID, its name, and its first characters, as the API keys tab shows them. |
key.expires_at | string, or null | When the key expires, in ISO 8601. null only for a key created before every key had to expire. |
key.scopes | array of strings, or null | The permissions this key was limited to. null for a key with full access — everything its creator can do. |
actor.user_id, actor.email, actor.name | string | The person who created the key. Writes to review tickets act as this person. |
permissions | array of strings | What this key can do: the actor's current permissions narrowed by the key's scopes. This is what a request will actually be granted, so check it rather than actor_permissions when you want to know whether a call will succeed. |
actor_permissions | array of strings | What the person can do in this organization now, not when the key was created. Equal to permissions for a key with full access, and wider for a limited one. |
In the example above the key is limited to hitl:assign, so it cannot resolve a ticket even though Maya can.
One exception worth knowing: reading review tickets needs no permission at all, so those routes answer for any valid key whose scopes allow them. That holds even if permissions does not list hitl:read, because the actor's role lacks it.
| Status | Message | Cause |
|---|---|---|
| 401 | Invalid API key | The key is unknown, revoked, or belongs to another organization. |
| 401 | API key has expired | The key's expiry date has passed. |
| 403 | This API key's creator no longer exists or is deactivated; create a new key. | The person who created the key was deleted or deactivated. |
| 403 | This API key's creator is no longer a member of this organization; create a new key. | The person who created the key was removed from the organization. |
Authentication explains how a key acts as its creator.