POST/v1/customers/{external_id}/grants
Grant a feature to a customer
Gives the customer a feature value for days days, or with no end when days is 0, on top of their plan. Optionally guarded by expectedRevision, with an optional reason. Needs customers:write.
curl -X POST 'https://api.entitler.co/v1/customers/ada/grants' \
-H "Authorization: Bearer $ENTITLER_KEY" \
-H "Content-Type: application/json" \
-d '{"currency":"currency","days":1,"expectedRevision":{"value":1},"featureKey":"featureKey","reason":"reason","target":{"environmentId":"environmentId","projectId":"projectId","teamId":"teamId"},"value":{"limit":{"count":1,"unlimited":{}},"on":{}}}'Credentials
Send any one of these:
- Bearer token
Path parameters
| Name | Type | Description |
|---|---|---|
external_idrequired | string | The customer's external ID, or me for the customer a customer token or identity token names. |
Request body
object
currencystringdaysinteger (int64)at least 0; at most 4294967295
expectedRevisioncommon.Revision-Inputvalueintegerat least 0; at most 18446744073709552000
featureKeystringreasonstringtargetProductTargetenvironmentIdstringprojectIdstringteamIdstring
valueGrantValuelimitcommon.Limitcountintegerat least 0; at most 18446744073709552000
unlimitedcommon.Unlimited
onSwitchOn
Responses
200The CreateGrantResponse message.
CreateGrantResponse
grantGrantfeatureKeystringrequiredfromintegerrequiredat least 0; at most 18446744073709552000
grantedBycommon.Actoridstringrequiredtypecommon.ActorTyperequiredOne of
ACTOR_TYPE_UNSPECIFIED,ACTOR_TYPE_USER,ACTOR_TYPE_KEY,ACTOR_TYPE_SYSTEM.
idstringrequiredreasonstringrequiredrevokeReasonstringrevokedAtintegerat least 0; at most 18446744073709552000
revokedBycommon.Actoridstringrequiredtypecommon.ActorTyperequiredOne of
ACTOR_TYPE_UNSPECIFIED,ACTOR_TYPE_USER,ACTOR_TYPE_KEY,ACTOR_TYPE_SYSTEM.
untilintegerat least 0; at most 18446744073709552000
valueGrantValuelimitcommon.Limitcountintegerat least 0; at most 18446744073709552000
unlimitedcommon.Unlimited
onSwitchOn
revisionintegerrequiredat least 0; at most 18446744073709552000
ErrorA refusal, with the HTTP status of its gRPC code.
Error
errorobjectrequiredcodestringrequiredparametersobjectrequiredEach value: string
reasonstringor nullrequired