# Create video call Ovok-user access

Canonical page: https://docs.ovok.com/api/video-call/create-video-call-ovok-user-access

`POST /video-call/livekit/user-access/{appointmentId}`

Creates a join link for a video call Appointment for the signed-in Ovok user. Use it when a Practitioner or Patient joins a call from an Ovok app.

**Auth:** bearer token. The caller's profile must be a Practitioner or a Patient. A RelatedPerson is refused.
**Scope:** the caller's project (from the token).

## Behaviour

- A Practitioner can always join and joins as room admin.
- A Patient can join only after a Practitioner has granted access to the Appointment. The grant is a `CommunicationRequest` that names the Patient as recipient. `POST /video-call/livekit/notification/active-call/{appointmentId}` creates it. Without it the route returns 401.
- The display name in the call is the Practitioner's name, or for a Patient the user's email, or `user-<profile id>` when there is no email.
- The token is valid from 1 hour before the request until 24 hours after it. Unlike guest access, it does not follow the Appointment times.
- The response holds `videoCallUrl` (the full join link), `livekitJwt` and `passphrase`.

## Example

```bash
curl -X POST 'https://api.sandbox.ovok.com/video-call/livekit/user-access/c3499c27-2973-0a7f-807e-fb8676a92dcb' \
  -H 'Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpYXQiOjE3NjcyNjg4MDAsImV4cCI6MTc2NzI3MjQwMH0.Ql3B_ztDvctlyZ2z0vp4sl3ExXRQGkzmxdmTAqxNzZk'
```
