# Wait for the exact connection link handed to the person

`GET` `/api/v1/workspaces/{workspace}/connection-attempts/{id}`

`getConnectionAttempt`

Give startConnection's url and unchanged for_person to the person, then read this attempt_id. Pending returns 202 with Retry-After: 5 (advice, not an enforced limit); connected, failed or expired returns 200 without the hint; failed with connection_cancelled means the person cancelled on the platform, so ask before sending a new link. The connected result includes the account. CLI: connections wait <attempt_id> waits quietly. No completion message from the person or button instructions are needed. This tracks consent completion, not whether the person opened the platform link; follow next_step to check the visible handoff or retry. Reads only; never contacts a platform, authorizes an account or posts. Who can call it: An API token with the "read" scope, or a member of this workspace, signed in.

**Scopes:** `read`

202 pending carries Retry-After: 5. Read this same id until 200 connected (connection contains the account), failed or expired (error explains the next step). The CLI connections wait command does that quietly; only the person completes platform consent. Never ask them to report back or name a button.

**Parameters**

| Name | In | Required | Type and constraints | Description / example |
| --- | --- | --- | --- | --- |
| `workspace` | path | Yes | `string`; pattern: `"^ws_[a-z0-9]{16}$"` |  Example: `"ws_aaaaaaaaaaaaaaaa"` |
| `id` | path | Yes | `string`; pattern: `"^cat_[a-z0-9]{16}$"` |  Example: `"cat_aaaaaaaaaaaaaaaa"` |

**Request example**

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

**Response example**

```json
{
  "id": "cat_aaaaaaaaaaaaaaaa",
  "platform": "x",
  "status": "pending",
  "expires_at": "2026-10-26T16:15:00.000Z",
  "connection": null,
  "error": null,
  "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. Pending means consent is unfinished, not that the person opened the link."
}
```

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 connections get-attempt`

```sh
flaghand connections get-attempt --workspace ws_aaaaaaaaaaaaaaaa --id cat_aaaaaaaaaaaaaaaa --json
```

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

```json
{
  "name": "callReadOperation",
  "arguments": {
    "operation_id": "getConnectionAttempt",
    "arguments": {
      "workspace": "ws_aaaaaaaaaaaaaaaa",
      "id": "cat_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).
