# ovok.invites

Canonical page: https://docs.ovok.com/web-sdk/core/namespaces/invites

Invitations to share a record or to enter a care relationship. Each flow has `create` (send) and `accept` (redeem). Calls routes under `v1/invites`.

## Share a record [#share-a-record]

A patient shares their record with a practitioner, or some codes with a carer.

```ts
await ovok.invites.recordShares.create({
  recipient: 'practitioner',
  email: 'dr@example.com',
  firstName: 'Ada',
  lastName: 'Lovelace',
});

await ovok.invites.recordShares.create({
  recipient: 'related-person',
  email: 'carer@example.com',
  firstName: 'Sam',
  lastName: 'Lee',
  codes,
});
```

- A `related-person` invite also takes `codes`, the data the carer may see.
- `create` resolves to `{ status: 'sent' }`.

## Invite a patient into care [#invite-a-patient-into-care]

```ts
await ovok.invites.care.create({ email, firstName, lastName });
```

- A practitioner sends this. The patient redeems it with `care.accept`.

## Accept an invite [#accept-an-invite]

```ts
const share = await ovok.invites.accept({ inviteId, code });
```

- `accept` picks the flow from the signed-in profile: a practitioner accepts a record share, a patient accepts a care invite. It throws `OvokConfigError` for any other profile or when signed out.
- Call a flow's `accept` directly when you know the kind. `recordShares.accept` also takes an optional `password`.
- `ovok.invites.practitioners` and `ovok.invites.patients` are deprecated. Use `recordShares` with `recipient: 'practitioner'`, and `care`. The routes sunset on 2026-12-01.

## Reference [#reference]

- [invites API reference](/web-sdk/core/reference/core/invites): every method and type.
- [ovok.sharing](/web-sdk/core/namespaces/sharing): the shares an accepted invite creates.
- [ovok.auth](/web-sdk/core/namespaces/auth)
- [Errors and retries](/web-sdk/core/errors-and-retries)
