# Email a quote

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

Requires the `documents` scope.

Sends the customer a link to the quote PAGE (where he can read it, download the PDF, and accept or decline) to up to 5 addresses. Omit `to` and it goes to the address on the customer card. Rate-limited; never available in sandbox.

## Path parameters

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

## Body (optional)

| Field | Type | | Description |
|---|---|---|---|
| `to` | array of string |  |  |

## Response

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

| Field | Type | | Description |
|---|---|---|---|
| `ok` | boolean | **required** |  |
| `sent` | array of string | **required** |  |
| `failed` | array of string |  |  |
| `url` | string |  | The link that was sent. |

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 POST "$BASE/businesses/$BID/quotes/$DOC_ID/email" \
  -H "X-Api-Key: $KEY"
```
### Node

```node
const res = await fetch(`${BASE}/businesses/${BID}/quotes/${DOC_ID}/email`, {
  method: 'POST',
  headers: {
    'X-Api-Key': KEY,
  },
})
const data = await res.json()
if (!data.ok) throw new Error(data.reason)
```
### Python

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