# Check saved posting setup, upcoming login or plan ends, agent scopes and failing webhooks

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

`getSetup`

Read-only saved-state report with next steps. Does not refresh credentials, call platforms or Stripe, retry webhooks, approve, schedule or post. Works on inactive plans. A healthy report does not replace checkDraft or the owner's passkey approval. Login warnings match the desk's existing seven-day warning; the current posting check retains its existing headroom. Who can call it: An API token with the "read" scope, or a member of this workspace, signed in.

**Scopes:** `read`

Saved-state diagnostics only, without platform calls or writes. ok is not approval or a guarantee a draft can post; run its normal check and request the owner's passkey approval.

**Parameters**

| Name | In | Required | Type and constraints | Description / example |
| --- | --- | --- | --- | --- |
| `workspace` | path | Yes | `string`; pattern: `"^ws_[a-z0-9]{16}$"` |  Example: `"ws_aaaaaaaaaaaaaaaa"` |
| `platform` | query | No | `string`; enum: `["x","linkedin","tiktok","bluesky","youtube","pinterest","patreon"]` | The platform the person's task calls for. Omit to consider any usable connected account; no platform is chosen for an empty workspace. Example: `"x"` |

**Request example**

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

**Response example**

```json
{
  "workspace_id": "ws_aaaaaaaaaaaaaaaa",
  "checked_at": "2026-10-25T16:00:00Z",
  "ok": true,
  "connections": [
    {
      "id": "con_gggggggggggggggg",
      "platform": "x",
      "external_id": "123456789",
      "handle": "example_studio",
      "display_name": "Example Studio",
      "status": "active",
      "scopes": [
        "tweet.read",
        "tweet.write",
        "users.read",
        "media.write",
        "offline.access",
        "list.read"
      ],
      "expires_at": null,
      "renews": true,
      "connected_at": "2026-10-25T16:00:00Z",
      "profile": {
        "name": "Example Studio",
        "handle": "example_studio",
        "kind": "person",
        "verified": "blue",
        "premium": false,
        "headline": null,
        "cta": null,
        "avatar_url": "/api/v1/workspaces/ws_aaaaaaaaaaaaaaaa/cache/0123456789abcdef0123456789abcdef.png",
        "affiliate_url": null,
        "updated_at": "2026-10-25T16:00:00Z"
      },
      "missing_scopes": [],
      "configured": true
    }
  ],
  "billing": {
    "state": "active",
    "stripe_status": "active",
    "can_post": true,
    "comped": false,
    "free_until": null,
    "first_charge_at": null,
    "time_zone": "UTC",
    "card_trial_refused": false,
    "trial_ends_at": null,
    "renews_at": "2026-10-26T16:00:00Z",
    "ends_at": null
  },
  "queue": {
    "paused": false,
    "paused_at": null,
    "message": "Queue running."
  },
  "token": {
    "id": "tkn_cccccccccccccccc",
    "scopes": [
      "read",
      "drafts",
      "media",
      "request-approval"
    ],
    "missing_drafting_scopes": [],
    "expires_at": null
  },
  "webhooks": [],
  "x_credits_exhausted": false,
  "issues": [],
  "next": {
    "operation_id": "createPost",
    "arguments": {
      "workspace": "ws_aaaaaaaaaaaaaaaa"
    },
    "instruction": "Read the owner's voice note and send-back notes, then supply the whole plan to createPost. Check issues and the selected account first; this hint is not approval or a guarantee that a draft can post.",
    "tell_person": null
  }
}
```

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

**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 workspaces get-setup`

```sh
flaghand workspaces get-setup --workspace ws_aaaaaaaaaaaaaaaa --json
```

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

```json
{
  "name": "callReadOperation",
  "arguments": {
    "operation_id": "getSetup",
    "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).
