Amazon Athena Named Queries API

Operations for creating and managing saved SQL queries

GitHub OpenAPI

Operations 6

POST /#BatchGetNamedQuery Batch Get Named Query #
POST /#CreateNamedQuery Create Named Query #
POST /#DeleteNamedQuery Delete Named Query #
POST /#GetNamedQuery Get Named Query #
POST /#ListNamedQueries List Named Queries #
POST /#UpdateNamedQuery Update Named Query #

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-named-queries-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-named-queries-api-openapi.yml Raw ↑
openapi: 3.1.0
info:
  title: Amazon Athena Named Queries 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:
  /#BatchGetNamedQuery:
    post:
      operationId: BatchGetNamedQuery
      summary: Batch Get Named Query
      description: Returns the details of a single named query or a list of up to 50 queries, which you provide as an array
        of query ID strings. Requires you to have access to the workgroup in which the queries were saved. Use ListNamedQueriesInput
        to get the list of named query IDs in the specified workgroup. If information could not be retrieved for a submitted
        query ID, information about the query ID submitted is listed under UnprocessedNamedQueryId. Named queries differ from
        executed queries. Use BatchGetQueryExecutionInput to get details about each unique query execution, and ListQueryExecutionsInput
        to get a list of query execution IDs.
      responses:
        '200':
          description: Success
          content:
            application/x-amz-json-1.1:
              schema:
                $ref: '#/components/schemas/BatchGetNamedQueryOutput'
        '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.BatchGetNamedQuery
      requestBody:
        required: true
        content:
          application/x-amz-json-1.1:
            schema:
              $ref: '#/components/schemas/BatchGetNamedQueryInput'
      tags:
      - Named Queries
  /#CreateNamedQuery:
    post:
      operationId: CreateNamedQuery
      summary: Create Named Query
      description: Creates a named query in the specified workgroup. Requires that you have access to the workgroup.
      responses:
        '200':
          description: Success
          content:
            application/x-amz-json-1.1:
              schema:
                $ref: '#/components/schemas/CreateNamedQueryOutput'
        '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.CreateNamedQuery
      requestBody:
        required: true
        content:
          application/x-amz-json-1.1:
            schema:
              $ref: '#/components/schemas/CreateNamedQueryInput'
      tags:
      - Named Queries
  /#DeleteNamedQuery:
    post:
      operationId: DeleteNamedQuery
      summary: Delete Named Query
      description: Deletes the named query if you have access to the workgroup in which the query was saved.
      responses:
        '200':
          description: Success
          content:
            application/x-amz-json-1.1:
              schema:
                $ref: '#/components/schemas/DeleteNamedQueryOutput'
        '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.DeleteNamedQuery
      requestBody:
        required: true
        content:
          application/x-amz-json-1.1:
            schema:
              $ref: '#/components/schemas/DeleteNamedQueryInput'
      tags:
      - Named Queries
  /#GetNamedQuery:
    post:
      operationId: GetNamedQuery
      summary: Get Named Query
      description: Returns information about a single query. Requires that you have access to the workgroup in which the query
        was saved.
      responses:
        '200':
          description: Success
          content:
            application/x-amz-json-1.1:
              schema:
                $ref: '#/components/schemas/GetNamedQueryOutput'
        '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.GetNamedQuery
      requestBody:
        required: true
        content:
          application/x-amz-json-1.1:
            schema:
              $ref: '#/components/schemas/GetNamedQueryInput'
      tags:
      - Named Queries
  /#ListNamedQueries:
    post:
      operationId: ListNamedQueries
      summary: List Named Queries
      description: Provides a list of available query IDs only for queries saved in the specified workgroup. Requires that
        you have access to the specified workgroup. If a workgroup is not specified, lists the saved queries for the primary
        workgroup.
      responses:
        '200':
          description: Success
          content:
            application/x-amz-json-1.1:
              schema:
                $ref: '#/components/schemas/ListNamedQueriesOutput'
        '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.ListNamedQueries
      requestBody:
        required: true
        content:
          application/x-amz-json-1.1:
            schema:
              $ref: '#/components/schemas/ListNamedQueriesInput'
      tags:
      - Named Queries
  /#UpdateNamedQuery:
    post:
      operationId: UpdateNamedQuery
      summary: Update Named Query
      description: Updates a NamedQuery object. The database or workgroup cannot be updated.
      responses:
        '200':
          description: Success
          content:
            application/x-amz-json-1.1:
              schema:
                $ref: '#/components/schemas/UpdateNamedQueryOutput'
        '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.UpdateNamedQuery
      requestBody:
        required: true
        content:
          application/x-amz-json-1.1:
            schema:
              $ref: '#/components/schemas/UpdateNamedQueryInput'
      tags:
      - Named Queries
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:
    BatchGetNamedQueryInput:
      type: object
      properties:
        NamedQueryIds:
          type: array
          items:
            type: string
          description: An array of query IDs.
      required:
      - NamedQueryIds
    BatchGetNamedQueryOutput:
      type: object
      properties:
        NamedQueries:
          type: array
          items:
            $ref: '#/components/schemas/NamedQuery'
          description: Information about the named query IDs submitted.
        UnprocessedNamedQueryIds:
          type: array
          items:
            $ref: '#/components/schemas/UnprocessedNamedQueryId'
          description: Information about provided query IDs.
    CreateNamedQueryInput:
      type: object
      properties:
        Name:
          type: string
          description: The query name.
        Description:
          type: string
          description: The query description.
        Database:
          type: string
          description: The database to which the query belongs.
        QueryString:
          type: string
          description: The contents of the query with all query statements.
        ClientRequestToken:
          type: string
          description: A unique case-sensitive string used to ensure the request to create the query is idempotent (executes
            only once). If another CreateNamedQuery request is received, the same response is returned and another query is
            not created. If a parameter has changed, for example, the QueryString, an error is returned. This token is listed
            as not required because Amazon Web Services SDKs (for example the Amazon Web Services SDK for Java) auto-generate
            the token for users. If you are not using the Amazon Web Services SDK or the Amazon Web Services CLI, you must
            provide this token or the action will fail.
        WorkGroup:
          type: string
          description: The name of the workgroup in which the named query is being created.
      required:
      - Name
      - Database
      - QueryString
    CreateNamedQueryOutput:
      type: object
      properties:
        NamedQueryId:
          type: string
          description: The unique ID of the query.
    DeleteNamedQueryInput:
      type: object
      properties:
        NamedQueryId:
          type: string
          description: The unique ID of the query to delete.
      required:
      - NamedQueryId
    DeleteNamedQueryOutput:
      type: object
      properties: {}
    GetNamedQueryInput:
      type: object
      properties:
        NamedQueryId:
          type: string
          description: The unique ID of the query. Use ListNamedQueries to get query IDs.
      required:
      - NamedQueryId
    GetNamedQueryOutput:
      type: object
      properties:
        NamedQuery:
          $ref: '#/components/schemas/NamedQuery'
    InternalServerException:
      type: object
      properties:
        Message:
          type: string
    InvalidRequestException:
      type: object
      properties:
        AthenaErrorCode:
          type: string
        Message:
          type: string
    ListNamedQueriesInput:
      type: object
      properties:
        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 queries to return in this request.
        WorkGroup:
          type: string
          description: The name of the workgroup from which the named queries are being returned. If a workgroup is not specified,
            the saved queries for the primary workgroup are returned.
    ListNamedQueriesOutput:
      type: object
      properties:
        NamedQueryIds:
          type: array
          items:
            type: string
          description: The list of unique query IDs.
        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.
    NamedQuery:
      type: object
      properties:
        Name:
          type: string
          description: The query name.
        Description:
          type: string
          description: The query description.
        Database:
          type: string
          description: The database to which the query belongs.
        QueryString:
          type: string
          description: The SQL statements that make up the query.
        NamedQueryId:
          type: string
          description: The unique identifier of the query.
        WorkGroup:
          type: string
          description: The name of the workgroup that contains the named query.
      required:
      - Name
      - Database
      - QueryString
    UnprocessedNamedQueryId:
      type: object
      properties:
        NamedQueryId:
          type: string
          description: The unique identifier of the named query.
        ErrorCode:
          type: string
          description: The error code returned when the processing request for the named query failed, if applicable.
        ErrorMessage:
          type: string
          description: The error message returned when the processing request for the named query failed, if applicable.
    UpdateNamedQueryInput:
      type: object
      properties:
        NamedQueryId:
          type: string
          description: The unique identifier (UUID) of the query.
        Name:
          type: string
          description: The name of the query.
        Description:
          type: string
          description: The query description.
        QueryString:
          type: string
          description: The contents of the query with all query statements.
      required:
      - NamedQueryId
      - Name
      - QueryString
    UpdateNamedQueryOutput:
      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)