---
title: "POST /#X-Amz-Target=AmazonAthena.BatchGetNamedQuery"
method: POST
path: "/#X-Amz-Target=AmazonAthena.BatchGetNamedQuery"
---

# POST /#X-Amz-Target=AmazonAthena.BatchGetNamedQuery

`POST /#X-Amz-Target=AmazonAthena.BatchGetNamedQuery`

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 <a>ListNamedQueriesInput</a> 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 <a>UnprocessedNamedQueryId</a>. Named queries differ from executed queries. Use <a>BatchGetQueryExecutionInput</a> to get details about each unique query execution, and <a>ListQueryExecutionsInput</a> to get a list of query execution IDs.

## Headers

- `X-Amz-Target` 'AmazonAthena.BatchGetNamedQuery', required

## Request body

- BatchGetNamedQueryInput — Contains an array of named query IDs.
  - `NamedQueryIds` NamedQueryId[], required — An array of query IDs.

## Response `200`

Success

- BatchGetNamedQueryOutput
  - `NamedQueries` NamedQuery[] — Information about the named query IDs submitted.
    - `Name` string, required — The query name.
    - `Description` string — The query description.
    - `Database` string, required — The database to which the query belongs.
    - `QueryString` string, required — The SQL statements that make up the query.
    - `NamedQueryId` string — The unique identifier of the query.
    - `WorkGroup` string — The name of the workgroup that contains the named query.
  - `UnprocessedNamedQueryIds` UnprocessedNamedQueryId[] — Information about provided query IDs.
    - `NamedQueryId` string — The unique identifier of the named query.
    - `ErrorCode` string — The error code returned when the processing request for the named query failed, if applicable.
    - `ErrorMessage` string — The error message returned when the processing request for the named query failed, if applicable.

## Other responses

- `480` — InternalServerException
- `481` — InvalidRequestException

---

[API](https://skmtc.net/aws/apis/athena.md) · [All operations](https://skmtc.net/aws/apis/athena/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/aws/athena/versions/0aec8c61283d/schema)
