# The workspace's plan and whether it can post

`GET` `/api/v1/workspaces/{workspace}/billing`

`getBilling`

Card details and invoice links require the billing scope and, for a person, the owner role, including in workspace exports. While can_post is false and the workspace has a recorded open Checkout, Retry-After: 60 suggests when to read again. This is advice, not an enforced limit or a held request. Use billing wait in the CLI, or read once when the person returns. This read never starts or confirms Checkout. Who can call it: An API token with the "read" scope, or a member of this workspace, signed in.

**Scopes:** `read`

**Parameters**

| Name | In | Required | Type and constraints | Description / example |
| --- | --- | --- | --- | --- |
| `workspace` | path | Yes | `string`; pattern: `"^ws_[a-z0-9]{16}$"` |  Example: `"ws_aaaaaaaaaaaaaaaa"` |
| `include_invoices` | query | No | `string`; enum: `["true","false"]` | Defaults to true for callers with billing scope; other callers never receive invoices. Set false to read saved billing state without fetching invoice history from Stripe. Example: `"true"` |

**Request example**

```http
GET https://app.flaghand.com/api/v1/workspaces/ws_aaaaaaaaaaaaaaaa/billing
Authorization: Bearer tok_<your workspace token>
```

**Response example**

```json
{
  "state": "active",
  "stripe_status": "trialing",
  "plan": "monthly",
  "amount": 1900,
  "currency": "usd",
  "trial_ends_at": "2026-11-01T16:00:00Z",
  "time_zone": "America/Los_Angeles",
  "free_until": null,
  "first_charge_at": null,
  "card_trial_refused": false,
  "media_storage": {
    "used_bytes": 1048576,
    "limit_bytes": null,
    "deletes_at": null
  },
  "renews_at": "2026-11-01T16:00:00Z",
  "ends_at": null,
  "cancel_requested_at": null,
  "posts_after_end": 0,
  "x_posts": {
    "used": 12,
    "limit": 300,
    "link_posts": {
      "used": 2,
      "limit": 30
    },
    "reserved": 0,
    "link_reserved": 0,
    "period_started_at": "2026-10-25T16:00:00Z",
    "resets_at": "2026-12-01T16:00:00Z"
  },
  "can_post": true,
  "comped": false,
  "livemode": false,
  "trial_available": false,
  "card": {
    "brand": "visa",
    "last4": "4242"
  },
  "message": null,
  "invoices": []
}
```

Success: HTTP 200. Content-Type: application/json.

Response headers: `Retry-After`: Suggested seconds before checking again while a recorded Checkout is pending and can_post is false. Absent once active, or without an open Checkout..

**Errors:** `invalid_request` (400), `internal` (500), `unauthorized` (401), `invalid_token` (401), `session_expired` (401), `bad_origin` (403), `scope_missing` (403), `not_found` (404). See the [error codes](https://app.flaghand.com/docs/errors.md) for meanings and the shared default error response. Other domain errors from that catalog may apply; the response's code and message are authoritative.

**CLI:** `flaghand billing get`

```sh
flaghand billing get --workspace ws_aaaaaaaaaaaaaaaa --json
```

**MCP tool:** `getBilling` (also reachable through `callReadOperation`; use `getOperation` to load its full schema).

```json
{
  "name": "callReadOperation",
  "arguments": {
    "operation_id": "getBilling",
    "arguments": {
      "workspace": "ws_aaaaaaaaaaaaaaaa"
    }
  }
}
```

Base URL: `https://app.flaghand.com/api/v1`. Part of the [API reference](https://app.flaghand.com/docs/api.md); every error code is in [errors](https://app.flaghand.com/docs/errors.md).
