## List a provider's accounts to link to employees (hr:write)

`GET /api/hr/v1/linked-accounts/candidates`

Module: HR · operationId: `listLinkedAccountCandidates` · Tag: Employees · Auth: access token (`Authorization: Bearer <accessToken>`)

Read live from the provider by comms, with the e-mail of the person each account is linked to.

### Parameters

| Name | In | Type | Required | Description |
|---|---|---|---|---|
| `provider` | query | string | yes | The provider (one of `nfon`, `teamviewer`) |

### Responses

- **200** Accounts (`application/json`)
- **400** Error (`application/json`)
- **403** Error (`application/json`)
- **409** The tenant has not connected the provider (`provider_not_connected`) (`application/json`)
- **503** comms is not configured or not reachable (`linked_accounts_unavailable`) (`application/json`)

Fields of the 200 answer:

- `items` (array of LinkedAccountCandidate, required): The provider's accounts
  - `key` (string, required): The provider's id of the account
  - `label` (string, required): The account's name in the provider
  - `email` (string): The account's e-mail in the provider, when known
  - `person` (string): E-mail of the person the account is linked to; empty: not linked

Example 200 answer:

```json
{
  "items": [
    {
      "email": "sophie.huber@muster-it.example",
      "key": "217",
      "label": "Sophie Huber",
      "person": "sophie.huber@muster-it.example"
    },
    {
      "key": "221",
      "label": "Elias Gruber",
      "person": "elias.gruber@muster-it.example"
    },
    {
      "key": "230",
      "label": "Empfang Zentrale",
      "person": ""
    }
  ]
}
```

### Example request

```bash
curl -X GET 'https://api.mbcom.cloud/api/hr/v1/linked-accounts/candidates?provider=nfon' \
  -H "Authorization: Bearer $ACCESS_TOKEN"
```
