Releasesv0.1.0
Api referenceEndpointsAdmin

Turn a provider off, or back on, for one tenant (instance admin)

PATCH
/v1/admin/tenants/{tenant_id}/providers/{provider}

While a provider is off for a tenant, GET /v1/providers and the connect page leave it out for the tenant, starting a connection, the OAuth callback, uploads and self reports answer 403, sync now answers 409, no pull is planned and a queued one ends cancelled without reaching the provider. Connections and data are kept. The switch applies at once in the process that answers and within 30 seconds in the others. Recorded as tenant.provider in the caller's audit log and in the tenant's, together with the change.

Authorization

tenantKey
headerAuthorizationBearer <token>

Tenant API key, ohs_sk_ + 43 base62 characters.

Path Parameters

tenant_id*string

The id of a tenant; any other value is a 404.

Formatuuid
provider*string

Connector slug, see GET /v1/providers.

Header Parameters

Authorization*string

The tenant API key, as a bearer secret.

Request Body

application/json
  1. body
enabled*boolean

false turns the provider off for the tenant, true turns it back on.

Response Body

The provider for the tenant after the change.

application/json
  1. response
slug*string
name*string
kinds*array<>
instance_status*string

The provider's status on the instance, as GET /v1/admin/providers gives it.

Value in"active""off""not_configured""error""built_in"
enabled*boolean

The tenant's switch, true unless an instance admin turned it off.

own_keys*boolean

True while the tenant has keys of its own for the provider (/v1/admin/tenants/{tenant_id}/providers/{provider}/keys).

available*boolean

True when the tenant's users can use the provider now: enabled is true and either the tenant's own keys run, or the tenant has none and the instance runs the provider (active or built_in).

updated_at*|

The last change of the switch, null when it was never set.

Formatdate-time
curl -X PATCH 'http://localhost:8080/v1/admin/tenants/497f6eca-6276-4993-bfeb-53cbbbba6f08/providers/withings' \  -H 'Authorization: Bearer ohs_sk_...' \  -H 'Content-Type: application/json' \  -d '{  "enabled": true}'
{  "slug": "oura",  "name": "Oura",  "kinds": [    "oauth"  ],  "instance_status": "active",  "enabled": true,  "own_keys": true,  "available": true,  "updated_at": "2019-08-24T14:15:22Z"}
Edit on GitHub