# Get the public PDF link

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

Requires the `documents` scope.

The no-login link to the same PDF `prints` serves, for a WhatsApp or email hand-off: the host streams it at `path` (`/api/docs/<slug>/d.pdf`). It IS a print: `auto` hands out the origin exactly once and the copy after that (הוראה 18(ב)2), so `variant` says which one the link carries.

## Path parameters

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

## Body (optional)

| Field | Type | | Description |
|---|---|---|---|
| `kind` | string |  | `auto` recommended. One of: `auto`, `origin`, `copy`. Default `auto`. |

## Response

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

| Field | Type | | Description |
|---|---|---|---|
| `ok` | boolean |  |  |
| `variant` | string |  |  One of: `origin`, `copy`. |
| `fileId` | string |  |  |
| `slug` | string |  | The public capability. |
| `path` | string |  | Host path that streams the PDF. |

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/share" \
  -H "X-Api-Key: $KEY"
```
### Node

```node
const res = await fetch(`${BASE}/businesses/${BID}/documents/${DOC_ID}/share`, {
  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}/documents/{DOC_ID}/share",
    headers={"X-Api-Key": KEY},
)
data = res.json()
```