# Mint a SMART launch

Canonical page: https://docs.ovok.com/api/smart-app-launch/mint-a-smart-launch

`POST /v1/smart/launches`

Mints the `launch` value an app opened from Ovok passes to `authorize`, so its token carries this patient (and
encounter) and its `patient/` scopes reach this patient's data only.

**Scope:** the caller's project (from the token). The caller must be able to read the patient and the encounter
themself; Ovok stores the launch in the caller's project.

## Behaviour

- Open the app's launch URL with `iss` and `launch`: `<launch URL>?iss=<iss>&launch=<launch>`. The app sends
  `launch` to `authorize`, and its token answer names the patient (and `encounter`).
- The encounter, when given, must be the patient's.
- A token whose SMART scopes are all `patient/` ones may not call this.

## Example

```bash
curl -X POST 'https://api.sandbox.ovok.com/v1/smart/launches' -H 'Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpYXQiOjE3NjcyNjg4MDAsImV4cCI6MTc2NzI3MjQwMH0.Ql3B_ztDvctlyZ2z0vp4sl3ExXRQGkzmxdmTAqxNzZk' \
  -H 'Content-Type: application/json' -d '{"patient":"Patient/3a7f2c1e-0b4d-4f6a-9c2e-1d8b5a6f7e90"}'
```
