API referenceLinkedin accounts
POST
/api/v1/hosted/accounts/link

A link to a page we host where your own user connects a LinkedIn account (type: create), or reconnects one of yours (type: reconnect with reconnect_account), a hosted sign-in: you never see their password. Send them to url; it works until expiresOn (default 1 hour, at most 7 days) and ends once an account is connected or they cancel. A sign-in under way at the expiry may finish its verification step for 30 more minutes.

When an account is connected, notify_url (https, public) receives { "status": "CREATION_SUCCESS" | "RECONNECTED", "account_id": "lg_…", "name": "<your name>" } (up to 3 tries), then the page sends the person to success_redirect_url; a cancel sends them to failure_redirect_url. Check the account with GET /api/v1/accounts/{id}: the notification is not signed. Your webhook gets the account's usual events too.

The page signs in exactly as POST /api/v1/accounts does (the same checkpoints, the live view for a CAPTCHA). A reconnect takes the account's own email only. country places a new account's IP (else the person's own location). At most 10 sign-in tries per link.

Authorization

X-API-KEY<token>

Your API key from the console (gw_live_…).

In: header

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

application/json

application/json

application/json

application/json

application/json

curl -X POST "https://example.com/api/v1/hosted/accounts/link" \  -H "Content-Type: application/json" \  -d '{    "type": "create",    "providers": [      "LINKEDIN"    ],    "expiresOn": "2026-11-08T12:00:00.000Z",    "name": "user-42",    "success_redirect_url": "https://app.example.com/linkedin/connected",    "failure_redirect_url": "https://app.example.com/linkedin/cancelled",    "notify_url": "https://api.example.com/hooks/linkedin-connected"  }'
{  "object": "HostedAuthURL",  "url": "https://console.swarmhit.com/connect/2f6k…",  "id": "hl_8Hq2Lw0aZpN4tYc1",  "expires_at": "2026-11-08T12:00:00.000Z"}