# Start connecting an account and get the sign-in link for its owner to open (agents can)

`POST` `/api/v1/workspaces/{workspace}/connections/{platform}/start`

`startConnection`

Relay for_person unchanged alongside url; it names the account when reconnecting and explains that connecting does not publish anything. Once the workspace can post, agents can schedule ordinary future social posts to publish at their time without per-post passkey approval; immediate posting still requires the owner's passkey approval of the exact post. Owner-only platform choices still need the owner. Every Pinterest Pin requires owner passkey approval, even when scheduled. Then wait on getConnectionAttempt with attempt_id (CLI: connections wait); the person never needs to report back or find a named button. Who can call it: An API token with the "connections" scope, or a member of this workspace, signed in.

**Scopes:** `connections`

Relay for_person unchanged alongside url, then wait with getConnectionAttempt and attempt_id (CLI: connections wait). Only the person completes platform consent; no message back or button instructions are needed. The synthetic URL cannot connect an account.

**Parameters**

| Name | In | Required | Type and constraints | Description / example |
| --- | --- | --- | --- | --- |
| `workspace` | path | Yes | `string`; pattern: `"^ws_[a-z0-9]{16}$"` |  Example: `"ws_aaaaaaaaaaaaaaaa"` |
| `platform` | path | Yes | `string`; enum: `["x","linkedin","tiktok","bluesky","youtube","pinterest","patreon"]` |  Example: `"x"` |

**JSON body**

| Field | Required | Type and constraints | Description |
| --- | --- | --- | --- |
| `connection_id` | No | `string` | Reconnect this connection. It accepts only the account it's pinned to. |
| `handle` | No | `string`; maxLength: `2048` | Bluesky: the account's handle (alice.bsky.social) or DID. Needed unless connection_id is sent. Bluesky drops an unused sign-in after about 5 minutes (expires_at). |
| `linkedin_organization` | No | `string`; pattern: `"^urn:li:organization:[1-9]\\d*$"` | LinkedIn: explicitly connect this Page using the separately configured Community Management app (Development access only until Standard is granted). The consenting member must administer this Page. Omit for the unchanged personal-profile app. A reconnect cannot change its issuing app or Page. Use the returned Page connection_id explicitly for every draft; no existing profile grant is replaced. |

**Request example**

```http
POST https://app.flaghand.com/api/v1/workspaces/ws_aaaaaaaaaaaaaaaa/connections/x/start
Authorization: Bearer tok_<your workspace token>
Content-Type: application/json

{
  "connection_id": "con_gggggggggggggggg"
}
```

**Response example**

```json
{
  "attempt_id": "cat_aaaaaaaaaaaaaaaa",
  "url": "https://app.example.test/oauth/x/connect?state=SYNTHETIC_DO_NOT_USE",
  "platform": "x",
  "for_person": "Open this link to reconnect your X account @example_studio to Flaghand and allow access on X; unless you're signed in as this workspace's owner, it first shows you whose workspace it is. Connecting does not publish anything. Once your workspace can post, agents can schedule ordinary future social posts to publish at their time without per-post passkey approval; immediate posting still requires your passkey approval of the exact post.",
  "expires_at": "2026-10-25T16:15:00Z",
  "next_step": "Show the person the actual url and unchanged for_person in your reply now, before polling; a URL in tool output alone is not visible to them. Then poll getConnectionAttempt with attempt_id, honoring Retry-After."
}
```

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), `invalid_json` (400), `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 connections start`

```sh
flaghand connections start --workspace ws_aaaaaaaaaaaaaaaa --platform x -d '{"connection_id":"con_gggggggggggggggg"}' --json
```

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

```json
{
  "name": "callWriteOperation",
  "arguments": {
    "operation_id": "startConnection",
    "arguments": {
      "workspace": "ws_aaaaaaaaaaaaaaaa",
      "platform": "x",
      "connection_id": "con_gggggggggggggggg"
    }
  }
}
```

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).
