Skip to content
Agentpost robot in sunglasses on a red circleAgentpost

Entitlements

Whether a principal holds an entitlement, through any grant to it, its workspace, or every principal that is not a guest (every guest, for a guest).

Entitlements explains bundles, grants, and who holds an entitlement.

Paths are relative to https://api.agentpost.tools/v1/identity, and every request follows the API basics. Who may call explains each kind of caller.

Check an entitlement

POST /entitlements/check

Whether a principal holds an entitlement, with the grant and bundle that give it.

  • Who may call: Your server or a signed-in principal.
  • Access: A principal checks itself; a trusted caller names any principalId.
  • Credential: the examples send your project’s dev secret key, sk_test_…, as Authorization: Bearer <token>.
  • SDK: client.entitlements.check(input)
  • Idempotency-Key: not taken. This operation changes nothing, so IdentityHound runs it on every request and it takes no Idempotency-Key.

Body

Name Type Required Description
principalId string No A principal ID, prn_….
entitlement string Yes
resource object No
resource.type string Yes
resource.id string Yes
workspaceId string No A workspace ID, wsp_….

Response

200 OK, with EntitlementCheckResponse.

Errors

Any operation can also answer with the codes Conventions lists.

List entitlements

GET /entitlements

Every entitlement a principal holds, such as the games in its library.

  • Who may call: Your server or a signed-in principal.
  • Access: A principal lists its own; a trusted caller names any principalId.
  • Credential: the examples send your project’s dev secret key, sk_test_…, as Authorization: Bearer <token>.
  • SDK: client.entitlements.list(query)

Query parameters

Name Type Required Description
principalId string No A principal ID, prn_….
entitlement string No
resourceType string No
workspaceId string No A workspace ID, wsp_….

Response

200 OK, with EntitlementsResponse.

Errors

Any operation can also answer with the codes Conventions lists.

The EntitlementCheckResponse object

Name Type Present Description
held boolean Always
grant Grant When set
bundle Bundle When set

The EntitlementsResponse object

Name Type Present Description
entitlements object[] Always
entitlements[].entitlement string Always
entitlements[].resource object When set
entitlements[].resource.type string Always
entitlements[].resource.id string Always
entitlements[].grantId string Always A grant ID, grt_….
entitlements[].bundle string When set