Api referenceEndpointsConsent
Set the categories the user allows from a source
PUT
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.
tenantKeyheader
AuthorizationBearer <token>Tenant API key, ohs_sk_ + 43 base62 characters.
id*stringFormat
uuidprovider*stringConnector slug, see GET /v1/providers.
application/json- body
granted*array<>The categories allowed; [] for none.
evidence?stringWhat backs the change, such as a consent form version.
Length
length <= 500The user's consent for this source after the change.
application/json- response
provider*stringcategories*array<>updated_at*stringFormat
date-timecurl -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"}