# Put it back on the calendar

`POST /businesses/{bid}/appointments/{id}/reopen`

Requires the `businesses` scope.

From done, cancelled or no_show, back to scheduled.

## Path parameters

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

## Response

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

| Field | Type | | Description |
|---|---|---|---|
| `ok` | boolean | **required** |  |
| `appointment` | Appointment | **required** | An appointment on the business's calendar. Not a document: freely edited and deleted, in no export. |

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

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