# Email the document link

`POST /businesses/{bid}/documents/{id}/email`

Requires the `documents` scope.

Sends the public PDF link to up to 5 addresses in a BillOS-branded email, one email per address. Sending IS a print (`auto`): the origin exactly once, the copy after (הוראה 18(ב)2). Issued (or cancelled) documents only; not available in sandbox; rate-limited (BOOKS_EMAIL_RATE_PER_MIN, default 10/min).

## Path parameters

| Name | Type | | Description |
|---|---|---|---|
| `bid` | string | **required** | Business id, from `POST /businesses`. |
| `id` | string | **required** | Document id. |

## Body

| Field | Type | | Description |
|---|---|---|---|
| `to` | array of string | **required** | Recipient addresses (1-5). |

## Response

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

| Field | Type | | Description |
|---|---|---|---|
| `ok` | boolean |  |  |
| `sent` | array of string |  |  |
| `failed` | array of string |  |  |
| `variant` | string |  |  One of: `origin`, `copy`. |
| `url` | string |  | The public PDF link the email carries. |

Errors: `400`, `401`, `403`, `404`, `409`, `429`. Every failure answers `{ "error": …, "reason": … }`. Branch on `reason`.

## Examples

### cURL

```bash
curl -X POST "$BASE/businesses/$BID/documents/$DOC_ID/email" \
  -H "X-Api-Key: $KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "to": "2026-07-31"
  }'
```
### Node

```node
const res = await fetch(`${BASE}/businesses/${BID}/documents/${DOC_ID}/email`, {
  method: 'POST',
  headers: {
    'X-Api-Key': KEY,
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({
    "to": "2026-07-31"
  }),
})
const data = await res.json()
if (!data.ok) throw new Error(data.reason)
```
### Python

```python
import requests
res = requests.post(
    f"{BASE}/businesses/{BID}/documents/{DOC_ID}/email",
    headers={"X-Api-Key": KEY},
    json={
      "to": "2026-07-31"
    },
)
data = res.json()
```