v1

latestOpenAPI 3.0.0Apache 2.0 License2026-07-14107861793.8 KB

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.

put/policy/{resourceArn}/

Path parameters

resourceArnstring required

The Amazon Resource Name (ARN) of the bot or bot alias that the resource policy is attached to.

Query parameters

expectedRevisionIdstring
<p>The identifier of the revision of the policy to update. If this revision ID doesn't match the current revision ID, Amazon Lex throws an exception.</p> <p>If you don't specify a revision, Amazon Lex overwrites the contents of the policy with the new values.</p>

Request body

policystring 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

Success

resourceArnstring

The Amazon Resource Name (ARN) of the bot or bot alias that the resource policy is attached to.

revisionIdstring

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.