# Select LinkedIn org

Selects a LinkedIn org.

```http
POST https://api.pozy.ai/v1/connect/linkedin/select-organization
```

- Area: Accounts & connections / Connect
- Auth: Authorization: Bearer pz_live_...

## Request body

Content type: `application/json`

- `profileId`, string, required
- `tempToken`, string, required
- `userProfile`, object, required
- `accountType`, string: One of `personal`, `organization`
- `selections`, array of object: At least 1 item. Up to 25 items
  - `accountType`, string, required: One of `personal`, `organization`
  - `selectedOrganization`, object
- `selectedOrganization`, object
  - `id`, string, required
  - `urn`, string, required: Matches `^urn:li:organization:`
  - `name`, string, required
  - `logoUrl`, string (URL)
  - `vanityName`, string
- `redirect_url`, string (URL)

## Example request

```bash
curl -X POST "https://api.pozy.ai/v1/connect/linkedin/select-organization" \
  -H "Authorization: Bearer $POZY_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "profileId": "6a0b6573846efc28aaa9a3ff",
  "tempToken": "string",
  "userProfile": {}
}'
```

```ts
const res = await fetch("https://api.pozy.ai/v1/connect/linkedin/select-organization", {
  method: "POST",
  headers: {
    Authorization: `Bearer ${process.env.POZY_API_KEY}`,
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
    profileId: "6a0b6573846efc28aaa9a3ff",
    tempToken: "string",
    userProfile: {}
  }),
});
const data = await res.json();
if (!res.ok) throw new Error(data?.error ?? `Request failed with status ${res.status}`);
console.log(data);
```

```python
import os
import requests

resp = requests.post(
    "https://api.pozy.ai/v1/connect/linkedin/select-organization",
    headers={"Authorization": f"Bearer {os.environ['POZY_API_KEY']}"},
    json={
        "profileId": "6a0b6573846efc28aaa9a3ff",
        "tempToken": "string",
        "userProfile": {},
    },
    timeout=30,
)
resp.raise_for_status()
print(resp.json())
```

## Response 200

- `message`, string
- `redirect_url`, string
- `account`, object
  - `accountId`, string
  - `platform`, string: One of `linkedin`
  - `username`, string
  - `displayName`, string
  - `profilePicture`, string
  - `isActive`, boolean
  - `accountType`, string: One of `personal`, `organization`
- `accounts`, array of object
- `failed`, array of object
  - `id`, string
  - `code`, string
  - `message`, string
- `bulkRefresh`, object
  - `updatedCount`, integer
  - `errors`, integer

```json
{
  "message": "Hello from Pozy",
  "redirect_url": "https://pozy.ai/media/example-1.jpg",
  "account": {
    "accountId": "696e0b682d0a31188e7a2ba9",
    "platform": "linkedin",
    "username": "acme",
    "displayName": "Acme",
    "profilePicture": "string",
    "isActive": true,
    "accountType": "personal"
  },
  "accounts": [
    {}
  ],
  "failed": [
    {
      "id": "6bfebd43ddc270f6d2c56fc5",
      "code": "string",
      "message": "Hello from Pozy"
    }
  ],
  "bulkRefresh": {
    "updatedCount": 42,
    "errors": 1
  }
}
```
