# Workspace & Analytics API

> Read plan, credits, limits, account and post counts, account analytics, sent-post performance, auto-reply activity and the creator leaderboard.

Source: https://xbeast.io/docs/api-workspace

Workspace endpoints report plan, credits, limits and volume. Analytics endpoints read account growth, sent-post performance, auto-reply activity and the public creator leaderboard. All are read-only and safe for read-only keys.

### Workspace summary

**`GET /api/v1/workspace`**

```json
{
  "plan": { "id": "xbeast-pro", "name": "Pro", "is_free": false, "status": "active" },
  "credits": {
    "used": 120,
    "available": 880,
    "max": 1000,
    "period_start": "2026-11-01T00:00:00.000Z",
    "reset_at": "2026-12-01T00:00:00.000Z"
  },
  "limits": {
    "max_accounts": 3,
    "max_presets": 100,
    "max_schedule_posts": 100,
    "max_queue_posts": 300,
    "max_auto_reply": 50
  },
  "accounts": {
    "total": 2,
    "posting_enabled": 2,
    "needs_reconnect": 0,
    "connected_platforms": ["x"]
  },
  "posts": { "upcoming": 12, "drafts": 4, "errors": 0, "sent": 240 },
  "attention": { "post_errors": 0, "account_errors": 0, "unread": 0 }
}
```

Use `credits.available` before generation and `posts.upcoming` to see how much content is already queued.

### Credits

**`GET /api/v1/credits`**

A smaller legacy response with credits used, available, limit and reset date. Prefer `/workspace` for new integrations.

## Analytics

### Account growth

**`GET /api/v1/accounts/:id/analytics`**

#### Query

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| from | string | No | Start date (ISO 8601). Defaults to 30 days ago. |
| to | string | No | End date (ISO 8601). Defaults to today. |
| granularity | string | No | day, week or month. Default day. |

```bash
curl "https://xbeast.io/api/v1/accounts/YOUR_ACCOUNT_ID/analytics?granularity=week" \
  -H "Authorization: Bearer xb_live_YOUR_KEY"
```

Returns `points` (followers, following, tweets, likes, listed) plus a summary with first/latest values and changes.

### Sent-post performance

**`GET /api/v1/accounts/:id/posts`**

#### Query

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| status | string | No | posted (default), draft, scheduled, error, history. |
| from | string | No | Start date (ISO 8601). |
| to | string | No | End date (ISO 8601). |
| limit | number | No | Default 20, max 100. |
| offset | number | No | Pagination offset. |

### Auto-reply activity

**`GET /api/v1/accounts/:id/auto-replies`**

#### Query

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| post_id | string | No | Limit to one post. |
| limit | number | No | Default 20, max 100. |

### Creator leaderboard

**`GET /api/v1/leaderboard`**

#### Query

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| search | string | No | Handle or name search. |
| sort_by | string | No | influence_score_1d (default), engagement_score_1d, virality_score_1d, followers_count, percent_growth_1d and more. |
| sort_order | string | No | asc or desc. Default desc. |
| page | number | No | Page number. Default 1. |
| page_size | number | No | 1–100. Default 25. |

> **Analytics are sampled**
>
> XBeast stores periodic snapshots, so a just-connected account may have few or no points. Growth numbers depend on how long the account has been connected.

## Related

- [Read post metrics with list_posts / get_post](https://xbeast.io/docs/api-posts.md)
- [Tweet bank performance data](https://xbeast.io/docs/api-tweet-bank.md)
- [Ask an agent for a weekly performance summary over MCP](https://xbeast.io/docs/mcp.md)
