openapi: 3.2.0 info: title: Amazon Lex Model Building V2 Policy API description: Amazon Lex V2 Model Building operations let you build and manage conversational bots — bots, aliases, locales, intents, slots, slot types, custom vocabularies, imports/exports, test sets and analytics. Derived mechanically from the AWS-published Smithy 2.0 service model (aws/api-models-aws, models/lex-models-v2/service/2020-08-07). Requests are signed with AWS Signature Version 4 using service name lex. version: '2020-08-07' contact: name: AWS Support url: https://aws.amazon.com/premiumsupport/ license: name: Apache 2.0 url: https://www.apache.org/licenses/LICENSE-2.0.html x-generated-from: AWS Smithy 2.0 service model (https://github.com/aws/api-models-aws) — mechanical transform, no hand-authored operations servers: - url: https://models-v2-lex.us-east-1.amazonaws.com description: Amazon Lex V2 Model Building endpoint (us-east-1; one regional endpoint per AWS Region — see https://docs.aws.amazon.com/general/latest/gr/lex.html) security: - sigv4: [] tags: - name: Policy paths: /policy/{resourceArn}: post: operationId: CreateResourcePolicy summary: Creates a new resource policy with the specified policy statements description: Creates a new resource policy with the specified policy statements. tags: - Policy parameters: - name: resourceArn in: path required: true description: The Amazon Resource Name (ARN) of the bot or bot alias that the resource policy is attached to. schema: type: string minLength: 1 maxLength: 1011 requestBody: required: true content: application/json: schema: type: object properties: policy: type: string minLength: 2 description: 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 IAM JSON policy reference . If the policy isn't valid, Amazon Lex returns a validation exception. required: - policy responses: '200': description: Success content: application/json: schema: $ref: '#/components/schemas/CreateResourcePolicyResponse' '400': description: ValidationException content: application/json: schema: $ref: '#/components/schemas/ValidationException' '402': description: ServiceQuotaExceededException content: application/json: schema: $ref: '#/components/schemas/ServiceQuotaExceededException' '404': description: ResourceNotFoundException content: application/json: schema: $ref: '#/components/schemas/ResourceNotFoundException' '412': description: PreconditionFailedException content: application/json: schema: $ref: '#/components/schemas/PreconditionFailedException' '429': description: ThrottlingException content: application/json: schema: $ref: '#/components/schemas/ThrottlingException' '500': description: InternalServerException content: application/json: schema: $ref: '#/components/schemas/InternalServerException' delete: operationId: DeleteResourcePolicy summary: Removes an existing policy from a bot or bot alias description: Removes an existing policy from a bot or bot alias. If the resource doesn't have a policy attached, Amazon Lex returns an exception. tags: - Policy parameters: - name: resourceArn in: path required: true description: The Amazon Resource Name (ARN) of the bot or bot alias that has the resource policy attached. schema: type: string minLength: 1 maxLength: 1011 - name: expectedRevisionId in: query required: false description: The identifier of the revision to edit. If this ID doesn't match the current revision number, Amazon Lex returns an exception If you don't specify a revision ID, Amazon Lex will delete the current policy. schema: type: string minLength: 1 maxLength: 5 pattern: ^[0-9]+$ responses: '204': description: Success content: application/json: schema: $ref: '#/components/schemas/DeleteResourcePolicyResponse' '404': description: ResourceNotFoundException content: application/json: schema: $ref: '#/components/schemas/ResourceNotFoundException' '412': description: PreconditionFailedException content: application/json: schema: $ref: '#/components/schemas/PreconditionFailedException' '429': description: ThrottlingException content: application/json: schema: $ref: '#/components/schemas/ThrottlingException' '500': description: InternalServerException content: application/json: schema: $ref: '#/components/schemas/InternalServerException' get: operationId: DescribeResourcePolicy summary: Gets the resource policy and policy revision for a bot or bot alias description: Gets the resource policy and policy revision for a bot or bot alias. tags: - Policy parameters: - name: resourceArn in: path required: true description: The Amazon Resource Name (ARN) of the bot or bot alias that the resource policy is attached to. schema: type: string minLength: 1 maxLength: 1011 responses: '200': description: Success content: application/json: schema: $ref: '#/components/schemas/DescribeResourcePolicyResponse' '404': description: ResourceNotFoundException content: application/json: schema: $ref: '#/components/schemas/ResourceNotFoundException' '429': description: ThrottlingException content: application/json: schema: $ref: '#/components/schemas/ThrottlingException' '500': description: InternalServerException content: application/json: schema: $ref: '#/components/schemas/InternalServerException' put: operationId: UpdateResourcePolicy summary: Replaces the existing resource policy for a bot or bot alias with a new one description: 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. tags: - Policy parameters: - name: resourceArn in: path required: true description: The Amazon Resource Name (ARN) of the bot or bot alias that the resource policy is attached to. schema: type: string minLength: 1 maxLength: 1011 - name: expectedRevisionId in: query required: false description: 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. If you don't specify a revision, Amazon Lex overwrites the contents of the policy with the new values. schema: type: string minLength: 1 maxLength: 5 pattern: ^[0-9]+$ requestBody: required: true content: application/json: schema: type: object properties: policy: type: string minLength: 2 description: 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 IAM JSON policy reference . If the policy isn't valid, Amazon Lex returns a validation exception. required: - policy responses: '200': description: Success content: application/json: schema: $ref: '#/components/schemas/UpdateResourcePolicyResponse' '400': description: ValidationException content: application/json: schema: $ref: '#/components/schemas/ValidationException' '402': description: ServiceQuotaExceededException content: application/json: schema: $ref: '#/components/schemas/ServiceQuotaExceededException' '404': description: ResourceNotFoundException content: application/json: schema: $ref: '#/components/schemas/ResourceNotFoundException' '412': description: PreconditionFailedException content: application/json: schema: $ref: '#/components/schemas/PreconditionFailedException' '429': description: ThrottlingException content: application/json: schema: $ref: '#/components/schemas/ThrottlingException' '500': description: InternalServerException content: application/json: schema: $ref: '#/components/schemas/InternalServerException' /policy/{resourceArn}/statements: post: operationId: CreateResourcePolicyStatement summary: Adds a new resource policy statement to a bot or bot alias description: 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. You need to add the CreateResourcePolicy or UpdateResourcePolicy action to the bot role in order to call the API. tags: - Policy parameters: - name: resourceArn in: path required: true description: The Amazon Resource Name (ARN) of the bot or bot alias that the resource policy is attached to. schema: type: string minLength: 1 maxLength: 1011 - name: expectedRevisionId in: query required: false description: The identifier of the revision of the policy to edit. If this revision ID doesn't match the current revision ID, Amazon Lex throws an exception. If you don't specify a revision, Amazon Lex overwrites the contents of the policy with the new values. schema: type: string minLength: 1 maxLength: 5 pattern: ^[0-9]+$ requestBody: required: true content: application/json: schema: type: object properties: statementId: type: string minLength: 1 maxLength: 100 pattern: ^([0-9a-zA-Z][_-]?){1,100}$ description: 'The name of the statement. The ID is the same as the Sid IAM property. The statement name must be unique within the policy. For more information, see IAM JSON policy elements: Sid.' effect: type: string enum: - Allow - Deny description: Determines whether the statement allows or denies access to the resource. principal: type: array items: $ref: '#/components/schemas/Principal' action: type: array items: type: string minLength: 5 maxLength: 50 pattern: ^lex:[a-zA-Z*]+$ condition: type: object additionalProperties: type: object additionalProperties: type: string minLength: 1 maxLength: 1024 required: - statementId - effect - principal - action responses: '200': description: Success content: application/json: schema: $ref: '#/components/schemas/CreateResourcePolicyStatementResponse' '400': description: ValidationException content: application/json: schema: $ref: '#/components/schemas/ValidationException' '402': description: ServiceQuotaExceededException content: application/json: schema: $ref: '#/components/schemas/ServiceQuotaExceededException' '404': description: ResourceNotFoundException content: application/json: schema: $ref: '#/components/schemas/ResourceNotFoundException' '409': description: ConflictException content: application/json: schema: $ref: '#/components/schemas/ConflictException' '412': description: PreconditionFailedException content: application/json: schema: $ref: '#/components/schemas/PreconditionFailedException' '429': description: ThrottlingException content: application/json: schema: $ref: '#/components/schemas/ThrottlingException' '500': description: InternalServerException content: application/json: schema: $ref: '#/components/schemas/InternalServerException' /policy/{resourceArn}/statements/{statementId}: delete: operationId: DeleteResourcePolicyStatement summary: Deletes a policy statement from a resource policy description: Deletes a policy statement from a resource policy. If you delete the last statement from a policy, the policy is deleted. If you specify a statement ID that doesn't exist in the policy, or if the bot or bot alias doesn't have a policy attached, Amazon Lex returns an exception. You need to add the DeleteResourcePolicy or UpdateResourcePolicy action to the bot role in order to call the API. tags: - Policy parameters: - name: resourceArn in: path required: true description: The Amazon Resource Name (ARN) of the bot or bot alias that the resource policy is attached to. schema: type: string minLength: 1 maxLength: 1011 - name: statementId in: path required: true description: The name of the statement (SID) to delete from the policy. schema: type: string minLength: 1 maxLength: 100 pattern: ^([0-9a-zA-Z][_-]?){1,100}$ - name: expectedRevisionId in: query required: false description: The identifier of the revision of the policy to delete the statement from. If this revision ID doesn't match the current revision ID, Amazon Lex throws an exception. If you don't specify a revision, Amazon Lex removes the current contents of the statement. schema: type: string minLength: 1 maxLength: 5 pattern: ^[0-9]+$ responses: '204': description: Success content: application/json: schema: $ref: '#/components/schemas/DeleteResourcePolicyStatementResponse' '404': description: ResourceNotFoundException content: application/json: schema: $ref: '#/components/schemas/ResourceNotFoundException' '412': description: PreconditionFailedException content: application/json: schema: $ref: '#/components/schemas/PreconditionFailedException' '429': description: ThrottlingException content: application/json: schema: $ref: '#/components/schemas/ThrottlingException' '500': description: InternalServerException content: application/json: schema: $ref: '#/components/schemas/InternalServerException' components: schemas: DescribeResourcePolicyResponse: type: object properties: resourceArn: type: string minLength: 1 maxLength: 1011 description: The Amazon Resource Name (ARN) of the bot or bot alias that the resource policy is attached to. policy: type: string minLength: 2 description: The JSON structure that contains the resource policy. For more information about the contents of a JSON policy document, see IAM JSON policy reference . revisionId: type: string minLength: 1 maxLength: 5 pattern: ^[0-9]+$ description: 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. InternalServerException: type: object description: The service encountered an unexpected condition. Try your request again. properties: message: type: string CreateResourcePolicyResponse: type: object properties: resourceArn: type: string minLength: 1 maxLength: 1011 description: The Amazon Resource Name (ARN) of the bot or bot alias that the resource policy was attached to. revisionId: type: string minLength: 1 maxLength: 5 pattern: ^[0-9]+$ description: 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. ResourceNotFoundException: type: object description: You asked to describe a resource that doesn't exist. Check the resource that you are requesting and try again. properties: message: type: string DeleteResourcePolicyStatementResponse: type: object properties: resourceArn: type: string minLength: 1 maxLength: 1011 description: The Amazon Resource Name (ARN) of the bot or bot alias that the resource policy statement was removed from. revisionId: type: string minLength: 1 maxLength: 5 pattern: ^[0-9]+$ description: 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. ConflictException: type: object description: The action that you tried to perform couldn't be completed because the resource is in a conflicting state. For example, deleting a bot that is in the CREATING state. Try your request again. properties: message: type: string Principal: type: object description: 'The IAM principal that you allowing or denying access to an Amazon Lex action. You must provide a service or an arn, but not both in the same statement. For more information, see AWS JSON policy elements: Principal .' properties: service: type: string minLength: 15 maxLength: 1024 pattern: ^[0-9a-zA-Z_.]+$ description: The name of the Amazon Web Services service that should allowed or denied access to an Amazon Lex action. arn: type: string minLength: 30 maxLength: 1024 pattern: ^arn:aws:iam::[0-9]{12}:(root|(user|role)/.*)$ description: The Amazon Resource Name (ARN) of the principal. UpdateResourcePolicyResponse: type: object properties: resourceArn: type: string minLength: 1 maxLength: 1011 description: The Amazon Resource Name (ARN) of the bot or bot alias that the resource policy is attached to. revisionId: type: string minLength: 1 maxLength: 5 pattern: ^[0-9]+$ description: 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. PreconditionFailedException: type: object description: Your request couldn't be completed because one or more request fields aren't valid. Check the fields in your request and try again. properties: message: type: string CreateResourcePolicyStatementResponse: type: object properties: resourceArn: type: string minLength: 1 maxLength: 1011 description: The Amazon Resource Name (ARN) of the bot or bot alias that the resource policy is attached to. revisionId: type: string minLength: 1 maxLength: 5 pattern: ^[0-9]+$ description: 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. ThrottlingException: type: object description: Your request rate is too high. Reduce the frequency of requests. properties: retryAfterSeconds: type: integer description: The number of seconds after which the user can invoke the API again. message: type: string ValidationException: type: object description: One of the input parameters in your request isn't valid. Check the parameters and try your request again. properties: message: type: string ServiceQuotaExceededException: type: object description: You have reached a quota for your bot. properties: message: type: string DeleteResourcePolicyResponse: type: object properties: resourceArn: type: string minLength: 1 maxLength: 1011 description: The Amazon Resource Name (ARN) of the bot or bot alias that the resource policy was deleted from. revisionId: type: string minLength: 1 maxLength: 5 pattern: ^[0-9]+$ description: 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. securitySchemes: sigv4: type: apiKey name: Authorization in: header x-amazon-apigateway-authtype: awsSigv4 description: AWS Signature Version 4. Sign requests with SigV4 using service name `lex` and the calling region.