Amazon Athena Prepared Statements API

Operations for managing prepared SQL statements

GitHub OpenAPI

Operations 6

POST /#BatchGetPreparedStatement Batch Get Prepared Statement #
POST /#CreatePreparedStatement Create Prepared Statement #
POST /#DeletePreparedStatement Delete Prepared Statement #
POST /#GetPreparedStatement Get Prepared Statement #
POST /#ListPreparedStatements List Prepared Statements #
POST /#UpdatePreparedStatement Update Prepared Statement #

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-athena:amazon-athena-prepared-statements-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. By signing up you are subscribing to the APIs.io and API Evangelist newsletters — you can unsubscribe from any issue. See our Privacy Policy and Terms.

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

OpenAPI Specification

amazon-athena-prepared-statements-api-openapi.yml Raw ↑
openapi: 3.1.0
info:
  title: Amazon Athena Prepared Statements API
  version: '2017-05-18'
  description: Generated from AWS's published Smithy model for Amazon Athena. 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://athena.{region}.amazonaws.com
  variables:
    region:
      default: us-east-1
security:
- sigv4: []
paths:
  /#BatchGetPreparedStatement:
    post:
      operationId: BatchGetPreparedStatement
      summary: Batch Get Prepared Statement
      description: Returns the details of a single prepared statement or a list of up to 256 prepared statements for the array
        of prepared statement names that you provide. Requires you to have access to the workgroup to which the prepared statements
        belong. If a prepared statement cannot be retrieved for the name specified, the statement is listed in UnprocessedPreparedStatementNames.
      responses:
        '200':
          description: Success
          content:
            application/x-amz-json-1.1:
              schema:
                $ref: '#/components/schemas/BatchGetPreparedStatementOutput'
        '500':
          description: InternalServerException
          content:
            application/x-amz-json-1.1:
              schema:
                $ref: '#/components/schemas/InternalServerException'
        '400':
          description: InvalidRequestException
          content:
            application/x-amz-json-1.1:
              schema:
                $ref: '#/components/schemas/InvalidRequestException'
      parameters:
      - name: X-Amz-Target
        in: header
        required: true
        schema:
          type: string
          enum:
          - AmazonAthena.BatchGetPreparedStatement
      requestBody:
        required: true
        content:
          application/x-amz-json-1.1:
            schema:
              $ref: '#/components/schemas/BatchGetPreparedStatementInput'
      tags:
      - Prepared Statements
  /#CreatePreparedStatement:
    post:
      operationId: CreatePreparedStatement
      summary: Create Prepared Statement
      description: Creates a prepared statement for use with SQL queries in Athena.
      responses:
        '200':
          description: Success
          content:
            application/x-amz-json-1.1:
              schema:
                $ref: '#/components/schemas/CreatePreparedStatementOutput'
        '500':
          description: InternalServerException
          content:
            application/x-amz-json-1.1:
              schema:
                $ref: '#/components/schemas/InternalServerException'
        '400':
          description: InvalidRequestException
          content:
            application/x-amz-json-1.1:
              schema:
                $ref: '#/components/schemas/InvalidRequestException'
      parameters:
      - name: X-Amz-Target
        in: header
        required: true
        schema:
          type: string
          enum:
          - AmazonAthena.CreatePreparedStatement
      requestBody:
        required: true
        content:
          application/x-amz-json-1.1:
            schema:
              $ref: '#/components/schemas/CreatePreparedStatementInput'
      tags:
      - Prepared Statements
  /#DeletePreparedStatement:
    post:
      operationId: DeletePreparedStatement
      summary: Delete Prepared Statement
      description: Deletes the prepared statement with the specified name from the specified workgroup.
      responses:
        '200':
          description: Success
          content:
            application/x-amz-json-1.1:
              schema:
                $ref: '#/components/schemas/DeletePreparedStatementOutput'
        '500':
          description: InternalServerException
          content:
            application/x-amz-json-1.1:
              schema:
                $ref: '#/components/schemas/InternalServerException'
        '400':
          description: InvalidRequestException; ResourceNotFoundException
          content:
            application/x-amz-json-1.1:
              schema:
                $ref: '#/components/schemas/InvalidRequestException'
      parameters:
      - name: X-Amz-Target
        in: header
        required: true
        schema:
          type: string
          enum:
          - AmazonAthena.DeletePreparedStatement
      requestBody:
        required: true
        content:
          application/x-amz-json-1.1:
            schema:
              $ref: '#/components/schemas/DeletePreparedStatementInput'
      tags:
      - Prepared Statements
  /#GetPreparedStatement:
    post:
      operationId: GetPreparedStatement
      summary: Get Prepared Statement
      description: Retrieves the prepared statement with the specified name from the specified workgroup.
      responses:
        '200':
          description: Success
          content:
            application/x-amz-json-1.1:
              schema:
                $ref: '#/components/schemas/GetPreparedStatementOutput'
        '500':
          description: InternalServerException
          content:
            application/x-amz-json-1.1:
              schema:
                $ref: '#/components/schemas/InternalServerException'
        '400':
          description: InvalidRequestException; ResourceNotFoundException
          content:
            application/x-amz-json-1.1:
              schema:
                $ref: '#/components/schemas/InvalidRequestException'
      parameters:
      - name: X-Amz-Target
        in: header
        required: true
        schema:
          type: string
          enum:
          - AmazonAthena.GetPreparedStatement
      requestBody:
        required: true
        content:
          application/x-amz-json-1.1:
            schema:
              $ref: '#/components/schemas/GetPreparedStatementInput'
      tags:
      - Prepared Statements
  /#ListPreparedStatements:
    post:
      operationId: ListPreparedStatements
      summary: List Prepared Statements
      description: Lists the prepared statements in the specified workgroup.
      responses:
        '200':
          description: Success
          content:
            application/x-amz-json-1.1:
              schema:
                $ref: '#/components/schemas/ListPreparedStatementsOutput'
        '500':
          description: InternalServerException
          content:
            application/x-amz-json-1.1:
              schema:
                $ref: '#/components/schemas/InternalServerException'
        '400':
          description: InvalidRequestException
          content:
            application/x-amz-json-1.1:
              schema:
                $ref: '#/components/schemas/InvalidRequestException'
      parameters:
      - name: X-Amz-Target
        in: header
        required: true
        schema:
          type: string
          enum:
          - AmazonAthena.ListPreparedStatements
      requestBody:
        required: true
        content:
          application/x-amz-json-1.1:
            schema:
              $ref: '#/components/schemas/ListPreparedStatementsInput'
      tags:
      - Prepared Statements
  /#UpdatePreparedStatement:
    post:
      operationId: UpdatePreparedStatement
      summary: Update Prepared Statement
      description: Updates a prepared statement.
      responses:
        '200':
          description: Success
          content:
            application/x-amz-json-1.1:
              schema:
                $ref: '#/components/schemas/UpdatePreparedStatementOutput'
        '500':
          description: InternalServerException
          content:
            application/x-amz-json-1.1:
              schema:
                $ref: '#/components/schemas/InternalServerException'
        '400':
          description: InvalidRequestException; ResourceNotFoundException
          content:
            application/x-amz-json-1.1:
              schema:
                $ref: '#/components/schemas/InvalidRequestException'
      parameters:
      - name: X-Amz-Target
        in: header
        required: true
        schema:
          type: string
          enum:
          - AmazonAthena.UpdatePreparedStatement
      requestBody:
        required: true
        content:
          application/x-amz-json-1.1:
            schema:
              $ref: '#/components/schemas/UpdatePreparedStatementInput'
      tags:
      - Prepared Statements
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: athena
  schemas:
    BatchGetPreparedStatementInput:
      type: object
      properties:
        PreparedStatementNames:
          type: array
          items:
            type: string
          description: A list of prepared statement names to return.
        WorkGroup:
          type: string
          description: The name of the workgroup to which the prepared statements belong.
      required:
      - PreparedStatementNames
      - WorkGroup
    BatchGetPreparedStatementOutput:
      type: object
      properties:
        PreparedStatements:
          type: array
          items:
            $ref: '#/components/schemas/PreparedStatement'
          description: The list of prepared statements returned.
        UnprocessedPreparedStatementNames:
          type: array
          items:
            $ref: '#/components/schemas/UnprocessedPreparedStatementName'
          description: A list of one or more prepared statements that were requested but could not be returned.
    CreatePreparedStatementInput:
      type: object
      properties:
        StatementName:
          type: string
          description: The name of the prepared statement.
        WorkGroup:
          type: string
          description: The name of the workgroup to which the prepared statement belongs.
        QueryStatement:
          type: string
          description: The query string for the prepared statement.
        Description:
          type: string
          description: The description of the prepared statement.
      required:
      - StatementName
      - WorkGroup
      - QueryStatement
    CreatePreparedStatementOutput:
      type: object
      properties: {}
    DeletePreparedStatementInput:
      type: object
      properties:
        StatementName:
          type: string
          description: The name of the prepared statement to delete.
        WorkGroup:
          type: string
          description: The workgroup to which the statement to be deleted belongs.
      required:
      - StatementName
      - WorkGroup
    DeletePreparedStatementOutput:
      type: object
      properties: {}
    GetPreparedStatementInput:
      type: object
      properties:
        StatementName:
          type: string
          description: The name of the prepared statement to retrieve.
        WorkGroup:
          type: string
          description: The workgroup to which the statement to be retrieved belongs.
      required:
      - StatementName
      - WorkGroup
    GetPreparedStatementOutput:
      type: object
      properties:
        PreparedStatement:
          $ref: '#/components/schemas/PreparedStatement'
    InternalServerException:
      type: object
      properties:
        Message:
          type: string
    InvalidRequestException:
      type: object
      properties:
        AthenaErrorCode:
          type: string
        Message:
          type: string
    ListPreparedStatementsInput:
      type: object
      properties:
        WorkGroup:
          type: string
          description: The workgroup to list the prepared statements for.
        NextToken:
          type: string
          description: A token generated by the Athena service that specifies where to continue pagination if a previous request
            was truncated. To obtain the next set of pages, pass in the NextToken from the response object of the previous
            page call.
        MaxResults:
          type: integer
          description: The maximum number of results to return in this request.
      required:
      - WorkGroup
    ListPreparedStatementsOutput:
      type: object
      properties:
        PreparedStatements:
          type: array
          items:
            $ref: '#/components/schemas/PreparedStatementSummary'
          description: The list of prepared statements for the workgroup.
        NextToken:
          type: string
          description: A token generated by the Athena service that specifies where to continue pagination if a previous request
            was truncated. To obtain the next set of pages, pass in the NextToken from the response object of the previous
            page call.
    PreparedStatement:
      type: object
      properties:
        StatementName:
          type: string
          description: The name of the prepared statement.
        QueryStatement:
          type: string
          description: The query string for the prepared statement.
        WorkGroupName:
          type: string
          description: The name of the workgroup to which the prepared statement belongs.
        Description:
          type: string
          description: The description of the prepared statement.
        LastModifiedTime:
          type: string
          format: date-time
          description: The last modified time of the prepared statement.
    PreparedStatementSummary:
      type: object
      properties:
        StatementName:
          type: string
          description: The name of the prepared statement.
        LastModifiedTime:
          type: string
          format: date-time
          description: The last modified time of the prepared statement.
    UnprocessedPreparedStatementName:
      type: object
      properties:
        StatementName:
          type: string
          description: The name of a prepared statement that could not be returned due to an error.
        ErrorCode:
          type: string
          description: The error code returned when the request for the prepared statement failed.
        ErrorMessage:
          type: string
          description: 'The error message containing the reason why the prepared statement could not be returned. The following
            error messages are possible: INVALID_INPUT - The name of the prepared statement that was provided is not valid
            (for example, the name is too long). STATEMENT_NOT_FOUND - A prepared statement with the name provided could not
            be found. UNAUTHORIZED - The requester does not have permission to access the workgroup that contains the prepared
            statement.'
    UpdatePreparedStatementInput:
      type: object
      properties:
        StatementName:
          type: string
          description: The name of the prepared statement.
        WorkGroup:
          type: string
          description: The workgroup for the prepared statement.
        QueryStatement:
          type: string
          description: The query string for the prepared statement.
        Description:
          type: string
          description: The description of the prepared statement.
      required:
      - StatementName
      - WorkGroup
      - QueryStatement
    UpdatePreparedStatementOutput:
      type: object
      properties: {}
x-provenance:
  method: harvested
  publisher: Amazon Web Services
  source: https://raw.githubusercontent.com/aws/api-models-aws/3cd98287b471c106254abd89279cc87308d38bfd/models/athena/service/2017-05-18/athena-2017-05-18.json
  note: converted by smithy-to-openapi.py from AWS's Smithy model (roadmap#1001)