# Get Policy

`GET /policies/{bundleId}` · Core · Policy & Approvals

Returns a single policy bundle by its `bundleId`. Includes the bundle's full `PolicyBundle` record: status, policy document, source, authoring metadata, and lifecycle timestamps. Requires `PROJECT_MEMBER` minimum. Returns `K9O_POLICY_NOT_FOUND` (404) if the `bundleId` does not exist in the project.

## Parameters

| Name | In | Required | Description |
|---|---|---|---|
| `bundleId` | path | yes | The policy bundle id (`pol_...`). The `pol_` prefix may be left out. Example: `"pol_demo00000001"`. |
| `projectSlug` | path | yes | The project's slug: the path segment after `@`. It is unique within the org. Example: `"storefront"`. |

## Responses

- **200**: Success

| Field | Type | Required | Description |
|---|---|---|---|
| `data` | object | yes | A policy bundle: the policy document, its named rules and where it is in its lifecycle. |
| `data.id` | string | yes | The bundle id (`pol_...`; bundles created before the rename keep a `bnd_...` id). |
| `data.projectId` | string | yes | The project the bundle belongs to (`proj_...`). |
| `data.status` | enum ("draft", "published", "superseded") | yes | `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. |
| `data.policy` | object | yes | The policy document as stored: `collections`, `storage`, `tools`, `functions`, `secrets`, `streams` and `analytics`, each present only when it was sent. |
| `data.rules` | array of object | no | The named-rule catalogue. Present only when the bundle has one. |
| `data.createdBy` | string | yes | The id of the user who created the bundle (`usr_...`). |
| `data.createdAt` | string (date-time) | yes | When the bundle was created. |
| `data.publishedAt` | object | yes | When the bundle was published. Null for a draft. |
| _one of_ | | |  |
| _or_ | | |  |
| `data.supersededAt` | object | yes | When the bundle stopped being in force. Null unless `status` is `superseded`. |
| _one of_ | | |  |
| _or_ | | |  |
| `data.supersededBy` | object | yes | The id of the bundle that replaced this one. Null when nothing replaced it. |
| _one of_ | | |  |
| _or_ | | |  |
| `data.source` | enum ("rest", "migration", "cli") | yes | How the bundle was created: `rest` through this API, `migration` by a platform migration, `cli` from the CLI. |
| `data.editorMode` | enum ("visual", "json", "unspecified") | yes | The editor the bundle was written in, so a console can reopen it in the same one: `visual`, `json`, or `unspecified`. |
| `data.supersededReason` | object | yes | The reason given when the bundle was deactivated. Null otherwise. |
| _one of_ | | |  |
| _or_ | | |  |
| `data.pendingChangeId` | object | yes | 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_ | | |  |
| _or_ | | |  |
| `meta` | object | yes |  |


## Errors

| HTTP | Code | When |
|---|---|---|
| 401 | `K9O_SESSION_EXPIRED` | The caller's session token is expired or invalid; re-authenticate to continue. |
| 403 | `K9O_ACCESS_DENIED` | The caller does not hold the minimum required role to retrieve this policy bundle. |
| 404 | `K9O_POLICY_NOT_FOUND` | No policy bundle with the supplied identifier exists in this project. |

## Code samples

### cURL

```bash
curl -X GET 'https://<org>.api-<region>.k9o.io/@storefront/policies/<bundleId>' \
  -H 'Authorization: Bearer $K9O_TOKEN'
```

### fetch

```javascript
const res = await fetch('https://<org>.api-<region>.k9o.io/@storefront/policies/<bundleId>', {
  method: 'GET',
  headers: {
    'Authorization': `Bearer ${process.env.K9O_TOKEN}`
  },
});
const { data, meta } = await res.json();
```

### k9o CLI

```bash
k9o policy get <id>
```

### @k9o/core

```typescript
// const k9o = new K9o({ orgSlug: 'playground', projectSlug: 'storefront', apiKey: 'k9o_…' })
const { data } = await k9o.policies.get('pol_demo00000001')
```

### k9o

```python
# k9o = create_client(org_slug="playground", project_slug="storefront", api_key="k9o_…")
response = k9o.policies.get("pol_demo00000001")
```

### sdk-go

```go
// ctx := context.Background()
// client, _ := k9o.NewClient(k9o.ClientOpts{OrgSlug: "playground", ProjectSlug: "storefront", APIKey: "k9o_…"})
data, _, kerr := client.Policies.Get(ctx, "pol_demo00000001")
```

### k9o

```rust
// let k9o = Client::new(ClientOpts { org_slug: "playground".into(), project_slug: "storefront".into(), api_key: "k9o_…".into() })?;
let resp = k9o.policies.get("pol_demo00000001").await?
```

### dev.k9o:core

```java
// K9o k9o = K9o.createClient(K9o.Opts.builder().orgSlug("playground").projectSlug("storefront").apiKey("k9o_…").build());
var response = k9o.policies().get("pol_demo00000001")
```

### K9o.Core

```c#
// var k9o = K9oClient.Create(new K9oOptions { OrgSlug = "playground", ProjectSlug = "storefront", ApiKey = "k9o_…" });
var response = await k9o.Policies.GetAsync("pol_demo00000001")
```

### k9o

```ruby
# k9o = K9o.create_client(org_slug: "playground", project_slug: "storefront", api_key: "k9o_…")
response = k9o.policies.get("pol_demo00000001")
```

### k9o/sdk

```php
// $k9o = K9oClient::create(['org_slug' => 'playground', 'project_slug' => 'storefront', 'api_key' => 'k9o_…']);
$response = $k9o->policies->get('pol_demo00000001')
```


Canonical page: https://docs.kilimanjaro.dev/api-playground/core/get-policy
