Skip to content
Agentpost robot in sunglasses on a red circleAgentpost

Bundles

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

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.

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

Errors

Any operation can also answer with the codes Conventions lists.

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 array Always

Errors

Any operation can also answer with the codes Conventions lists.

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.

Response

200 OK, with:

Name Type Present Description
bundle Bundle Always

Errors

Any operation can also answer with the codes Conventions lists.

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 has the rule.

Path parameters

Name Type Required Description
key string Yes A bundle key, such as pro. The key of a Bundle.

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 Always

Errors

Any operation can also answer with the codes Conventions lists.

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 has the rule.

Path parameters

Name Type Required Description
key string Yes A bundle key, such as pro. The key of a Bundle.

Response

200 OK, with:

Name Type Present Description
bundle Bundle Always

Errors

Any operation can also answer with the codes Conventions lists.

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