> ## Documentation Index
> Fetch the complete documentation index at: https://docs.tess.im/llms.txt
> Use this file to discover all available pages before exploring further.

# Mission Control usage of several workspaces

> The Mission Control totals of several of your workspaces in one call: one row per workspace and the grand total.

Use this endpoint when you belong to several workspaces and want their consumption side by side: one call answers every workspace you name, or all your workspaces when you name none. It takes **no `x-workspace-id` header**.

Each workspace is answered exactly as [Mission Control usage](https://docs.tess.im/en/mission-control-usage.md) answers it, with what you may see there: your own usage, your teams or the whole workspace. A workspace you cannot read does not fail the call; it comes back marked and stays out of the grand total.

> [!NOTE]
>
> This endpoint returns period totals only. To break one workspace down by person, agent, model or day, call [Mission Control usage](https://docs.tess.im/en/mission-control-usage.md) for that workspace.

### **Code examples**

Consumption of two workspaces in November:

```http cURL theme={null}
curl --request GET \
  --url 'https://api.tess.im/mission-control/usage/workspaces?from=2026-11-01&to=2026-11-28&timezone=America/Sao_Paulo&workspace_ids[]=4645&workspace_ids[]=4821' \
  --header 'Authorization: Bearer YOUR_API_KEY' \
  --header 'Accept: application/json'
```

```javascript Node.js theme={null}
const axios = require('axios');

const config = {
  method: 'get',
  url: 'https://api.tess.im/mission-control/usage/workspaces',
  params: {
    from: '2026-11-01',
    to: '2026-11-28',
    timezone: 'America/Sao_Paulo',
    'workspace_ids[]': [4645, 4821]
  },
  headers: {
    'Authorization': 'Bearer YOUR_API_KEY',
    'Accept': 'application/json'
  }
};

try {
  const response = await axios(config);
  console.log(response.data.data.totals, response.data.data.workspaces);
} catch (error) {
  console.error(error.response?.status, error.response?.data);
}
```

```python Python theme={null}
import requests

url = "https://api.tess.im/mission-control/usage/workspaces"
params = {
    "from": "2026-11-01",
    "to": "2026-11-28",
    "timezone": "America/Sao_Paulo",
    "workspace_ids[]": [4645, 4821],
}
headers = {
    "Authorization": "Bearer YOUR_API_KEY",
    "Accept": "application/json",
}

response = requests.get(url, params=params, headers=headers)
if response.ok:
    data = response.json()["data"]
    print(data["totals"], data["workspaces"])
else:
    print(response.status_code, response.json())
```

### **Headers**

No workspace header. The workspaces come from `workspace_ids[]`, or from your memberships when you leave it out. Use [List workspaces](https://docs.tess.im/en/list-workspaces.md) to get the ids.

### **Query parameters**

**workspace\_ids\[]** `array of integer`

Workspaces to include, at most **25**, in the order you give. Leave it out to include every workspace your token can be used in, ordered by name. Without it, a token that can be used in more than 25 workspaces is refused with `too_many_workspaces`.

**from** `date (YYYY-MM-DD)` *required*

Start of the period, a local date in `timezone` (inclusive).

**to** `date (YYYY-MM-DD)` *required*

End of the period (inclusive). The period is at most **93 days**.

**timezone** `string`

IANA timezone of the local dates (for example `America/Sao_Paulo`). Default: the platform timezone.

**metrics\[]** `array of string`

Metrics to return, with the same ids as [Mission Control usage](https://docs.tess.im/en/mission-control-usage.md). Default: `consumption_net`, `consumption_charged`, `consumption_refunded`.

### **Response**

```json theme={null}
{
  "data": {
    "period": { "from": "2026-11-01", "to": "2026-11-28", "timezone": "America/Sao_Paulo" },
    "metrics": ["consumption_net", "consumption_charged", "consumption_refunded"],
    "totals": { "consumption_net": 1873.42, "consumption_charged": 1890.1, "consumption_refunded": 16.68 },
    "totals_cover": { "workspaces": 2, "mixed_scope": true },
    "workspaces": [
      {
        "workspace_id": 4645,
        "name": "Marketing",
        "role": "owner",
        "status": "ok",
        "scope": "workspace",
        "totals": { "consumption_net": 1650.2, "consumption_charged": 1666.88, "consumption_refunded": 16.68 }
      },
      {
        "workspace_id": 4821,
        "name": "HR team",
        "role": "manager",
        "status": "ok",
        "scope": "own",
        "totals": { "consumption_net": 223.22, "consumption_charged": 223.22, "consumption_refunded": 0 }
      },
      { "workspace_id": 4644, "name": "Sales", "role": "user", "status": "no_access" }
    ]
  }
}
```

### **Response fields**

| **Field** | **Description** |
| :- | :- |
| period | The requested period: `from`, `to` and `timezone`. |
| metrics | The metric ids of every `totals` object, in order. |
| totals | The grand total: each metric summed over the workspaces with status `ok`. `null` for a metric that does not add up across workspaces (distinct counts such as `active_people`, ratios and averages), and for every metric when no workspace answered. |
| totals\_cover | `workspaces`: how many workspaces are in the grand total. `mixed_scope`: `true` when they were not all read at the same level, for example the whole of one workspace and only your own usage in another. |
| workspaces | One row per workspace: `workspace_id`, `name`, `role` (your role there) and `status`. Rows with status `ok` also carry `scope` (`own`, `team` or `workspace`) and `totals`. |
| workspaces\[].status | `ok`: answered. `no_access`: you are not a member, your token is not accepted there, or you have no Mission Control access there; `name` and `role` are `null` when the token is not accepted, so the answer does not reveal whether the workspace exists. `not_ready`: Mission Control has no usage data for the workspace yet. |

### **Errors**

Query refusals are JSON objects with a stable `code`, the same for every workspace of the call. Request validation failures (more than 25 `workspace_ids`, a malformed date) come back as a 422 in Laravel's `{message, errors}` shape instead:

```json theme={null}
{
  "message": "This token can use 31 workspaces; name at most 25 of them in workspace_ids.",
  "type": "error",
  "status": 422,
  "code": "too_many_workspaces",
  "details": { "max_workspaces": 25, "workspaces": 31 }
}
```

| **Status** | **Code** | **When** |
| :- | :- | :- |
| 401 | | Missing or invalid token. |
| 403 | | No workspace of the call can be read. Only `message`: `This token has Mission Control access in none of these workspaces.` |
| 422 | `too_many_workspaces` | No `workspace_ids` and your token can be used in more than 25 workspaces. Name at most 25 in `workspace_ids[]`. |
| 422 | `window_too_large` | The period is longer than 93 days. |
| 422 | `period_before_coverage`, `invalid_period`, `invalid_timezone`, `unsupported_timezone`, `unknown_metric`, `metric_not_queryable` | Same meaning as in [Mission Control usage](https://docs.tess.im/en/mission-control-usage.md). |

### **Related**

* [List workspaces](https://docs.tess.im/en/list-workspaces.md): the ids and your role in each workspace.
* [Mission Control usage](https://docs.tess.im/en/mission-control-usage.md): one workspace in detail.
* [Tess MCP](https://docs.tess.im/en/api-mcp.md#list-mission-control-usage-by-workspace): the same answer as the `list_mission_control_usage_by_workspace` tool.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.