# Booking links API

> Email one person a private link to book a call. POST /api/v1/booking-links.

1 operation. Each needs an API key with the permission shown; see [API keys and permissions](https://staffedly.com/docs/developers/api-keys).

| Operation | Permission |
| --- | --- |
| [`POST /api/v1/booking-links`](#post-api-v1-booking-links) | `meetings:write` |

## POST /api/v1/booking-links

Email one person a private link to book from a booking page; what they book is filed on their record. Applicants get the recruiting email; a provider at their own address; a facility at a contact on its record. Do-not-contact and email opt-outs apply.

- **Permission:** `meetings:write`
- **Returns:** one record: `{ data }`, status 201
- **Safe retry:** send an `Idempotency-Key` header (8 to 128 characters); the same key with the same request returns the first answer again

**Body fields** (JSON; a field the API does not know is refused)

| Field | Description |
| --- | --- |
| `bookingTypeId` | Required. A booking page that is switched on and is for this kind of person (or anyone). |
| `applicationId` | One of applicationId, providerId or facilityId. |
| `providerId` | — |
| `facilityId` | — |
| `contactId` | For a facility: which contact (from /facilities/{id}/contacts). Default: the main contact. |

**Fields in each record:** `bookingTypeId`, `applicationId`, `providerId`, `facilityId`, `sent`

```bash
curl -X POST "https://app.staffedly.com/api/v1/booking-links" \
  -H "Authorization: Bearer $STAFFEDLY_API_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{"bookingTypeId":"<bookingTypeId>"}'
```

