Amazon Lex Policy API

The policy API from Amazon Lex — 3 operation(s) for policy.

Operations 6

Each operation below carries the questions people ask an LLM about it and the instructions they give an agent to run it. Generated by API Evangelist overlay

POST /policy/{resourceArn} Attach a new resource policy to a bot · Creates a new resource policy with the specified policy statements #
Ask an LLM
“How do I attach a resource policy to a bot that doesn't have one yet?”
“Can I let another account access my bot with a new resource-based policy?”
Tell an agent
Create a resource policy {policy} on {resourceArn}.
Attach a brand-new policy to bot resource {resourceArn} using {policy}.
DELETE /policy/{resourceArn} Remove a bot's resource policy · Removes an existing policy from a bot or bot alias #
Ask an LLM
“How do I remove the entire resource policy from a bot or alias?”
“What happens if I delete a policy from a bot that has none attached?”
Tell an agent destructive · confirm first
Delete the resource policy on {resourceArn}.
Remove the whole policy from {resourceArn} if its revision is still {expectedRevisionId}.
GET /policy/{resourceArn} Get a bot's resource policy · Gets the resource policy and policy revision for a bot or bot alias #
Ask an LLM
“What resource policy is attached to my bot or bot alias?”
“Which revision is the current resource policy on a bot at?”
Tell an agent
Show the resource policy for {resourceArn}.
Get the policy document and revision ID attached to {resourceArn}.
PUT /policy/{resourceArn} Replace a bot's resource policy · Replaces the existing resource policy for a bot or bot alias with a new one #
Ask an LLM
“How do I replace the whole resource policy on a bot alias with a new document?”
“Can I guard a policy replacement so it fails if someone changed it since I read it?”
Tell an agent
Replace the resource policy on {resourceArn} with {policy}.
Overwrite the policy on {resourceArn} with {policy} only if the current revision is {expectedRevisionId}.
POST /policy/{resourceArn}/statements Add a statement to a bot's resource policy · Adds a new resource policy statement to a bot or bot alias #
Ask an LLM
“Can I grant one principal access to my bot by adding a single policy statement?”
“Does adding a statement create a policy if the bot doesn't have one?”
Tell an agent
Add statement {statementId} to the policy on {resourceArn} to {effect} {action} for {principal}.
Append policy statement {statementId} on {resourceArn}: {effect} {action} for {principal} when {condition}.
DELETE /policy/{resourceArn}/statements/{statementId} Remove one statement from a bot's policy · Deletes a policy statement from a resource policy #
Ask an LLM
“How do I revoke one principal's access by deleting a single policy statement?”
“Is the policy deleted if I remove its last statement?”
Tell an agent destructive · confirm first
Delete statement {statementId} from the policy on {resourceArn}.
Remove policy statement {statementId} on {resourceArn} at revision {expectedRevisionId}.

Documentation

Specifications

Schemas & Data

Other Resources

Work with this as data

Every API here is available over the APIs.io API and to AI agents over MCP.

MCP server

One button, every client — Claude, Cursor, VS Code and the rest.

https://apis.io/mcp

Tools for apis

7 MCP tools reach this
  • find_apisBrowse and filter every API in the catalog.
  • get_api_artifactsOne API's artifacts, grouped by type.
  • get_openapiThe primary OpenAPI for this API.
  • find_similar_apisAPIs that look like this one.
  • apis_io_searchSTART HERE — APIs, providers and tags for one query, each with its total.
  • resolveTurn a domain, URL or GitHub org into the provider it belongs to.
  • find_cohortsEvery scored population of providers in the catalog.
All 92 tools →

Call it yourself

curl for this page
This API
curl "https://apis.io/api/v1/apis/amazon-lex:amazon-lex-policy-api"
All apis
curl "https://apis.io/api/v1/apis?limit=25"

Discovery needs no key. Ratings and market analysis are Pro.

Get an API key

Free tier, no form to fill in. Signing in shares your email address with us — we store it to create your key and to recognise you if you sign in with another provider. See our Privacy Policy and Terms.

A second provider on the same verified email joins the account you already have.

OpenAPI Specification

amazon-lex-policy-api-openapi.yml Raw ↑
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.