# Accounts

Manage your connected LinkedIn accounts programmatically: list accounts, refresh profile info, connect new ones, disconnect, and regenerate tokens.

> The API Reference is also the SDK and CLI reference. Consecutive code fences marked `tab=HTTP`, `tab=Node`, `tab=Python` and `tab=CLI` are the same call on each surface (a fence marked `tab=HTTP,CLI` is the same text for both), and a block between `:::surface <names>` and `:::` applies only to the surfaces it names. Identifiers in the text are written as in Node and in HTTP JSON (camelCase); the Python SDK spells methods, parameters and result attributes in snake_case (`sendMessage` → `send_message`, `reconnectionLink` → `reconnection_link`), while names inside HTTP JSON stay camelCase.

Manage your connected LinkedIn accounts programmatically. For general Admin API information, see the [Admin overview](/docs/admin-overview). To connect a new account or reconnect an existing one, see [Connection Sessions](/docs/admin-connection-sessions).

## accounts.getAll

Get all connected LinkedIn accounts and pending connection sessions.

```bash tab=HTTP
curl -X POST https://api.linkedapi.io/admin/accounts.getAll \
  -H "Content-Type: application/json" \
  -H "linked-api-token: linked_your_token_here"
```

```typescript tab=Node
const { accounts, pendingConnectionSessions } = await admin.accounts.getAll();
```

```python tab=Python
result = admin.accounts.get_all()
accounts = result.accounts
pending_connection_sessions = result.pending_connection_sessions
```

```bash tab=CLI
linkedin admin accounts list
```

**Response:**

```json
{
  "success": true,
  "result": {
    "accounts": [
      {
        "id": "f9b4346a-...",
        "name": "John Doe",
        "url": "https://www.linkedin.com/in/johndoe/",
        "avatarUrl": "https://media.licdn.com/dms/image/...",
        "headline": "Founder at Example",
        "countryCode": "US",
        "identificationToken": "id_...",
        "status": "active",
        "connectedAt": "2026-02-20T11:11:51.732Z"
      },
      {
        "id": "a91c20f8-...",
        "name": "Jane Doe",
        "url": "https://www.linkedin.com/in/janedoe/",
        "avatarUrl": null,
        "headline": null,
        "countryCode": "US",
        "identificationToken": "id_...",
        "status": "reconnection_required",
        "connectedAt": "2026-01-12T09:30:00.000Z",
        "reconnectionSessionId": "d90ac1f6-...",
        "reconnectionLink": "https://app.linkedapi.io/connection/d90ac1f6-..."
      }
    ],
    "pendingConnectionSessions": [
      {
        "sessionId": "990eef7a-...",
        "status": "pending"
      }
    ]
  }
}
```

**Account fields:**

| Field | Type | Description |
|-------|------|-------------|
| `id` | `string` | Account UUID |
| `name` | `string` | LinkedIn account name |
| `url` | `string` | Public LinkedIn profile URL for the connected account |
| `avatarUrl` | `string` or `null` | LinkedIn profile image URL, or `null` when it has not been parsed yet |
| `headline` | `string` or `null` | LinkedIn headline shown below the account name, or `null` when it has not been parsed yet |
| `countryCode` | `string` | Country code selected during connection |
| `identificationToken` | `string` | The account's identification token, used by every non-admin request |
| `status` | `string` | `active`, `frozen`, or `reconnection_required` |
| `connectedAt` | `string` | ISO 8601 timestamp |
| `reconnectionSessionId` | `string` | Present only when `status` is `reconnection_required`; session UUID for reconnecting the account |
| `reconnectionLink` | `string` | Present only when `status` is `reconnection_required`; URL to open in a browser to reconnect the account |

When an account is `reconnection_required`, `accounts.getAll` returns an active reconnection session. If no active reconnection session exists, one is created automatically before the response is returned.

**Account statuses:**

| Status | Description |
|--------|-------------|
| `active` | Account is connected and operational |
| `frozen` | Account is frozen (subscription downgraded or expired) |
| `reconnection_required` | LinkedIn session expired, account needs to be reconnected |

## accounts.reparseAccountInfo

Refresh the stored profile information for a connected LinkedIn account. This starts a background workflow that opens the account's own LinkedIn session and reparses the account name, public profile URL, avatar URL, and headline. The refreshed values are returned by `accounts.getAll` after the workflow completes.

```bash tab=HTTP
curl -X POST https://api.linkedapi.io/admin/accounts.reparseAccountInfo \
  -H "Content-Type: application/json" \
  -H "linked-api-token: linked_your_token_here" \
  -d '{"accountId": "f9b4346a-..."}'
```

```typescript tab=Node
const { workflowId } = await admin.accounts.reparseAccountInfo({
  accountId: 'f9b4346a-...',
});
```

```python tab=Python
from linkedapi import ReparseAccountInfoParams

result = admin.accounts.reparse_account_info(
    ReparseAccountInfoParams(account_id="f9b4346a-...")
)
```

```bash tab=CLI
linkedin admin accounts reparse f9b4346a-...
```

**Body:**

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `accountId` | `string` | Yes | UUID of the account to refresh |

**Response:**

```json
{
  "success": true,
  "result": {
    "workflowId": "reparseAccountInfoWorkflow-..."
  }
}
```

**Notes:**

- The response confirms that the reparse workflow was started; it does not include the refreshed account object.
- Call `accounts.getAll` after the workflow completes to read the updated `url`, `avatarUrl`, and `headline` fields.
- `avatarUrl` and `headline` can remain `null` if LinkedIn does not render those values or the account session needs reconnection.

## accounts.disconnect

Disconnect a LinkedIn account. This permanently removes the account, its browser profile, and proxy.

```bash tab=HTTP
curl -X POST https://api.linkedapi.io/admin/accounts.disconnect \
  -H "Content-Type: application/json" \
  -H "linked-api-token: linked_your_token_here" \
  -d '{"accountId": "f9b4346a-..."}'
```

```typescript tab=Node
await admin.accounts.disconnect({ accountId: 'f9b4346a-...' });
```

```python tab=Python
from linkedapi import DisconnectParams

admin.accounts.disconnect(DisconnectParams(account_id="f9b4346a-..."))
```

```bash tab=CLI
linkedin admin accounts disconnect f9b4346a-...
```

**Body:**

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `accountId` | `string` | Yes | UUID of the account to disconnect |

**Response:**

```json
{
  "success": true,
  "result": {}
}
```

> **Warning:** This action is irreversible. The account must be reconnected from scratch.

## accounts.regenerateIdentificationToken

Generate a new `identification-token` for an account. The old token becomes invalid immediately.

```bash tab=HTTP
curl -X POST https://api.linkedapi.io/admin/accounts.regenerateIdentificationToken \
  -H "Content-Type: application/json" \
  -H "linked-api-token: linked_your_token_here" \
  -d '{"accountId": "f9b4346a-..."}'
```

```typescript tab=Node
const { token } = await admin.accounts.regenerateIdentificationToken({
  accountId: 'f9b4346a-...',
});
```

```python tab=Python
from linkedapi import RegenerateTokenParams

result = admin.accounts.regenerate_identification_token(
    RegenerateTokenParams(account_id="f9b4346a-...")
)
```

```bash tab=CLI
linkedin admin accounts regenerate-token f9b4346a-...
```

**Body:**

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `accountId` | `string` | Yes | UUID of the account |

**Response:**

```json
{
  "success": true,
  "result": {
    "token": "id_new_token_here"
  }
}
```

> **Important:** Replace the identification token in all your integrations immediately after regeneration: in the `identification-token` header, the SDK client config, or the CLI (`linkedin account update`).

:::surface node,python
In the SDK, that means every `LinkedApi` client created with the old token: pass the new one as its `identificationToken`.
:::

:::surface cli
`regenerate-token` does not change the token the CLI saved for that account. If the account is saved in the CLI, store the new token with `linkedin account update`.
:::
