---
title: "PUT /policy/{resourceArn}/"
method: PUT
path: "/policy/{resourceArn}/"
---

# PUT /policy/{resourceArn}/

`PUT /policy/{resourceArn}/`

Replaces the existing resource policy for a bot or bot alias with a new one. If the policy doesn't exist, Amazon Lex returns an exception.

## Path parameters

- `resourceArn` string, required

## Query parameters

- `expectedRevisionId` string

## Request body

- object
  - `policy` string, required — <p>A resource policy to add to the resource. The policy is a JSON structure that contains one or more statements that define the policy. The policy must follow the IAM syntax. For more information about the contents of a JSON policy document, see <a href="https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_policies.html"> IAM JSON policy reference </a>. </p> <p>If the policy isn't valid, Amazon Lex returns a validation exception.</p>

## Response `200`

Success

- UpdateResourcePolicyResponse
  - `resourceArn` string — The Amazon Resource Name (ARN) of the bot or bot alias that the resource policy is attached to.
  - `revisionId` string — The current revision of the resource policy. Use the revision ID to make sure that you are updating the most current version of a resource policy when you add a policy statement to a resource, delete a resource, or update a resource.

## Other responses

- `480` — ResourceNotFoundException
- `481` — ServiceQuotaExceededException
- `482` — PreconditionFailedException
- `483` — ValidationException
- `484` — InternalServerException
- `485` — ThrottlingException

---

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