Agent: Key¶
Who am I¶
GET /api/v1/agent/whoami/
Returns the organisation this key belongs to, the key's name, and its effective scope (none/view/edit) for every resource. Call this first: it proves the key works and tells you what you may do.
Authentication: API key — Authorization: Bearer <key>
const response = await fetch(`https://www-dev.yoshuko.com/api/v1/agent/whoami/`, {
method: "GET",
headers: { Authorization: `Bearer ${process.env.YOSHUKO_API_KEY}` }
});
if (!response.ok) throw new Error(`HTTP ${response.status}`);
console.log(response.status === 204 ? response.status : await response.json());
| Status | Meaning |
|---|---|
200 |
No response body |
401 |
Missing, unknown, revoked or expired key; or the organisation's plan is inactive (subscription_inactive) or unverified (org_unverified). |
403 |
The key's scope for this resource does not allow the action. |
429 |
Rate limited (300 requests/hour per key). Retry after the Retry-After header. |