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

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

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

Retrieves the prepared statement with the specified name from the specified workgroup.

## Headers

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

## Request body

- GetPreparedStatementInput
  - `StatementName` string, required — The name of the prepared statement to retrieve.
  - `WorkGroup` string, required — The workgroup to which the statement to be retrieved belongs.

## Response `200`

Success

- GetPreparedStatementOutput
  - `PreparedStatement` object — The name of the prepared statement that was retrieved.
    - `StatementName` string — The name of the prepared statement.
    - `QueryStatement` string — The query string for the prepared statement.
    - `WorkGroupName` string — The name of the workgroup to which the prepared statement belongs.
    - `Description` string — The description of the prepared statement.
    - `LastModifiedTime` string, date-time — The last modified time of the prepared statement.

## Other responses

- `480` — InternalServerException
- `481` — InvalidRequestException
- `482` — ResourceNotFoundException

---

[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)
