Issue individual token
Returns a short-lived access token for one individual of your organisation, for the privacy dashboard SDKs in your app or website. With the token, the individual reads and changes only its own consent records and its own individual record. Call this route from your backend when your user opens the consent screen, and give the token to the SDK.
Name the individual by its individualId or by its externalId (exactly one of them). The route never creates an individual: create it first with Create individual. The token expires after 600 seconds; get a new one when it expires.
This route is for servers only. It takes only an API key whose only scope is individual-tokens:issue (or the older individual-token:issue): an API key with another scope gets 403, and so does a request with an Origin header (a call from a browser). Each API key has a limit of requests per minute. A key of a sandbox organisation issues tokens for the sandbox organisation.
Authorizations
AuthorizationstringheaderrequiredYour API key with the prefix
ApiKey:ApiKey <your-api-key>. Get an API key.Scope:
individual-tokens:issue
Body
individualId stringID of the individual. Send this or
externalId.Example:
"6af0821c38e8f33dcf79962e"externalId stringYour own ID of the individual (its
externalId). Send this orindividualId.Example:
"customer-1002"scopeenum<string>Optional. The scope of the token. The only value is
consent:self, which is also the default.Available options:
consent:selfExample:
"consent:self"
Response
The individual token. The response has the headers Cache-Control: no-store and Pragma: no-cache.
access_token stringThe individual token. Send it as
Authorization: Bearer <token>on the consent routes of the individual.Example:
"<individual-token>"token_type enum<string>Available options:
BearerExample:
"Bearer"expires_in integerLifetime of the token in seconds.
Example:
600individual_id stringID of the individual of the token.
Example:
"6af0821c38e8f33dcf79962e"