Push

Remove the push provider

  • Sandbox: available
  • On your own host? Choose https://{host} in the playground.
DELETE
/v1/push/provider

Removes the push provider your current project has set up, with its credentials. No push is sent until one is set up again.

Scope: the caller's project (from the token).

Behaviour

  • The answer is 204.
  • No provider set up is 404 PROVIDER_NOT_CONFIGURED.
  • Registered devices are kept, so a new provider sends to them at once.
  • A 409 means the project changed while the server wrote. Read it again and retry.

Example

curl -X DELETE 'https://api.sandbox.ovok.com/v1/push/provider' \  -H 'Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpYXQiOjE3NjcyNjg4MDAsImV4cCI6MTc2NzI3MjQwMH0.Ql3B_ztDvctlyZ2z0vp4sl3ExXRQGkzmxdmTAqxNzZk'

Who can call it: a project admin. See roles.

Authorization

bearer
headerAuthorizationBearer <JWT>

Response Body

Removed: no push is sent until a provider is set up again.

Example Request
curl -X DELETE 'https://api.sandbox.ovok.com/v1/push/provider'
Example Response
Empty

Change the push provider PATCH

Changes the credentials or settings of the push provider your current project has set up. The result is checked with the provider before it is stored, as `POST` does. **Scope:** the caller's project (from the token). ## Behaviour - `provider` names the provider set up. Another one is 409 `PUSH_PROVIDER_MISMATCH`: remove the current one with `DELETE`, then set the new one up with `POST`. - Send the fields to change, with the rules of `POST`: - `fcm`: `secret`. - `apns`: any of `secret`, `teamId`, `keyId`, `bundleId` and `environment`. - `expo`: `secret`, or `null` to stop sending an access token. - `relay`: `url`. The signing secret stays as it is. - No provider set up is 404 `PROVIDER_NOT_CONFIGURED`. - A refusal from the check is 422 `INVALID_CREDENTIALS`, an unreachable provider 502 `PUSH_PROVIDER_UNAVAILABLE`; nothing is stored either way. - When the server has no encryption key, nothing is stored and the answer is 503 `ENCRYPTION_UNAVAILABLE`. - The answer has the provider as `GET /v1/push/provider` returns it. ## Example ```bash curl -X PATCH 'https://api.sandbox.ovok.com/v1/push/provider' \ -H 'Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpYXQiOjE3NjcyNjg4MDAsImV4cCI6MTc2NzI3MjQwMH0.Ql3B_ztDvctlyZ2z0vp4sl3ExXRQGkzmxdmTAqxNzZk' \ -H 'Content-Type: application/json' \ -d '{ "provider": "apns", "environment": "production" }' ``` **Who can call it:** a project admin. See [roles](/access-policies#who-can-call-a-route).

Send reset password email POST

Sends a password reset email to a Patient, a RelatedPerson (carer) or a Practitioner. The answer is the same whether or not an account exists, so the route cannot be used to find out which emails are registered. **Auth:** none. **Scope:** for a Patient or RelatedPerson, the project that owns `clientId` or `tenantCode`. For a Practitioner, the account is found by email across projects. ## Behaviour - `type` is `Patient`, `RelatedPerson` or `Practitioner`. - A Patient or RelatedPerson needs `clientId` or `tenantCode` to name its project. `tenantCode` is the one the tenant login routes take (`/auth/tenant/Patient/login/start`). When both are sent, `clientId` is used. A Practitioner ignores both. - The response is always a FHIR `OperationOutcome` saying "If the user exists, a password reset email has been sent." It is returned for unknown emails, unknown client IDs, unknown tenant codes and accounts that could not be mailed. - When the account exists, Ovok creates a reset request, which replaces any earlier open reset request for the user, and emails the user. Patients and RelatedPersons get the `PATIENT_RESET_PASSWORD` template and Practitioners the `RESET_PASSWORD` template. - The email carries a link `<app URL>/setpassword/<id>/<secret>` plus the request `id` and `secret`. The app URL is the project's patient app URL for a Patient or RelatedPerson, and its practitioner app URL for a Practitioner; if none is set, the request's `Origin` is used when it is an allowed one. - A Practitioner who is a member of more than one project gets a link to the Ovok platform app instead of a project's app URL. - If no app URL can be found, the email still goes out, without a link. The `id` and `secret` in it can be sent to `POST /v2/auth/reset-password/process`. - If a Practitioner has several accounts, the first one found is used. ## Example ```bash curl -X POST 'https://api.sandbox.ovok.com/v2/auth/reset-password' \ -H 'Content-Type: application/json' \ -d '{ "email": "max.mustermann@example.com", "clientId": "c3499c27-2973-0a7f-807e-fb8676a92dcb", "type": "Patient" }' ``` A tenant app names its project by tenant code: ```bash curl -X POST 'https://api.sandbox.ovok.com/v2/auth/reset-password' \ -H 'Content-Type: application/json' \ -d '{ "email": "max.mustermann@example.com", "tenantCode": "big-health-company", "type": "RelatedPerson" }' ```