Skip to main content
GET/policies

List Policies

Returns all policy bundles for the project, cursor-paginated and filterable by status (draft, published, superseded).

Requires PROJECT_MEMBER minimum.

Each bundle record includes its bundleId, status, policy document, source (authoring path), and lifecycle timestamps.

Parameters
statusquery

Return only bundles in this state.

Omit it for every bundle.

projectSlug *path

The project's slug: the path segment after @.

It is unique within the org.

Responses
HTTPK9O CodeDescription
200Success
401K9O_SESSION_EXPIREDThe caller's session token is expired or invalid; re-authenticate to continue.
403K9O_ACCESS_DENIEDThe caller does not hold the minimum required role to list policy bundles for this project.
Response body (200)
data *object[]

The project's policy bundles, newest first.

With status, only bundles in that state.

id *string

The bundle id (pol_...; bundles created before the rename keep a bnd_... id).

projectId *string

The project the bundle belongs to (proj_...).

status *"draft" | "published" | "superseded"

draft can be edited, deleted and published. published is the bundle in force; a project has at most one. superseded was published and has been replaced or deactivated.

policy *object

The policy document as stored: collections, storage, tools, functions, secrets, streams and analytics, each present only when it was sent.

rulesobject[]

The named-rule catalogue.

Present only when the bundle has one.

createdBy *string

The id of the user who created the bundle (usr_...).

createdAt *string <date-time>

When the bundle was created.

publishedAt *any

When the bundle was published.

Null for a draft.

One of: string <date-time>
or: null
supersededAt *any

When the bundle stopped being in force.

Null unless status is superseded.

One of: string <date-time>
or: null
supersededBy *any

The id of the bundle that replaced this one.

Null when nothing replaced it.

One of: string
or: null
source *"rest" | "migration" | "cli"

How the bundle was created: rest through this API, migration by a platform migration, cli from the CLI.

editorMode *"visual" | "json" | "unspecified"

The editor the bundle was written in, so a console can reopen it in the same one: visual, json, or unspecified.

supersededReason *any

The reason given when the bundle was deactivated.

Null otherwise.

One of: string
or: null
pendingChangeId *any

The id of a queued publish for this bundle that is waiting for an approver (apr_...).

Set on the list and single-bundle reads; null when nothing is queued, and always null in create, update and current-policy responses.

One of: string
or: null
meta *any
TypeScript
// const k9o = new K9o({ orgSlug: 'playground', projectSlug: 'storefront', apiKey: 'k9o_…' })
const { data } = await k9o.policies.list()

Showing example in TypeScript

Response example (200)
{
  "data": [
    {
      "id": "string",
      "projectId": "string",
      "status": "draft",
      "rules": [],
      "createdBy": "string",
      "createdAt": "string",
      "publishedAt": "string",
      "supersededAt": "string",
      "supersededBy": "string",
      "source": "rest",
      "editorMode": "visual",
      "supersededReason": "string",
      "pendingChangeId": "string"
    }
  ]
}

More in Policy & Approvals