# Who a client link comes from

`GET /accountant/invite-link/preview`

Requires the `businesses` scope.

What a link says, for the screen the client approves on: the office name and the accountant's email. A link that was altered, is not ours or has expired answers `404`, the same for all three. Session only.

## Query parameters

| Name | Type | | Description |
|---|---|---|---|
| `t` | string | **required** | The token from the link. |

## Response

`200`: `{ "ok": true, … }`

| Field | Type | | Description |
|---|---|---|---|
| `ok` | boolean | **required** |  |
| `email` | string | **required** | The accountant's email. |
| `label` | string | **required** | The office name. |
| `expiresAt` | string |  | When the link stops working. |

Errors: `400`, `401`, `403`, `404`, `429`. Every failure answers `{ "error", "reason", "hint", "param", "doc_url", "retryable", "request_id" }`: branch on `reason`, and read `hint` for what to change (https://docs.billos.co.il/errors.md).

## Examples

### cURL

```bash
curl -X GET "$BASE/accountant/invite-link/preview?t=" \
  -H "X-Api-Key: $KEY"
```
### Node

```node
const res = await fetch(`${BASE}/accountant/invite-link/preview`, {
  method: 'GET',
  headers: {
    'X-Api-Key': KEY,
  },
})
const data = await res.json()
if (!data.ok) throw new Error(data.reason)
```
### Python

```python
import requests
res = requests.get(
    f"{BASE}/accountant/invite-link/preview",
    headers={"X-Api-Key": KEY},
)
data = res.json()
```