Amazon Lex Policy API

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

GitHub OpenAPI

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 · Create Resource Policy #
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 · Delete Resource Policy #
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 · Describe Resource Policy #
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 · Update Resource Policy #
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 · Create Resource Policy Statement #
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 · Delete Resource Policy Statement #
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}.

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"

Calls without X-API-Key need no key. Calls with it need a paid plan — get a key.

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.1.0
info:
  title: Amazon Lex Model Building V2 Policy API
  version: '2020-08-07'
  description: Generated from AWS's published Smithy model for Amazon Lex Model Building V2. 6 operation(s).
  contact:
    name: Amazon Web Services
    url: https://aws.amazon.com/contact-us/
  license:
    name: Apache 2.0
    identifier: Apache-2.0
    url: https://github.com/aws/api-models-aws/blob/main/LICENSE
servers:
- url: https://models-v2-lex.{region}.amazonaws.com
  variables:
    region:
      default: us-east-1
security:
- sigv4: []
paths:
  /policy/{resourceArn}:
    post:
      operationId: CreateResourcePolicy
      summary: Create Resource Policy
      description: Creates a new resource policy with the specified policy statements.
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CreateResourcePolicyResponse'
        '500':
          description: InternalServerException
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/InternalServerException'
        '412':
          description: PreconditionFailedException
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PreconditionFailedException'
        '404':
          description: ResourceNotFoundException
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ResourceNotFoundException'
        '402':
          description: ServiceQuotaExceededException
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ServiceQuotaExceededException'
        '429':
          description: ThrottlingException
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ThrottlingException'
        '400':
          description: ValidationException
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ValidationException'
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateResourcePolicyRequest'
      tags:
      - Policy
    delete:
      operationId: DeleteResourcePolicy
      summary: Delete Resource Policy
      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.
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DeleteResourcePolicyResponse'
        '500':
          description: InternalServerException
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/InternalServerException'
        '412':
          description: PreconditionFailedException
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PreconditionFailedException'
        '404':
          description: ResourceNotFoundException
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ResourceNotFoundException'
        '429':
          description: ThrottlingException
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ThrottlingException'
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/DeleteResourcePolicyRequest'
      tags:
      - Policy
    get:
      operationId: DescribeResourcePolicy
      summary: Describe Resource Policy
      description: Gets the resource policy and policy revision for a bot or bot alias.
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DescribeResourcePolicyResponse'
        '500':
          description: InternalServerException
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/InternalServerException'
        '404':
          description: ResourceNotFoundException
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ResourceNotFoundException'
        '429':
          description: ThrottlingException
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ThrottlingException'
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/DescribeResourcePolicyRequest'
      tags:
      - Policy
    put:
      operationId: UpdateResourcePolicy
      summary: Update Resource Policy
      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.
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UpdateResourcePolicyResponse'
        '500':
          description: InternalServerException
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/InternalServerException'
        '412':
          description: PreconditionFailedException
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PreconditionFailedException'
        '404':
          description: ResourceNotFoundException
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ResourceNotFoundException'
        '402':
          description: ServiceQuotaExceededException
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ServiceQuotaExceededException'
        '429':
          description: ThrottlingException
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ThrottlingException'
        '400':
          description: ValidationException
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ValidationException'
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpdateResourcePolicyRequest'
      tags:
      - Policy
  /policy/{resourceArn}/statements:
    post:
      operationId: CreateResourcePolicyStatement
      summary: Create Resource Policy Statement
      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.
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CreateResourcePolicyStatementResponse'
        '409':
          description: ConflictException
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ConflictException'
        '500':
          description: InternalServerException
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/InternalServerException'
        '412':
          description: PreconditionFailedException
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PreconditionFailedException'
        '404':
          description: ResourceNotFoundException
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ResourceNotFoundException'
        '402':
          description: ServiceQuotaExceededException
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ServiceQuotaExceededException'
        '429':
          description: ThrottlingException
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ThrottlingException'
        '400':
          description: ValidationException
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ValidationException'
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateResourcePolicyStatementRequest'
      tags:
      - Policy
  /policy/{resourceArn}/statements/{statementId}:
    delete:
      operationId: DeleteResourcePolicyStatement
      summary: Delete Resource Policy Statement
      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.
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DeleteResourcePolicyStatementResponse'
        '500':
          description: InternalServerException
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/InternalServerException'
        '412':
          description: PreconditionFailedException
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PreconditionFailedException'
        '404':
          description: ResourceNotFoundException
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ResourceNotFoundException'
        '429':
          description: ThrottlingException
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ThrottlingException'
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/DeleteResourcePolicyStatementRequest'
      tags:
      - Policy
components:
  securitySchemes:
    sigv4:
      type: apiKey
      in: header
      name: Authorization
      description: AWS Signature Version 4. The Authorization header carries an AWS4-HMAC-SHA256 signature over the canonical
        request, with X-Amz-Date (and X-Amz-Security-Token for temporary credentials). Not a bearer token.
      x-aws-sigv4:
        signingName: lex
  schemas:
    ConflictException:
      type: object
      properties:
        message:
          type: string
    CreateResourcePolicyRequest:
      type: object
      properties:
        resourceArn:
          type: string
          description: The Amazon Resource Name (ARN) of the bot or bot alias that the resource policy is attached to.
        policy:
          type: string
          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:
      - resourceArn
      - policy
    CreateResourcePolicyResponse:
      type: object
      properties:
        resourceArn:
          type: string
          description: The Amazon Resource Name (ARN) of the bot or bot alias that the resource policy was attached to.
        revisionId:
          type: string
          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.
    CreateResourcePolicyStatementRequest:
      type: object
      properties:
        resourceArn:
          type: string
          description: The Amazon Resource Name (ARN) of the bot or bot alias that the resource policy is attached to.
        statementId:
          type: string
          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'
          description: 'An IAM principal, such as an IAM user, IAM role, or Amazon Web Services services that is allowed or
            denied access to a resource. For more information, see Amazon Web Services JSON policy elements: Principal.'
        action:
          type: array
          items:
            type: string
          description: 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 Actions, resources, and condition keys for Amazon Lex V2.
        condition:
          type: object
          additionalProperties:
            type: object
            additionalProperties:
              type: string
          description: '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. For more information, see IAM JSON policy elements: Condition .'
        expectedRevisionId:
          type: string
          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.
      required:
      - resourceArn
      - statementId
      - effect
      - principal
      - action
    CreateResourcePolicyStatementResponse:
      type: object
      properties:
        resourceArn:
          type: string
          description: The Amazon Resource Name (ARN) of the bot or bot alias that the resource policy is attached to.
        revisionId:
          type: string
          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.
    DeleteResourcePolicyRequest:
      type: object
      properties:
        resourceArn:
          type: string
          description: The Amazon Resource Name (ARN) of the bot or bot alias that has the resource policy attached.
        expectedRevisionId:
          type: string
          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.
      required:
      - resourceArn
    DeleteResourcePolicyResponse:
      type: object
      properties:
        resourceArn:
          type: string
          description: The Amazon Resource Name (ARN) of the bot or bot alias that the resource policy was deleted from.
        revisionId:
          type: string
          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.
    DeleteResourcePolicyStatementRequest:
      type: object
      properties:
        resourceArn:
          type: string
          description: The Amazon Resource Name (ARN) of the bot or bot alias that the resource policy is attached to.
        statementId:
          type: string
          description: The name of the statement (SID) to delete from the policy.
        expectedRevisionId:
          type: string
          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.
      required:
      - resourceArn
      - statementId
    DeleteResourcePolicyStatementResponse:
      type: object
      properties:
        resourceArn:
          type: string
          description: The Amazon Resource Name (ARN) of the bot or bot alias that the resource policy statement was removed
            from.
        revisionId:
          type: string
          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.
    DescribeResourcePolicyRequest:
      type: object
      properties:
        resourceArn:
          type: string
          description: The Amazon Resource Name (ARN) of the bot or bot alias that the resource policy is attached to.
      required:
      - resourceArn
    DescribeResourcePolicyResponse:
      type: object
      properties:
        resourceArn:
          type: string
          description: The Amazon Resource Name (ARN) of the bot or bot alias that the resource policy is attached to.
        policy:
          type: string
          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
          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
      properties:
        message:
          type: string
    PreconditionFailedException:
      type: object
      properties:
        message:
          type: string
    Principal:
      type: object
      properties:
        service:
          type: string
          description: The name of the Amazon Web Services service that should allowed or denied access to an Amazon Lex action.
        arn:
          type: string
          description: The Amazon Resource Name (ARN) of the principal.
    ResourceNotFoundException:
      type: object
      properties:
        message:
          type: string
    ServiceQuotaExceededException:
      type: object
      properties:
        message:
          type: string
    ThrottlingException:
      type: object
      properties:
        retryAfterSeconds:
          type: integer
          description: The number of seconds after which the user can invoke the API again.
        message:
          type: string
    UpdateResourcePolicyRequest:
      type: object
      properties:
        resourceArn:
          type: string
          description: The Amazon Resource Name (ARN) of the bot or bot alias that the resource policy is attached to.
        policy:
          type: string
          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.
        expectedRevisionId:
          type: string
          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.
      required:
      - resourceArn
      - policy
    UpdateResourcePolicyResponse:
      type: object
      properties:
        resourceArn:
          type: string
          description: The Amazon Resource Name (ARN) of the bot or bot alias that the resource policy is attached to.
        revisionId:
          type: string
          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.
    ValidationException:
      type: object
      properties:
        message:
          type: string
x-provenance:
  method: harvested
  publisher: Amazon Web Services
  source: https://raw.githubusercontent.com/aws/api-models-aws/3cd98287b471c106254abd89279cc87308d38bfd/models/lex-models-v2/service/2020-08-07/lex-models-v2-2020-08-07.json
  note: converted by smithy-to-openapi.py from AWS's Smithy model (roadmap#1001)