---
title: "POST /policy/{resourceArn}/statements/"
method: POST
path: "/policy/{resourceArn}/statements/"
---

# POST /policy/{resourceArn}/statements/

`POST /policy/{resourceArn}/statements/`

Adds a new resource policy statement to a bot or bot alias. If a resource policy exists, the statement is added to the current resource policy. If a policy doesn't exist, a new policy is created.

You can't create a resource policy statement that allows cross-account access.

## Path parameters

- `resourceArn` string, required

## Query parameters

- `expectedRevisionId` string

## Request body

- object
  - `statementId` string, required — The name of the statement. The ID is the same as the <code>Sid</code> IAM property. The statement name must be unique within the policy. For more information, see <a href="https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_policies_elements_sid.html">IAM JSON policy elements: Sid</a>.
  - `effect` 'Allow' | 'Deny', required — Determines whether the statement allows or denies access to the resource.
  - `principal` Principal[], required — An IAM principal, such as an IAM users, IAM roles, or AWS services that is allowed or denied access to a resource. For more information, see <a href="https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_policies_elements_principal.html">AWS JSON policy elements: Principal</a>.
    - `service` string — The name of the AWS service that should allowed or denied access to an Amazon Lex action.
    - `arn` string — The Amazon Resource Name (ARN) of the principal.
  - `action` Operation[], required — The Amazon Lex action that this policy either allows or denies. The action must apply to the resource type of the specified ARN. For more information, see <a href="https://docs.aws.amazon.com/service-authorization/latest/reference/list_amazonlexv2.html"> Actions, resources, and condition keys for Amazon Lex V2</a>.
  - `condition` object — <p>Specifies a condition when the policy is in effect. If the principal of the policy is a service principal, you must provide two condition blocks, one with a SourceAccount global condition key and one with a SourceArn global condition key.</p> <p>For more information, see <a href="https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_policies_elements_condition.html">IAM JSON policy elements: Condition </a>.</p>

## Response `200`

Success

- CreateResourcePolicyStatementResponse
  - `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` — ConflictException
- `482` — ServiceQuotaExceededException
- `483` — PreconditionFailedException
- `484` — ValidationException
- `485` — InternalServerException
- `486` — ThrottlingException

---

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