Releasesv0.1.0
Api referenceEndpointsAdmin

Save a provider's keys, or turn it on or off (instance admin)

PATCH
/v1/admin/providers/{provider}

keys sets each named key (null removes it); keys left out are kept. The new keys are checked with the provider's own rules before anything is stored (422 with the reason when they are refused), then sealed with OHS_ENCRYPTION_KEY and applied by every process within 30 seconds. While any of the provider's OHS_ environment variables is set, its keys come from there and keys is refused (409); enabled still applies. Recorded in the audit log as config.write.

Authorization

tenantKey
headerAuthorizationBearer <token>

Tenant API key, ohs_sk_ + 43 base62 characters.

Path Parameters

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
keys?

Key name to its new value; null removes the key.

enabled?boolean

Response Body

The provider after the change.

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

active runs; off was turned off; not_configured lacks a required key; error has keys the provider's rules refuse (see error); built_in needs no key and is always on.

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

Where the keys come from. Environment variables win over the console as a whole.

Value in"env""console"null
keys*array<>
error*string|null
urls*

The addresses to register in the provider's developer portal.

updated_at*|
Formatdate-time
updated_by*|

The id of the API key that saved the last change.

curl -X PATCH 'http://localhost:8080/v1/admin/providers/withings' \  -H 'Authorization: Bearer ohs_sk_...' \  -H 'Content-Type: application/json' \  -d '{}'
{  "slug": "string",  "name": "string",  "kinds": [    "oauth"  ],  "status": "active",  "enabled": true,  "source": "env",  "keys": [    {      "name": "CLIENT_ID",      "env": "OHS_OURA_CLIENT_ID",      "required": true,      "secret": true,      "set": true,      "value": "string"    }  ],  "error": "string",  "urls": {    "redirect": "string",    "inbound": "string"  },  "updated_at": "2019-08-24T14:15:22Z",  "updated_by": "string"}
Edit on GitHub