---
title: "POST /policies/{policyName}/version"
method: POST
path: "/policies/{policyName}/version"
---

# POST /policies/{policyName}/version

`POST /policies/{policyName}/version`

Creates a new version of the specified IoT policy. To update a policy, create a new policy version. A managed policy can have up to five versions. If the policy has five versions, you must use DeletePolicyVersion to delete an existing version before you create a new one.

Optionally, you can set the new version as the policy's default version. The default version is the operative version (that is, the version that is in effect for the certificates to which the policy is attached).

Requires permission to access the [CreatePolicyVersion](https://docs.aws.amazon.com/service-authorization/latest/reference/list_awsiot.html#awsiot-actions-as-permissions) action.

## Path parameters

- `policyName` string, required

## Query parameters

- `setAsDefault` boolean

## Request body

- object
  - `policyDocument` string, required — The JSON document that describes the policy. Minimum length of 1. Maximum length of 2048, excluding whitespace.

## Response `200`

Success

- CreatePolicyVersionResponse — The output of the CreatePolicyVersion operation.
  - `policyArn` string — The policy ARN.
  - `policyDocument` string — The JSON document that describes the policy.
  - `policyVersionId` string — The policy version ID.
  - `isDefaultVersion` boolean — Specifies whether the policy version is the default.

## Other responses

- `480` — ResourceNotFoundException
- `481` — MalformedPolicyException
- `482` — VersionsLimitExceededException
- `483` — InvalidRequestException
- `484` — ThrottlingException
- `485` — UnauthorizedException
- `486` — ServiceUnavailableException
- `487` — InternalFailureException

---

[API](https://skmtc.net/aws/apis/iot.md) · [All operations](https://skmtc.net/aws/apis/iot/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/aws/iot/versions/deef5c4b09f0/schema)
