POST/v1/customers/{external_id}/tokens
Create a customer token
Mints a token for a customer, scoped to entitlements:read unless scopes asks for more. Each requested scope must be one the caller holds, and lifetimeSeconds defaults to 3,600. Needs tokens:mint, and a plan that includes customer tokens.
curl -X POST 'https://api.entitler.co/v1/customers/ada/tokens' \
-H "Authorization: Bearer $ENTITLER_KEY" \
-H "Content-Type: application/json" \
-d '{"lifetimeSeconds":1,"memberId":"memberId","scopes":["CUSTOMER_TOKEN_SCOPE_UNSPECIFIED"],"target":{"environmentId":"environmentId","projectId":"projectId","teamId":"teamId"}}'Credentials
Send any one of these:
- Bearer token
Path parameters
| Name | Type | Description |
|---|---|---|
external_idrequired | string |
Request body
object
lifetimeSecondsinteger (int64)at least 0; at most 4294967295
memberIdstringscopesarray of CustomerTokenScopetargetProductTargetenvironmentIdstringprojectIdstringteamIdstring
Responses
200The CreateTokenResponse message.
CreateTokenResponse
customerIdstringexpiresAtintegerrequiredat least 0; at most 18446744073709552000
memberIdstringscopesarray of CustomerTokenScoperequiredtokenstringrequiredtokenIdstringrequired
ErrorA refusal, with the HTTP status of its gRPC code.
Error
errorobjectrequiredcodestringrequiredparametersobjectrequiredEach value: string
reasonstringor nullrequired