GET /v1/account
Return the account an API token acts on, plus the caller's role. Reachable without an active subscription.
curl https://api.botect.ai/v1/account \
-H "Authorization: Bearer YOUR_ACCOUNT_TOKEN"
const res = await fetch('https://api.botect.ai/v1/account', {
headers: { Authorization: `Bearer ${process.env.BOTECT_TOKEN}` },
});
const account = await res.json();
import os, requests
r = requests.get(
"https://api.botect.ai/v1/account",
headers={"Authorization": f"Bearer {os.environ['BOTECT_TOKEN']}"},
)
account = r.json()
{
"id": 9,
"name": "Acme Inc",
"slug": "acme",
"is_personal": false,
"role": "owner"
}
{
"error": "Forbidden",
"message": "The API token is not bound to an accessible account.",
"code": "FORBIDDEN"
}
Returns the account the API token is bound to, and the authenticated user's role within it. Reachable without an active subscription, so a no-plan account can still introspect itself.
GET https://api.botect.ai/v1/account
Authentication
Account API token via Authorization: Bearer <token>. The account is resolved from the token's immutable binding; a broken binding fails closed with 403 rather than silently resolving to another account. See Authentication.
Example
Response fields
idinteger
RequiredThe account ID.
namestring
RequiredThe account name.
slugstring
RequiredURL-safe account slug.
is_personalboolean
RequiredWhether this is a personal account.
rolestring | null
RequiredThe authenticated user's role in the account (e.g.
owner, member).Errors
| Status | code | When |
|---|---|---|
401 | UNAUTHENTICATED | Missing / bad account token |
403 | — | The token is not bound to an accessible account |
Was this page helpful?