---
title: "IdentityHound API: Entitlements"
description: "Check an entitlement or list entitlements, with the IdentityHound API."
url: "https://agentpost.tools/docs/identityhound/reference/entitlements"
kind: reference
---

# 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](/docs/identityhound/concepts/entitlements.md) 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](/docs/platform/api-basics.md). [Who may call](/docs/identityhound/reference.md#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`](/docs/identityhound/reference/entitlements.md#the-entitlementcheckresponse-object).

### Errors

-   [`entitlement_unknown`](/docs/identityhound/errors.md#entitlement_unknown) (422)
-   [`forbidden`](/docs/identityhound/errors.md#forbidden) (403)
-   [`not_found`](/docs/identityhound/errors.md#not_found) (404)

Any operation can also answer with the codes [Conventions](/docs/identityhound/reference.md#conventions) lists.

```bash tab="curl"
curl -X POST https://api.agentpost.tools/v1/identity/entitlements/check \
  -H "Authorization: Bearer sk_test_…" \
  -H "Content-Type: application/json" \
  -d '{
    "principalId": "prn_01JD1F7TG1SVVEHCFCS56KF78R",
    "entitlement": "reports.export",
    "workspaceId": "wsp_01JDGKQN2K4RF0M0Z2HBASFA62"
  }'
```

```ts tab="SDK"
import { createClient } from '@agentpost-tools/identityhound-sdk';

const client = createClient({ token: 'sk_test_…' });
const { held, grant, bundle } = await client.entitlements.check({
  principalId: 'prn_01JD1F7TG1SVVEHCFCS56KF78R',
  entitlement: 'reports.export',
  workspaceId: 'wsp_01JDGKQN2K4RF0M0Z2HBASFA62',
});
```

```json title="Response"
{
  "held": true,
  "grant": {
    "id": "grt_01JD708CK3K0Y4F83NATYTFGW9",
    "target": {
      "kind": "bundle",
      "bundle": "pro"
    },
    "holder": {
      "kind": "workspace",
      "id": "wsp_01JDGKQN2K4RF0M0Z2HBASFA62"
    },
    "provenance": {
      "source": "purchase",
      "reference": "order_1042"
    },
    "startsAt": "2026-11-13T09:30:00.000Z",
    "status": "active",
    "idempotencyKey": "order_1042",
    "grantedBy": "trusted_caller",
    "createdAt": "2026-11-13T09:30:00.000Z"
  },
  "bundle": {
    "key": "pro",
    "name": "Pro",
    "items": [
      {
        "entitlement": "reports.export"
      },
      {
        "entitlement": "reports.schedule"
      }
    ],
    "status": "active",
    "version": 1,
    "createdAt": "2026-11-02T14:05:00.000Z",
    "updatedAt": "2026-11-02T14:05:00.000Z",
    "updatedBy": "trusted_caller"
  }
}
```

## 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`](/docs/identityhound/reference/entitlements.md#the-entitlementsresponse-object).

### Errors

-   [`forbidden`](/docs/identityhound/errors.md#forbidden) (403)
-   [`not_found`](/docs/identityhound/errors.md#not_found) (404)

Any operation can also answer with the codes [Conventions](/docs/identityhound/reference.md#conventions) lists.

```bash tab="curl"
curl 'https://api.agentpost.tools/v1/identity/entitlements?principalId=prn_01JD1F7TG1SVVEHCFCS56KF78R&workspaceId=wsp_01JDGKQN2K4RF0M0Z2HBASFA62' \
  -H "Authorization: Bearer sk_test_…"
```

```ts tab="SDK"
import { createClient } from '@agentpost-tools/identityhound-sdk';

const client = createClient({ token: 'sk_test_…' });
const { entitlements } = await client.entitlements.list({
  principalId: 'prn_01JD1F7TG1SVVEHCFCS56KF78R',
  workspaceId: 'wsp_01JDGKQN2K4RF0M0Z2HBASFA62',
});
```

```json title="Response"
{
  "entitlements": [
    {
      "entitlement": "reports.export",
      "grantId": "grt_01JD708CK3K0Y4F83NATYTFGW9",
      "bundle": "pro"
    },
    {
      "entitlement": "reports.schedule",
      "grantId": "grt_01JD708CK3K0Y4F83NATYTFGW9",
      "bundle": "pro"
    }
  ]
}
```

## The EntitlementCheckResponse object

| Name | Type | Present | Description |
| --- | --- | --- | --- |
| `held` | `boolean` | Always |  |
| `grant` | [`Grant`](/docs/identityhound/reference/grants.md#the-grant-object) | When set |  |
| `bundle` | [`Bundle`](/docs/identityhound/reference/bundles.md#the-bundle-object) | When set |  |

```json title="The EntitlementCheckResponse object"
{
  "held": true,
  "grant": {
    "id": "grt_01JD708CK3K0Y4F83NATYTFGW9",
    "target": {
      "kind": "bundle",
      "bundle": "pro"
    },
    "holder": {
      "kind": "workspace",
      "id": "wsp_01JDGKQN2K4RF0M0Z2HBASFA62"
    },
    "provenance": {
      "source": "purchase",
      "reference": "order_1042"
    },
    "startsAt": "2026-11-13T09:30:00.000Z",
    "status": "active",
    "idempotencyKey": "order_1042",
    "grantedBy": "trusted_caller",
    "createdAt": "2026-11-13T09:30:00.000Z"
  },
  "bundle": {
    "key": "pro",
    "name": "Pro",
    "items": [
      {
        "entitlement": "reports.export"
      },
      {
        "entitlement": "reports.schedule"
      }
    ],
    "status": "active",
    "version": 1,
    "createdAt": "2026-11-02T14:05:00.000Z",
    "updatedAt": "2026-11-02T14:05:00.000Z",
    "updatedBy": "trusted_caller"
  }
}
```

## 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 |  |

```json title="The EntitlementsResponse object"
{
  "entitlements": [
    {
      "entitlement": "reports.export",
      "grantId": "grt_01JD708CK3K0Y4F83NATYTFGW9",
      "bundle": "pro"
    },
    {
      "entitlement": "reports.schedule",
      "grantId": "grt_01JD708CK3K0Y4F83NATYTFGW9",
      "bundle": "pro"
    }
  ]
}
```
