# Sharing

Canonical page: https://docs.ovok.com/python-sdk/namespaces/sharing

`ovok.sharing` lets a patient share their record: create and redeem invitations, list and
revoke shares, and read or change sharing settings.

## Share a record and revoke it [#share-a-record-and-revoke-it]

`shares.list()` always includes `practitioners`, `relatedPersons` and `received`, empty when
there are none. Revoke a share by its Consent ID.

```python
from ovok_sdk import Ovok

ovok = Ovok("https://api.sandbox.ovok.com", "your-tenant")

invite = ovok.sharing.invites.create(invitation)
shares = ovok.sharing.shares.list()
for share in shares["practitioners"]:
    print(share)
ovok.sharing.shares.revoke("consent-id")
```

The recipient redeems the invitation with `sharing.invites.redeem`. Read and replace the
settings with `sharing.settings.retrieve()` and `sharing.settings.update(...)`.

## API reference [#api-reference]

See [`ovok_sdk.resources.sharing`](/python-sdk/reference/resources/sharing)
for every method, parameter and error.
