---
title: "Creates policy bundle for the context"
method: POST
path: "/owner/{ownerID}/context/{context}/policy-bundle"
tags: ["Policy Management"]
---

# Creates policy bundle for the context

`POST /owner/{ownerID}/context/{context}/policy-bundle`

## Request

- Base URL: `https://circleci.com/api/v2`
- URL: `https://circleci.com/api/v2/owner/{ownerID}/context/{context}/policy-bundle`
- Auth: one of:
  - API key in header `Circle-Token`
  - HTTP bearer
  - HTTP basic
  - API key in query parameter `circle-token`

This endpoint replaces the current policy bundle with the provided policy bundle

## Path parameters

- `ownerID` string, required
- `context` string, required

## Query parameters

- `dry` boolean

## Request body

- BundlePayload
  - `policies` object

## Response `200`

Policy-Bundle diff successfully returned.

- BundleDiff
  - `created` string[]
  - `deleted` string[]
  - `modified` string[]

## Other responses

- `201`: Policy-Bundle successfully created.
- `400`: The request is malformed (e.g, a given path parameter is invalid)
- `401`: The request is unauthorized
- `403`: The user is forbidden from making this request
- `413`: The request exceeds the maximum payload size for policy bundles ~2.5Mib
- `500`: Something unexpected happened on the server.

---

[API](https://skmtc.dev/circleci/apis/circleci-api.md) - [All operations](https://skmtc.dev/circleci/apis/circleci-api/llms.txt) - [OpenAPI document](https://skmtc.dev/circleci/apis/circleci-api/revisions/b9c0e0c24058?raw)
