# Account

> Besday Account API: check which brand, scope and team member an API key acts as, and the current credit balance.

Source: https://besday.com/docs/api/account · Updated 2026-12-03 · OpenAPI: https://besday.com/api/v1/openapi.json

Use the account endpoint to confirm a key works and see who it acts as.

## The account object

Who the API key acts for: the brand, the key, and the team member who created it.

| Field | Type | Description |
|---|---|---|
| `object` | string | Always `account`. One of: `account`. |
| `brand` | object | `{ id, name, website }`. |
| `api_key` | object | `{ id, scope }` of the key used. |
| `acting_as` | object | `{ user_id, email, role }`: the team member the key acts as, with their current role. |
| `credits` | object | `{ balance_credits, spending_paused }`. |

Example:

```json
{
  "object": "account",
  "brand": {
    "id": "ba_2d61f0",
    "name": "Glow Lab",
    "website": "https://glowlab.example"
  },
  "api_key": {
    "id": "key_8b2e44c1",
    "scope": "read_write"
  },
  "acting_as": {
    "user_id": "usr_51c9aa",
    "email": "ops@glowlab.example",
    "role": "admin"
  },
  "credits": {
    "balance_credits": 500,
    "spending_paused": false
  }
}
```

## Retrieve the account

`GET /api/v1/me`

Check a key: returns the brand, the key’s scope, the team member it acts as, and the credit balance.

- Scope: `read`
- Returns: 200 `account`

cURL:

```bash
curl "https://besday.com/api/v1/me" \
  -H "Authorization: Bearer $BESDAY_API_KEY"
```

Node.js:

```javascript
const res = await fetch("https://besday.com/api/v1/me", {
  headers: {
    Authorization: `Bearer ${process.env.BESDAY_API_KEY}`,
  },
});
const data = await res.json();
if (!res.ok) throw new Error(`${data.error.code}: ${data.error.message}`);
```

Python:

```python
import os, uuid, requests

res = requests.get(
    "https://besday.com/api/v1/me",
    headers={
        "Authorization": f"Bearer {os.environ['BESDAY_API_KEY']}",
    },
    timeout=30,
)
res.raise_for_status()
print(res.json())
```

Response (200):

```json
{
  "object": "account",
  "brand": {
    "id": "ba_2d61f0",
    "name": "Glow Lab",
    "website": "https://glowlab.example"
  },
  "api_key": {
    "id": "key_8b2e44c1",
    "scope": "read_write"
  },
  "acting_as": {
    "user_id": "usr_51c9aa",
    "email": "ops@glowlab.example",
    "role": "admin"
  },
  "credits": {
    "balance_credits": 500,
    "spending_paused": false
  }
}
```

Errors: `api_key_missing`, `api_key_invalid`, `rate_limited`.

