palbaseDocs

Palbase Auth API · API

PUT/auth/consents

Record consent choices

Records the choices the person made in the app: the account's when signed in, else the device's. The newest choice of a key wins — a choice made offline counts from when it was made — so a starting value the app never sent cannot override a refusal. source gpc records the browser's Global Privacy Control refusing the ads keys. Every choice is kept as proof, with the text version, country, address and user agent.

Called by your app, with the publishable key; or a signed-in user of your app, with their token and the publishable key.

Headers

X-Palbase-Installation-Secretstring · optionalThe install's secret, as its SDK keeps it (32 random bytes, base64url): the installation id is made from it (the first 16 bytes of its SHA-256, base64url), so it proves the request holds the install it names. Required whenever the request names an installation.

Request body

choicesobject[] · required
installation_idstring · requiredThe app install's label (the SDK's installation id).
source"app" | "gpc" · optionalapp (default), or gpc: the browser's Global Privacy Control refusing the ads keys.
text_versionstring · optionalThe version of the consent text the person saw.
curl
curl -X PUT "https://<your-ref>.palbase.studio/auth/consents" \
  -H "apikey: $PALBASE_PUBLISHABLE_KEY" \
  -H "authorization: Bearer $USER_ACCESS_TOKEN" \
  -H "content-type: application/json" \
  -d '{"choices":[{"key":"string","state":"granted"}],"installation_id":"string"}'

Responses

200The choices after

400Validation failed or required field missing

401Missing, invalid, or expired credentials

403Authenticated but not permitted (banned, hook denial, role mismatch)

defaultAn error: the envelope names it (`error`) and explains it (`error_description`).

Operation ChooseConsents of auth's contract.