> ## Documentation Index
> Fetch the complete documentation index at: https://developers.vizito.eu/llms.txt
> Use this file to discover all available pages before exploring further.

# Keeping hosts in sync

> Push the people who can be visited straight from your directory.

The host list is what a visitor types into on the kiosk and what reception picks from. It goes stale the moment somebody joins or leaves, so it is worth driving from the system that already knows: your HR tool, your directory, your CRM.

There are two ways to do it, and they do not mix.

<CardGroup cols={2}>
  <Card title="One at a time" icon="user-pen">
    `POST`, `PUT` and `DELETE` on `/api/visitees`. You track which hosts exist and reconcile yourself.
  </Card>

  <Card title="Replace the whole set" icon="arrows-rotate">
    `POST /api/visitees/external/upload/{company_id}`. You send the full list; Vizito makes it so.
  </Card>
</CardGroup>

## Replacing the whole set

This is the simpler model, and the right one when your directory is the source of truth. Send everybody who may be visited; the previous external list is discarded and replaced.

```bash cURL theme={null}
curl -X POST https://api.vizito.eu/api/visitees/external/upload/{company_id} \
  -H "Authorization: Bearer $VIZITO_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "data": [
      { "cn": "Jane Doe", "mail": "jane.doe@example.com", "mobile": "+32470111222", "telephoneNumber": "+3211755092" },
      { "cn": "John Roe", "mail": "john.roe@example.com" }
    ]
  }'
```

```json Response theme={null}
{ "message": "visitees.SUCCESS", "hosts_imported": 2 }
```

<Warning>
  **This endpoint accepts one upload per location per 24 hours.** A second call within that window is answered with `hosts_imported: 0` and changes nothing — it does not fail loudly. Schedule it as a nightly job, not as a per-change hook.
</Warning>

A few things worth knowing:

* Hosts uploaded this way are marked **external**. They are used on the kiosk exactly like managed hosts, but they do not appear in `GET /api/visitees/bycompany/{company_id}` — that endpoint returns the manually maintained list only.
* Sending an empty `data` array clears the external host list.
* Email addresses are lower-cased on the way in.

## Managing hosts one by one

Use this when Vizito is the source of truth, or when only a handful of hosts come from elsewhere.

<CodeGroup>
  ```bash Create theme={null}
  curl -X POST https://api.vizito.eu/api/visitees \
    -H "Authorization: Bearer $VIZITO_API_KEY" \
    -H "Content-Type: application/json" \
    -d '{
      "company_id": "5f2a1b9c4d3e2f0011223344",
      "cn": "Jane Doe",
      "mail": "jane.doe@example.com",
      "mobile": "+32470111222"
    }'
  ```

  ```bash Update theme={null}
  curl -X PUT https://api.vizito.eu/api/visitees/66c1a2b3c4d5e6f700112299 \
    -H "Authorization: Bearer $VIZITO_API_KEY" \
    -H "Content-Type: application/json" \
    -d '{ "company_id": "5f2a1b9c4d3e2f0011223344", "mobile": "+32470999888" }'
  ```

  ```bash Delete theme={null}
  curl -X DELETE https://api.vizito.eu/api/visitees/66c1a2b3c4d5e6f700112299 \
    -H "Authorization: Bearer $VIZITO_API_KEY"
  ```

  ```bash List theme={null}
  curl https://api.vizito.eu/api/visitees/bycompany/5f2a1b9c4d3e2f0011223344 \
    -H "Authorization: Bearer $VIZITO_API_KEY"
  ```
</CodeGroup>

## Why the contact details matter

`mail`, `mobile` and `telephoneNumber` are not decoration. When a visitor picks a host on the kiosk, Vizito notifies that host on the details stored here — and when you pre-register a visitor with a `recipient` that matches a host's `cn`, the invitation and the notification pick up that host's email and mobile automatically.

So the name you store in `cn` is the join key. Keep it identical to the `recipient` your other integrations send.

<Card title="All host endpoints" icon="code" href="/api-reference/hosts/listing-hosts">
  Parameters and responses in detail.
</Card>


## Related topics

- [Introduction](/index.md)
- [Replacing the host list](/api-reference/hosts/replacing-the-host-list.md)
- [Authentication](/api-reference/authentication.md)
- [Listing hosts](/api-reference/hosts/listing-hosts.md)
- [Deleting a host](/api-reference/hosts/deleting-a-host.md)
