---
title: "IdentityHound API: Bundles"
description: "Create a bundle, list bundles, get a bundle, update a bundle, or retire a bundle, with the IdentityHound API."
url: "https://agentpost.tools/docs/identityhound/reference/bundles"
kind: reference
---

# Bundles

Named sets of entitlements, such as a plan, granted together.

[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.

## Create a bundle

`POST /bundles`

Creates a bundle of entitlements from the catalog.

-   **Who may call:** Your server or a signed-in principal.
-   **Access:** Needs `identity.bundle:manage`.
-   **Credential:** the examples send your project’s `dev` secret key, `sk_test_…`, as `Authorization: Bearer <token>`.
-   **SDK:** `client.bundles.create(input)`
-   **Idempotency-Key:** optional. [Retrying a write](/docs/platform/api-basics.md#retrying-a-write) has the rule.

### Body

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `key` | `string` | Yes |  |
| `name` | `string` | Yes | 1–120 characters. |
| `items` | `object[]` | Yes |  |
| `items[].entitlement` | `string` | Yes |  |
| `items[].resource` | `object` | No |  |
| `items[].resource.type` | `string` | Yes |  |
| `items[].resource.id` | `string` | Yes |  |

### Response

`201 Created`, with:

| Name | Type | Present | Description |
| --- | --- | --- | --- |
| `bundle` | [`Bundle`](/docs/identityhound/reference/bundles.md#the-bundle-object) | Always |  |

### Errors

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

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/bundles \
  -H "Authorization: Bearer sk_test_…" \
  -H "Content-Type: application/json" \
  -d '{
    "key": "pro",
    "name": "Pro",
    "items": [
      {
        "entitlement": "reports.export"
      },
      {
        "entitlement": "reports.schedule"
      }
    ]
  }'
```

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

const client = createClient({ token: 'sk_test_…' });
const { bundle } = await client.bundles.create({
  key: 'pro',
  name: 'Pro',
  items: [
    { entitlement: 'reports.export' },
    { entitlement: 'reports.schedule' },
  ],
});
```

```json title="Response"
{
  "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 bundles

`GET /bundles`

Every bundle.

-   **Who may call:** Your server or a signed-in principal.
-   **Access:** Needs `identity.bundle:view`.
-   **Credential:** the examples send your project’s `dev` secret key, `sk_test_…`, as `Authorization: Bearer <token>`.
-   **SDK:** `client.bundles.list()`

### Response

`200 OK`, with:

| Name | Type | Present | Description |
| --- | --- | --- | --- |
| `bundles` | [`Bundle`](/docs/identityhound/reference/bundles.md#the-bundle-object) array | Always |  |

### Errors

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

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/bundles \
  -H "Authorization: Bearer sk_test_…"
```

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

const client = createClient({ token: 'sk_test_…' });
const { bundles } = await client.bundles.list();
```

```json title="Response"
{
  "bundles": [
    {
      "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"
    }
  ]
}
```

## Get a bundle

`GET /bundles/:key`

One bundle.

-   **Who may call:** Your server or a signed-in principal.
-   **Access:** Needs `identity.bundle:view`.
-   **Credential:** the examples send your project’s `dev` secret key, `sk_test_…`, as `Authorization: Bearer <token>`.
-   **SDK:** `client.bundles.get(key)`

### Path parameters

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `key` | `string` | Yes | A bundle key, such as `pro`. The `key` of a [`Bundle`](/docs/identityhound/reference/bundles.md#the-bundle-object). |

### Response

`200 OK`, with:

| Name | Type | Present | Description |
| --- | --- | --- | --- |
| `bundle` | [`Bundle`](/docs/identityhound/reference/bundles.md#the-bundle-object) | Always |  |

### 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/bundles/pro \
  -H "Authorization: Bearer sk_test_…"
```

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

const client = createClient({ token: 'sk_test_…' });
const { bundle } = await client.bundles.get('pro');
```

```json title="Response"
{
  "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"
  }
}
```

## Update a bundle

`PATCH /bundles/:key`

Renames a bundle or changes its items. Existing grants follow the bundle’s new items.

-   **Who may call:** Your server or a signed-in principal.
-   **Access:** Needs `identity.bundle:manage`.
-   **Credential:** the examples send your project’s `dev` secret key, `sk_test_…`, as `Authorization: Bearer <token>`.
-   **SDK:** `client.bundles.patch(key, patch)`
-   **Idempotency-Key:** optional. [Retrying a write](/docs/platform/api-basics.md#retrying-a-write) has the rule.

### Path parameters

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `key` | `string` | Yes | A bundle key, such as `pro`. The `key` of a [`Bundle`](/docs/identityhound/reference/bundles.md#the-bundle-object). |

### Body

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `name` | `string` | No | 1–120 characters. |
| `items` | `object[]` | No |  |
| `items[].entitlement` | `string` | Yes |  |
| `items[].resource` | `object` | No |  |
| `items[].resource.type` | `string` | Yes |  |
| `items[].resource.id` | `string` | Yes |  |

### Response

`200 OK`, with:

| Name | Type | Present | Description |
| --- | --- | --- | --- |
| `bundle` | [`Bundle`](/docs/identityhound/reference/bundles.md#the-bundle-object) | Always |  |

### Errors

-   [`bundle_retired`](/docs/identityhound/errors.md#bundle_retired) (409)
-   [`conflict`](/docs/identityhound/errors.md#conflict) (409)
-   [`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 PATCH https://api.agentpost.tools/v1/identity/bundles/pro \
  -H "Authorization: Bearer sk_test_…" \
  -H "Content-Type: application/json" \
  -d '{
    "items": [
      {
        "entitlement": "reports.export"
      },
      {
        "entitlement": "reports.schedule"
      },
      {
        "entitlement": "reports.export",
        "resource": {
          "type": "report",
          "id": "q3-revenue"
        }
      }
    ]
  }'
```

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

const client = createClient({ token: 'sk_test_…' });
const { bundle } = await client.bundles.patch('pro', {
  items: [
    { entitlement: 'reports.export' },
    { entitlement: 'reports.schedule' },
    {
      entitlement: 'reports.export',
      resource: { type: 'report', id: 'q3-revenue' },
    },
  ],
});
```

```json title="Response"
{
  "bundle": {
    "key": "pro",
    "name": "Pro",
    "items": [
      {
        "entitlement": "reports.export"
      },
      {
        "entitlement": "reports.schedule"
      },
      {
        "entitlement": "reports.export",
        "resource": {
          "type": "report",
          "id": "q3-revenue"
        }
      }
    ],
    "status": "active",
    "version": 2,
    "createdAt": "2026-11-02T14:05:00.000Z",
    "updatedAt": "2026-11-13T09:30:00.000Z",
    "updatedBy": "trusted_caller"
  }
}
```

## Retire a bundle

`POST /bundles/:key/retire`

Retires a bundle. New grants can’t use it, and existing grants of it stay as history but give nothing.

-   **Who may call:** Your server or a signed-in principal.
-   **Access:** Needs `identity.bundle:manage`.
-   **Credential:** the examples send your project’s `dev` secret key, `sk_test_…`, as `Authorization: Bearer <token>`.
-   **SDK:** `client.bundles.retire(key)`
-   **Idempotency-Key:** optional. [Retrying a write](/docs/platform/api-basics.md#retrying-a-write) has the rule.

### Path parameters

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `key` | `string` | Yes | A bundle key, such as `pro`. The `key` of a [`Bundle`](/docs/identityhound/reference/bundles.md#the-bundle-object). |

### Response

`200 OK`, with:

| Name | Type | Present | Description |
| --- | --- | --- | --- |
| `bundle` | [`Bundle`](/docs/identityhound/reference/bundles.md#the-bundle-object) | Always |  |

### Errors

-   [`bundle_retired`](/docs/identityhound/errors.md#bundle_retired) (409)
-   [`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/bundles/pro/retire \
  -H "Authorization: Bearer sk_test_…"
```

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

const client = createClient({ token: 'sk_test_…' });
const { bundle } = await client.bundles.retire('pro');
```

```json title="Response"
{
  "bundle": {
    "key": "pro",
    "name": "Pro",
    "items": [
      {
        "entitlement": "reports.export"
      },
      {
        "entitlement": "reports.schedule"
      }
    ],
    "status": "retired",
    "version": 2,
    "createdAt": "2026-11-02T14:05:00.000Z",
    "updatedAt": "2026-11-13T09:30:00.000Z",
    "updatedBy": "trusted_caller"
  }
}
```

## The Bundle object

A named, editable set of entitlements (ih\_bundles). Its key is its ID.

| Name | Type | Present | Description |
| --- | --- | --- | --- |
| `key` | `string` | Always |  |
| `name` | `string` | Always |  |
| `items` | `object[]` | Always |  |
| `items[].entitlement` | `string` | Always |  |
| `items[].resource` | `object` | When set |  |
| `items[].resource.type` | `string` | Always |  |
| `items[].resource.id` | `string` | Always |  |
| `status` | `"active"` or `"retired"` | Always | A retired bundle grants nothing; its grants stay as history. |
| `version` | `number` | Always |  |
| `createdAt` | `string` | Always | An ISO 8601 date and time. |
| `updatedAt` | `string` | Always | An ISO 8601 date and time. |
| `updatedBy` | `string` | Always | A principal ID, `prn_…`, or `"trusted_caller"`. |

```json title="The Bundle object"
{
  "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"
}
```
