# Change a wearable provider

Canonical page: https://docs.ovok.com/api/wearables/change-a-wearable-provider

`PATCH /v1/wearables/providers/{provider}`

Changes a wearable provider your project has already set up: its client ID, its secret, Suunto's subscription key or notification secret, or whether patients may connect it.

**Auth:** bearer token of a project admin.
**Scope:** the caller's project (from the token).

## Behaviour

- Send at least one of `clientId`, `secret`, `subscriptionKey`, `webhookSecret` and `enabled`. Fields you leave out keep their value.
- `webhookSecret` is Suunto's notification secret; change it here when you change it in the Suunto portal. Other providers answer `422 WEBHOOK_SECRET_NOT_USED`.
- Changing Suunto's `clientId` keeps its `webhookSecret`. Send a new one in the same request if the new app signs with another secret. A secret the provider issued, like Polar's, belongs to its client and is replaced on a client change.
- `enabled: false` stops new connections. Patients already connected stay connected and can still disconnect.
- A provider not set up answers `404 PROVIDER_NOT_CONFIGURED`; set it up with `POST`.
- Changing Withings' `clientId` to the one of ovok's own Withings device integration answers `422 CLIENT_ID_RESERVED`.
- Changing Withings' `secret` keeps its `webhookUrl`: the URL's token comes from a secret ovok makes for the project, not from the client secret. Changing its `clientId` makes a new token, and so a new URL; patients connect again to the new app anyway.
- For Polar, every change with `enabled: true` sets the webhook up again as `POST` does. `enabled: false` leaves the webhook in place; its notifications answer `404` until you switch Polar back on.

## Example

```bash
curl -X PATCH 'https://api.sandbox.ovok.com/v1/wearables/providers/oura' \
  -H 'Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpYXQiOjE3NjcyNjg4MDAsImV4cCI6MTc2NzI3MjQwMH0.Ql3B_ztDvctlyZ2z0vp4sl3ExXRQGkzmxdmTAqxNzZk' \
  -H 'Content-Type: application/json' \
  -d '{ "enabled": false }'
```
