Api reference
Grant entitlement to customer
Grant a benefit/entitlement to a customer. Provide either benefitId or benefitKey to identify the benefit. Emits an entitlement.granted webhook event.
Related endpoints
GET /customers/{customerId}/entitlements— List customer entitlementsDELETE /customers/{customerId}/entitlements— Revoke entitlement by benefit keyGET /customers/{customerId}/entitlements/check— Check customer entitlementDELETE /customers/{customerId}/entitlements/{entitlementId}— Revoke entitlement by IDGET /entitlements— List entitlementsGET /entitlements/check— Check entitlement access
Common errors
400 invalid_request— malformed payload or failed validation.401 unauthenticated— missing, malformed, or revoked API key.404 resource_missing— the referenced resource does not exist or is not visible to your key.
Idempotency
Pass an Idempotency-Key header (UUID v4 recommended) to make retries safe. Keys are valid for 24 hours; see the idempotency guide.
x-api-key<token>
Your RevKeen API key (powered by Unkey). Get it from Dashboard > Settings > API Keys. Use rk_sandbox_* for test mode and rk_live_* for production.
In: header
Path Parameters
customerId*string
Customer UUID
Format
uuidRequest Body
application/json
TypeScript Definitions
Use the request body type in TypeScript.
Response Body
application/json
curl -X POST "https://api.revkeen.com/v2/customers/00000000-0000-0000-0000-000000000000/entitlements" \ -H "x-api-key: $REVKEEN_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "benefitId": "00000000-0000-0000-0000-000000000000", "benefitKey": "string", "expiresAt": null, "metadata": {} }'{
"data": {
"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
"customerId": "87d8e330-2878-4742-a86f-dbbb3bf522ac",
"benefitId": "551f0400-d5b0-411f-b487-14e33a04c610",
"benefit": {
"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
"name": "string",
"description": "string",
"benefitType": "string",
"benefitKey": "string",
"category": "string",
"iconUrl": "string",
"displayOrder": "string",
"isActive": true,
"defaultValue": null,
"config": null
},
"grantedAt": "2019-08-24T14:15:22Z",
"expiresAt": "2019-08-24T14:15:22Z",
"metadata": {},
"status": "active",
"hasAccess": true,
"accessLevel": "full",
"subscriptionId": "d079718b-ff63-45dd-947b-4950c023750f",
"subscriptionStatus": "string"
},
"message": "string"
}Empty
Empty
Empty