API 參考
Entitlements
Management API: GET /sites/{id}/entitlements, POST /sites/{id}/entitlements, GET /sites/{id}/entitlements/check, …
List entitlements (who can access which deliverable or featureKey) filtered by contact, deliverable or featureKey; includes revoked and expired rows. Newest first. Errors: FORBIDDEN, DELIVERABLE_NOT_FOUND, INVALID_CURSOR.
Parameters
idstring · pathrequiredWebsite id. Get it from sites.list or from sites.create.
limitinteger · queryMaximum number of items to return, 1–100. Defaults to 20.
cursorstring · queryOpaque cursor from the previous page's nextCursor. Omit for the first page.
contactIdstring · querydeliverableIdstring · queryDeliverable id. Get it from deliverables.list.
featureKeystring · queryactiveOnlyboolean · queryOnly rows that are not revoked and not expired.
Response 200
dataobject[]requireddata[].idstringrequireddata[].contactIdstringrequireddata[].deliverableIdstring | nullrequireddata[].unitIdstring | nullrequireddata[].featureKeystring | nullCommercial feature key for feature-only grants (no deliverable), e.g. "premium". For deliverable-backed entitlements the feature keys come from Deliverable.grants and this field is null.
data[].tierIdstring | nullrequireddata[].productIdstring | nullrequiredSource product snapshot when the entitlement came from an order.
data[].sourcestringrequiredORDER_LINE, MANUAL_GRANT, PREPAID_REDEMPTION, FREE, EXTERNAL (payment collected outside Kanorio), GIFT.
data[].sourceRefstring | nullrequireddata[].startsAtstring | nullrequireddata[].endsAtstring | nullrequireddata[].revokedAtstring | nullrequireddata[].revokeReasonstring | nullrequireddata[].createdAtstringrequiredhasMorebooleanrequiredTrue when another page exists; pass nextCursor to fetch it.
nextCursorstring | nullrequiredCursor for the next page, or null on the last page.
Errors
FORBIDDEN403DELIVERABLE_NOT_FOUND404INVALID_CURSOR400
MCP tool entitlements_list
curl -X GET "https://app.kanorio.com/api/v1/sites/{id}/entitlements" \
-H "Authorization: Bearer $KANORIO_TOKEN"{
"data": [
{
"id": "ent_example01",
"contactId": "contact_example01",
"deliverableId": "dlv_example01",
"unitId": null,
"featureKey": null,
"tierId": null,
"productId": null,
"source": "MANUAL_GRANT",
"sourceRef": null,
"startsAt": "2026-10-01T02:30:00.000Z",
"endsAt": null,
"revokedAt": null,
"revokeReason": null,
"createdAt": "2026-10-01T02:30:00.000Z"
}
],
"hasMore": false,
"nextCursor": null
}Grant an entitlement
/sites/{id}/entitlementsGrant a contact access to a deliverable and/or a commercial featureKey without a Kanorio purchase (gift, corporate seat, paid newsletter subscriber, or a payment collected by your own checkout). Idempotent: pass idempotencyKey to make retries return the same entitlement; with source EXTERNAL, sourceRef (your transaction id) also dedupes per deliverable, and a revoked external grant is never re-created by a replay. source EXTERNAL is only accepted from agent tokens (PAT / OAuth), never from a browser session; it requires sourceRef. Kanorio Checkout does not need to be enabled. Errors: FORBIDDEN, CONTACT_NOT_FOUND, DELIVERABLE_NOT_FOUND (archived deliverables cannot be granted), VALIDATION.
Parameters
idstring · pathrequiredWebsite id. Get it from sites.list or from sites.create.
Idempotency-Keystring · headerClient-chosen key (1-200 chars). Retrying with the same key and the same body returns the original result; the same key with a different body is rejected with IDEMPOTENCY_CONFLICT (409). Keys expire after 24 hours.
Request body
contactIdstringrequiredGet it from contacts.list or contacts.add.
deliverableIdstringDeliverable id. Provide deliverableId and/or featureKey.
featureKeystringCommercial feature key (e.g. "premium") matched by collection accessPolicy and entitlements.check.
endsAtstring | nullAccess expiry; omit for permanent access.
source"MANUAL_GRANT" | "GIFT" | "EXTERNAL"Why access is granted. MANUAL_GRANT (default) or GIFT for site-owner grants; EXTERNAL when the payment was collected outside Kanorio (requires sourceRef; agent tokens only).
sourceRefstringYour system's reference for this grant (e.g. external transaction id). Used for deduplication and shown in the audit trail.
idempotencyKeystringClient-chosen key; the same key on the same site always returns the same entitlement.
Response 201
idstringrequiredcontactIdstringrequireddeliverableIdstring | nullrequiredunitIdstring | nullrequiredfeatureKeystring | nullCommercial feature key for feature-only grants (no deliverable), e.g. "premium". For deliverable-backed entitlements the feature keys come from Deliverable.grants and this field is null.
tierIdstring | nullrequiredproductIdstring | nullrequiredSource product snapshot when the entitlement came from an order.
sourcestringrequiredORDER_LINE, MANUAL_GRANT, PREPAID_REDEMPTION, FREE, EXTERNAL (payment collected outside Kanorio), GIFT.
sourceRefstring | nullrequiredstartsAtstring | nullrequiredendsAtstring | nullrequiredrevokedAtstring | nullrequiredrevokeReasonstring | nullrequiredcreatedAtstringrequired
Errors
FORBIDDEN403CONTACT_NOT_FOUND404DELIVERABLE_NOT_FOUND404 · archived deliverables cannot be grantedVALIDATION400
MCP tool entitlements_grant
curl -X POST "https://app.kanorio.com/api/v1/sites/{id}/entitlements" \
-H "Authorization: Bearer $KANORIO_TOKEN" \
-H "Idempotency-Key: $(uuidgen)" \
-H "Content-Type: application/json" \
-d '{"contactId":"contact_example01","deliverableId":"dlv_example01"}'{
"id": "ent_example01",
"contactId": "contact_example01",
"deliverableId": "dlv_example01",
"unitId": null,
"featureKey": null,
"tierId": null,
"productId": null,
"source": "MANUAL_GRANT",
"sourceRef": null,
"startsAt": "2026-10-01T02:30:00.000Z",
"endsAt": null,
"revokedAt": null,
"revokeReason": null,
"createdAt": "2026-10-01T02:30:00.000Z"
}Check whether a contact can access a deliverable, a single unit, or a commercial featureKey right now (entitlement, free preview, release schedule, expiry). Errors: FORBIDDEN, DELIVERABLE_NOT_FOUND, VALIDATION.
Parameters
idstring · pathrequiredWebsite id. Get it from sites.list or from sites.create.
contactIdstring · queryrequireddeliverableIdstring · queryDeliverable id. Get it from deliverables.list.
unitIdstring · queryUnit id. Get it from deliverables.get.
featureKeystring · queryCommercial feature key (e.g. "premium") checked by ContentCollection.accessPolicy.
Response 200
grantedbooleanrequiredreason"entitlement" | "preview" | "none" | "not_released" | "expired" | "hidden" | "prerequisite" | "not_found"requiredprerequisite: blocked by the course's require-in-order rule (lockedByUnitId is the unit to finish first).
availableAtstring | nullrequiredlockedByUnitIdstring | nullrequiredWhen reason is prerequisite: the unit the learner must complete first.
Errors
FORBIDDEN403DELIVERABLE_NOT_FOUND404VALIDATION400
MCP tool entitlements_check
curl -X GET "https://app.kanorio.com/api/v1/sites/{id}/entitlements/check?contactId=contact_example01&deliverableId=dlv_example01" \
-H "Authorization: Bearer $KANORIO_TOKEN"{
"granted": true,
"reason": "entitlement",
"availableAt": null,
"lockedByUnitId": null
}Revoke an entitlement
/sites/{id}/entitlements/{entitlementId}/revokeRevoke one entitlement (learner loses access immediately; the row is kept for audit). Errors: FORBIDDEN, ENTITLEMENT_NOT_FOUND.
Parameters
idstring · pathrequiredWebsite id. Get it from sites.list or from sites.create.
entitlementIdstring · pathrequired
Request body
reasonstring
Response 200
idstringrequiredcontactIdstringrequireddeliverableIdstring | nullrequiredunitIdstring | nullrequiredfeatureKeystring | nullCommercial feature key for feature-only grants (no deliverable), e.g. "premium". For deliverable-backed entitlements the feature keys come from Deliverable.grants and this field is null.
tierIdstring | nullrequiredproductIdstring | nullrequiredSource product snapshot when the entitlement came from an order.
sourcestringrequiredORDER_LINE, MANUAL_GRANT, PREPAID_REDEMPTION, FREE, EXTERNAL (payment collected outside Kanorio), GIFT.
sourceRefstring | nullrequiredstartsAtstring | nullrequiredendsAtstring | nullrequiredrevokedAtstring | nullrequiredrevokeReasonstring | nullrequiredcreatedAtstringrequired
Errors
FORBIDDEN403ENTITLEMENT_NOT_FOUND404
MCP tool entitlements_revoke
curl -X POST "https://app.kanorio.com/api/v1/sites/{id}/entitlements/{entitlementId}/revoke" \
-H "Authorization: Bearer $KANORIO_TOKEN" \
-H "Content-Type: application/json" \
-d '{"reason":"Corporate seat reassigned"}'{
"id": "ent_example01",
"contactId": "contact_example01",
"deliverableId": "dlv_example01",
"unitId": null,
"featureKey": null,
"tierId": null,
"productId": null,
"source": "MANUAL_GRANT",
"sourceRef": null,
"startsAt": "2026-10-01T02:30:00.000Z",
"endsAt": null,
"revokedAt": "2026-10-06T08:00:00.000Z",
"revokeReason": "Corporate seat reassigned",
"createdAt": "2026-10-01T02:30:00.000Z"
}