# Get a connect link

Check whether a connect link was used, and which accounts it connected.


```http
GET https://social-publish-api.onrender.com/v1/accounts/connect-links/{id}
```

Returns a [connect link](/docs/api/create-connect-link) and its outcome. Call it from your server after your user comes back to your `redirectUrl`, to confirm the result before you trust it.

## Path parameters

| Parameter | Description |
| --- | --- |
| `id` | The link's `id` from [Create a connect link](/docs/api/create-connect-link). |

## Request

```bash tab="cURL"
curl https://social-publish-api.onrender.com/v1/accounts/connect-links/5b0c7e1a-2f3d-4c5b-8a9e-1d2c3b4a5f6e \
  -H "x-access-key: $RELAYCAST_API_KEY"
```

```ts tab="Node.js"
const res = await fetch(`https://social-publish-api.onrender.com/v1/accounts/connect-links/${linkId}`, {
  headers: { "x-access-key": process.env.RELAYCAST_API_KEY! },
});
const { data: link } = await res.json();
if (link.status === "connected") console.log("Connected accounts:", link.accountIds);
```

```python tab="Python"
import os, requests

res = requests.get(
    f"https://social-publish-api.onrender.com/v1/accounts/connect-links/{link_id}",
    headers={"x-access-key": os.environ["RELAYCAST_API_KEY"]},
)
link = res.json()["data"]
```

## Response

The same fields as when the link was created, without `url`.

```json title="Response 200"
{
  "data": {
    "id": "5b0c7e1a-2f3d-4c5b-8a9e-1d2c3b4a5f6e",
    "platform": "youtube",
    "status": "connected",
    "accountIds": ["7c6b5a49-3827-4e1d-8c0b-9a8f7e6d5c4b"],
    "error": null,
    "errorDetail": null,
    "redirectUrl": "https://app.example.com/integrations/done",
    "state": "user_42",
    "groupId": null,
    "oauthAppId": null,
    "expiresAt": "2026-11-02T10:00:00.000Z",
    "completedAt": "2026-11-02T09:03:12.000Z",
    "createdAt": "2026-11-02T09:00:00.000Z"
  }
}
```

| `status` | Meaning |
| --- | --- |
| `pending` | Created, not opened yet. |
| `opened` | The user opened the link and is on the consent screen. |
| `connected` | Done. `accountIds` lists the connected accounts. |
| `failed` | Done, with an `error` (and sometimes `errorDetail`). See the [error codes](/docs/api/create-connect-link#back-at-your-redirecturl). |
| `expired` | Not used before `expiresAt`. |

Returns `404 not_found` if the id doesn't exist or belongs to another project.
