Releasesv0.1.0
Api referenceEndpointsConsent

Set the categories the user allows from a source

PUT
/v1/users/{id}/consents/{provider}

granted becomes the whole list: every category left out is revoked. From then on the source's records outside granted are dropped before they are stored, and the records already stored in a revoked category are deleted in the background. Each change is kept in the history and announced by the consent.granted and consent.revoked webhooks. Raw payloads are not split by category: they follow OHS_RETENTION_DAYS and the user's erasure.

Authorization

tenantKey
headerAuthorizationBearer <token>

Tenant API key, ohs_sk_ + 43 base62 characters.

Path Parameters

id*string
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
granted*array<>

The categories allowed; [] for none.

evidence?string

What backs the change, such as a consent form version.

Lengthlength <= 500

Response Body

The user's consent for this source after the change.

application/json
  1. response
provider*string
categories*array<>
updated_at*string
Formatdate-time
curl -X PUT 'http://localhost:8080/v1/users/497f6eca-6276-4993-bfeb-53cbbbba6f08/consents/withings' \  -H 'Authorization: Bearer ohs_sk_...' \  -H 'Content-Type: application/json' \  -d '{  "granted": [    "activity"  ]}'
{  "provider": "string",  "categories": [    {      "category": "activity",      "granted": true,      "granted_at": "2019-08-24T14:15:22Z",      "revoked_at": "2019-08-24T14:15:22Z"    }  ],  "updated_at": "2019-08-24T14:15:22Z"}
Edit on GitHub