List the project's access policies
- Sandbox: available
- On your own host? Choose https://{host} in the playground.
Lists the project's access policies by name, one page at a time.
Scope: the caller's project (from the token). Medplum reads them on behalf of the caller, so the caller's own rights apply.
Behaviour
page(from 0) andcount(1–100, default 20) select the page.hasMoresays whether another page follows.- Each rule names a resource type,
*, or a Signals row such assignals_alerts. Itsinteractionlists what it grants, spelled out even when the stored rule saysreadonly. Anycriteria,hiddenFieldsandreadonlyFieldsare listed with it. managedmarks a policy that Ovok provisions, andcopyOfmarks a copy of a parent project's policy. Both are read-only here.
Example
curl 'https://api.sandbox.ovok.com/v1/access-policies?count=50' -H 'Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpYXQiOjE3NjcyNjg4MDAsImV4cCI6MTc2NzI3MjQwMH0.Ql3B_ztDvctlyZ2z0vp4sl3ExXRQGkzmxdmTAqxNzZk'Who can call it: a project admin. See roles.
bearerAuthorizationBearer <JWT>page?integer0 <= value <= 100000count?integer1 <= value <= 10020A page of policies by name.
application/json- response
hasMore*booleanpolicies*array<>curl -X GET 'https://api.sandbox.ovok.com/v1/access-policies'{ "hasMore": true, "policies": [ { "id": "string", "reference": "string", "name": "string", "versionId": "string", "managed": true, "copyOf": "string", "rules": [ { "resourceType": "string", "interaction": [ "read" ], "criteria": "string", "hiddenFields": [ "string" ], "readonlyFields": [ "string" ] } ] } ]}Overview
Previous Page
Create an access policy POST
Creates an access policy. Its copies in child projects follow. **Scope:** the caller's project (from the token). Medplum writes it on behalf of the caller. ## Behaviour - `name` must be unique in the project, with no commas or backslashes, because child projects find their copy by name. - Each rule must be one that Medplum applies as written. Otherwise the request is refused with `422`, and the message says which rule fails and why: - `criteria` searches the rule's own resource type; - the only modifiers are `:not`, `:missing` and `:present`; - there are no chained searches and no `_has`; - a Signals row such as `signals_alerts` has no `criteria`; - every `writeConstraint` is a FHIRPath expression. - `%parameters` such as `%patient` or `%organization` are left for each member's `access` entry to fill in. - The answer is `201`, and `Location` names the new policy. ## Example ```bash curl -X POST 'https://api.sandbox.ovok.com/v1/access-policies' \ -H 'Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpYXQiOjE3NjcyNjg4MDAsImV4cCI6MTc2NzI3MjQwMH0.Ql3B_ztDvctlyZ2z0vp4sl3ExXRQGkzmxdmTAqxNzZk' \ -H 'Content-Type: application/json' \ -d '{"name":"Ward nurse","rules":[{"resourceType":"Patient","interaction":["read","search"],"criteria":"Patient?organization=%organization"},{"resourceType":"signals_alerts","interaction":["read"]}]}' ``` **Who can call it:** a project admin. See [roles](/access-policies#who-can-call-a-route).