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

# POST /policies/{policyName}

`POST /policies/{policyName}`

Creates an IoT policy.

The created policy is the default version for the policy. This operation creates a policy version with a version identifier of **1** and sets **1** as the policy's default version.

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

## Path parameters

- `policyName` string, required

## Request body

- object
  - `policyDocument` string, required — The JSON document that describes the policy. <b>policyDocument</b> must have a minimum length of 1, with a maximum length of 2048, excluding whitespace.
  - `tags` Tag[] — <p>Metadata which can be used to manage the policy.</p> <note> <p>For URI Request parameters use format: ...key1=value1&amp;key2=value2...</p> <p>For the CLI command-line parameter use format: &amp;&amp;tags "key1=value1&amp;key2=value2..."</p> <p>For the cli-input-json file use format: "tags": "key1=value1&amp;key2=value2..."</p> </note>
    - `Key` string, required — The tag's key.
    - `Value` string — The tag's value.

## Response `200`

Success

- CreatePolicyResponse — The output from the CreatePolicy operation.
  - `policyName` string — The policy name.
  - `policyArn` string — The policy ARN.
  - `policyDocument` string — The JSON document that describes the policy.
  - `policyVersionId` string — The policy version ID.

## Other responses

- `480` — ResourceAlreadyExistsException
- `481` — MalformedPolicyException
- `482` — InvalidRequestException
- `483` — ThrottlingException
- `484` — UnauthorizedException
- `485` — ServiceUnavailableException
- `486` — 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)
