Amazon Redshift Data API

The Amazon Redshift Data API for running SQL statements without managing connections. Supports asynchronous execution with IAM and Secrets Manager authentication.

OpenAPI Specification

amazon-redshift-data-api-openapi.yml Raw ↑
openapi: 3.1.0
info:
  title: Amazon Redshift Data API
  description: >-
    The Amazon Redshift Data API enables you to run SQL statements on Amazon
    Redshift clusters and Amazon Redshift Serverless workgroups without managing
    database connections or drivers. The Data API handles connection management,
    authentication via IAM or Secrets Manager, and supports asynchronous
    execution of SQL statements with result retrieval through a statement
    identifier. Ideal for building serverless applications, integrating with
    AWS Lambda, and running ad-hoc queries programmatically.
  version: '2019-12-20'
  contact:
    name: Amazon Web Services
    url: https://aws.amazon.com/redshift/
  termsOfService: https://aws.amazon.com/service-terms/
  license:
    name: Apache 2.0
    url: https://www.apache.org/licenses/LICENSE-2.0.html
externalDocs:
  description: Amazon Redshift Data API Reference
  url: https://docs.aws.amazon.com/redshift-data/latest/APIReference/Welcome.html
servers:
- url: https://redshift-data.{region}.amazonaws.com
  description: Amazon Redshift Data API regional endpoint
  variables:
    region:
      default: us-east-1
      description: AWS region identifier
      enum:
      - us-east-1
      - us-east-2
      - us-west-1
      - us-west-2
      - eu-west-1
      - eu-west-2
      - eu-central-1
      - ap-southeast-1
      - ap-southeast-2
      - ap-northeast-1
      - ap-northeast-2
      - ca-central-1
      - sa-east-1
tags:
- name: Metadata
  description: List databases, schemas, and tables in a Redshift data warehouse
- name: Result Retrieval
  description: Retrieve results from completed SQL statement executions
- name: Statement Execution
  description: Execute SQL statements against Amazon Redshift clusters or serverless workgroups
- name: Statement Management
  description: Describe, list, and cancel SQL statement executions
security:
- sigv4Auth: []
paths:
  /ExecuteStatement:
    post:
      operationId: executeStatement
      summary: Amazon Redshift Execute a Sql Statement
      description: >-
        Runs a SQL statement against an Amazon Redshift cluster or Amazon
        Redshift Serverless workgroup. The SQL statement runs asynchronously
        and returns a statement identifier that you can use to check the
        status with DescribeStatement and retrieve results with
        GetStatementResult. The maximum query result size is 100 MB.
      tags:
      - Statement Execution
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ExecuteStatementRequest'
      responses:
        '200':
          description: Statement submitted successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ExecuteStatementResponse'
        '400':
          description: Invalid request - validation error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ValidationException'
        '500':
          description: Internal server error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/InternalServerException'
        '503':
          description: Service temporarily unavailable - the cluster is paused
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ActiveStatementsExceededException'
      x-microcks-operation:
        delay: 0
        dispatcher: FALLBACK
  /BatchExecuteStatement:
    post:
      operationId: batchExecuteStatement
      summary: Amazon Redshift Execute Multiple Sql Statements in a Batch
      description: >-
        Runs one or more SQL statements as a batch, which run as a single
        transaction. The statements run serially in the order provided.
        Returns a statement identifier for the batch that you can use with
        DescribeStatement and GetStatementResult.
      tags:
      - Statement Execution
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/BatchExecuteStatementRequest'
      responses:
        '200':
          description: Batch statement submitted successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BatchExecuteStatementResponse'
        '400':
          description: Invalid request - validation error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ValidationException'
        '500':
          description: Internal server error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/InternalServerException'
      x-microcks-operation:
        delay: 0
        dispatcher: FALLBACK
  /DescribeStatement:
    post:
      operationId: describeStatement
      summary: Amazon Redshift Describe a Sql Statement Execution
      description: >-
        Describes the details about a specific SQL statement run, including
        the status, duration, result size, and error information. Use the
        statement identifier returned by ExecuteStatement or
        BatchExecuteStatement to identify the statement.
      tags:
      - Statement Management
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/DescribeStatementRequest'
      responses:
        '200':
          description: Statement details retrieved successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DescribeStatementResponse'
        '400':
          description: Invalid request - validation error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ValidationException'
        '404':
          description: Statement not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ResourceNotFoundException'
        '500':
          description: Internal server error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/InternalServerException'
      x-microcks-operation:
        delay: 0
        dispatcher: FALLBACK
  /ListStatements:
    post:
      operationId: listStatements
      summary: Amazon Redshift List Sql Statement Executions
      description: >-
        Lists SQL statements that have been submitted. By default, only
        finished statements are shown. You can filter by status and
        optionally include statements submitted by all IAM users by setting
        RoleLevel to true. Results are ordered by creation time, with the
        most recent statements listed first.
      tags:
      - Statement Management
      requestBody:
        required: false
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ListStatementsRequest'
      responses:
        '200':
          description: Statement list retrieved successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ListStatementsResponse'
        '400':
          description: Invalid request - validation error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ValidationException'
        '500':
          description: Internal server error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/InternalServerException'
      x-microcks-operation:
        delay: 0
        dispatcher: FALLBACK
  /CancelStatement:
    post:
      operationId: cancelStatement
      summary: Amazon Redshift Cancel a Running Sql Statement
      description: >-
        Cancels a running SQL statement. The statement must be in the
        STARTED or SUBMITTED state to be cancelled.
      tags:
      - Statement Management
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CancelStatementRequest'
      responses:
        '200':
          description: Statement cancelled successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CancelStatementResponse'
        '400':
          description: Invalid request - validation error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ValidationException'
        '404':
          description: Statement not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ResourceNotFoundException'
        '500':
          description: Internal server error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/InternalServerException'
      x-microcks-operation:
        delay: 0
        dispatcher: FALLBACK
  /GetStatementResult:
    post:
      operationId: getStatementResult
      summary: Amazon Redshift Get the Results of a Sql Statement
      description: >-
        Fetches the result of a SQL statement that was submitted with
        ExecuteStatement or BatchExecuteStatement. The statement must have
        completed successfully (status FINISHED). Results are paginated and
        the maximum result size is 100 MB. Use the NextToken parameter to
        retrieve subsequent pages.
      tags:
      - Result Retrieval
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/GetStatementResultRequest'
      responses:
        '200':
          description: Statement results retrieved successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GetStatementResultResponse'
        '400':
          description: Invalid request - validation error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ValidationException'
        '404':
          description: Statement not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ResourceNotFoundException'
        '500':
          description: Internal server error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/InternalServerException'
      x-microcks-operation:
        delay: 0
        dispatcher: FALLBACK
  /ListDatabases:
    post:
      operationId: listDatabases
      summary: Amazon Redshift List Databases in a Cluster or Workgroup
      description: >-
        Lists the databases in a cluster or workgroup. The databases are
        retrieved from the system catalog. A token is returned to page
        through the database list.
      tags:
      - Metadata
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ListDatabasesRequest'
      responses:
        '200':
          description: Database list retrieved successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ListDatabasesResponse'
        '400':
          description: Invalid request - validation error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ValidationException'
        '500':
          description: Internal server error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/InternalServerException'
      x-microcks-operation:
        delay: 0
        dispatcher: FALLBACK
  /ListSchemas:
    post:
      operationId: listSchemas
      summary: Amazon Redshift List Schemas in a Database
      description: >-
        Lists the schemas in a database. A token is returned to page
        through the schema list. You can filter the results by providing
        a schema name pattern.
      tags:
      - Metadata
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ListSchemasRequest'
      responses:
        '200':
          description: Schema list retrieved successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ListSchemasResponse'
        '400':
          description: Invalid request - validation error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ValidationException'
        '500':
          description: Internal server error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/InternalServerException'
      x-microcks-operation:
        delay: 0
        dispatcher: FALLBACK
  /ListTables:
    post:
      operationId: listTables
      summary: Amazon Redshift List Tables in a Schema
      description: >-
        Lists the tables in a database. You can filter by schema or table
        name pattern. A token is returned to page through the table list.
      tags:
      - Metadata
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ListTablesRequest'
      responses:
        '200':
          description: Table list retrieved successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ListTablesResponse'
        '400':
          description: Invalid request - validation error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ValidationException'
        '500':
          description: Internal server error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/InternalServerException'
      x-microcks-operation:
        delay: 0
        dispatcher: FALLBACK
  /DescribeTable:
    post:
      operationId: describeTable
      summary: Amazon Redshift Describe the Columns of a Table
      description: >-
        Describes the detailed information about a table and its columns.
        Returns column names, data types, and other metadata for a
        specified table.
      tags:
      - Metadata
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/DescribeTableRequest'
      responses:
        '200':
          description: Table description retrieved successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DescribeTableResponse'
        '400':
          description: Invalid request - validation error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ValidationException'
        '500':
          description: Internal server error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/InternalServerException'
      x-microcks-operation:
        delay: 0
        dispatcher: FALLBACK
components:
  securitySchemes:
    sigv4Auth:
      type: apiKey
      name: Authorization
      in: header
      description: >-
        AWS Signature Version 4 authentication. Requests are signed using
        IAM credentials. The Data API also supports authentication via
        AWS Secrets Manager for database credentials or temporary IAM
        credentials.
  schemas:
    ExecuteStatementRequest:
      type: object
      required:
      - Database
      - Sql
      properties:
        ClusterIdentifier:
          type: string
          description: >-
            The cluster identifier. Required when connecting to a
            provisioned cluster. Mutually exclusive with WorkgroupName.
          example: my-redshift-cluster
        Database:
          type: string
          description: The name of the database to run the SQL statement against
          example: dev
        DbUser:
          type: string
          description: >-
            The database user name. Required when authenticating with
            temporary credentials from GetClusterCredentials.
          example: example_value
        SecretArn:
          type: string
          description: >-
            The ARN of the secret stored in AWS Secrets Manager that
            contains the database credentials. Mutually exclusive with
            DbUser and temporary credentials.
          example: arn:aws:secretsmanager:us-east-1:123456789012:secret:my-redshift-secret-AbCdEf
        Sql:
          type: string
          description: The SQL statement to run. Maximum length is 100,000 characters.
          maxLength: 100000
          example: SELECT * FROM sales ORDER BY sale_date DESC LIMIT 10
        StatementName:
          type: string
          description: >-
            A name for the SQL statement. This name can be used to
            identify the query in the ListStatements output.
          example: my-sales-query
        WithEvent:
          type: boolean
          description: >-
            Whether to send an event to Amazon EventBridge when the
            SQL statement completes. Default is false.
          default: false
          example: true
        WorkgroupName:
          type: string
          description: >-
            The serverless workgroup name. Required when connecting to
            Redshift Serverless. Mutually exclusive with ClusterIdentifier.
          example: my-workgroup
        Parameters:
          type: array
          description: >-
            Named parameters for the SQL statement. Use :name syntax
            in the SQL string to reference parameters.
          items:
            $ref: '#/components/schemas/SqlParameter'
          example: []
        ClientToken:
          type: string
          description: >-
            A unique, case-sensitive identifier to ensure idempotency
            of the request.
          example: example_value
    BatchExecuteStatementRequest:
      type: object
      required:
      - Database
      - Sqls
      properties:
        ClusterIdentifier:
          type: string
          description: The cluster identifier for a provisioned cluster
          example: example_value
        Database:
          type: string
          description: The name of the database
          example: example_value
        DbUser:
          type: string
          description: The database user name for temporary credentials
          example: example_value
        SecretArn:
          type: string
          description: ARN of the secret in AWS Secrets Manager
          example: example_value
        Sqls:
          type: array
          description: >-
            One or more SQL statements to run. The statements run
            serially as a single transaction. Maximum 40 statements.
          items:
            type: string
          minItems: 1
          maxItems: 40
          example: []
        StatementName:
          type: string
          description: A name for the batch SQL statement
          example: example_value
        WithEvent:
          type: boolean
          description: Whether to send an event to EventBridge on completion
          default: false
          example: true
        WorkgroupName:
          type: string
          description: The serverless workgroup name
          example: example_value
        ClientToken:
          type: string
          description: Idempotency token
          example: example_value
    DescribeStatementRequest:
      type: object
      required:
      - Id
      properties:
        Id:
          type: string
          format: uuid
          description: >-
            The identifier of the SQL statement to describe. This value
            is returned by ExecuteStatement or BatchExecuteStatement.
          example: c016234e-5c6c-4bc5-bb66-2c776b0e92db
    ListStatementsRequest:
      type: object
      properties:
        MaxResults:
          type: integer
          description: >-
            The maximum number of SQL statements to return in the
            response. Valid range is 0 to 100. Default is 100.
          minimum: 0
          maximum: 100
          default: 100
          example: 10
        NextToken:
          type: string
          description: >-
            A value that indicates the starting point for the next set
            of response records in a subsequent request.
          example: example_value
        RoleLevel:
          type: boolean
          description: >-
            When true, returns statements submitted by all IAM users
            in the account. Default is false, which returns only
            statements from the calling user.
          default: false
          example: true
        StatementName:
          type: string
          description: Filter results by a specific statement name
          example: example_value
        Status:
          type: string
          description: Filter results by statement status
          enum:
          - SUBMITTED
          - PICKED
          - STARTED
          - FINISHED
          - ABORTED
          - FAILED
          - ALL
          example: SUBMITTED
    CancelStatementRequest:
      type: object
      required:
      - Id
      properties:
        Id:
          type: string
          format: uuid
          description: The identifier of the SQL statement to cancel
          example: abc123
    GetStatementResultRequest:
      type: object
      required:
      - Id
      properties:
        Id:
          type: string
          format: uuid
          description: The identifier of the SQL statement whose results to fetch
          example: abc123
        NextToken:
          type: string
          description: A pagination token for the next page of results
          example: example_value
    ListDatabasesRequest:
      type: object
      required:
      - Database
      properties:
        ClusterIdentifier:
          type: string
          description: The cluster identifier
          example: example_value
        Database:
          type: string
          description: >-
            The name of the database to use for connection. For
            provisioned clusters this is typically 'dev'.
          example: example_value
        DbUser:
          type: string
          description: The database user for temporary credentials
          example: example_value
        SecretArn:
          type: string
          description: ARN of the secret in Secrets Manager
          example: example_value
        WorkgroupName:
          type: string
          description: The serverless workgroup name
          example: example_value
        MaxResults:
          type: integer
          description: Maximum number of databases to return
          minimum: 0
          maximum: 1000
          example: 10
        NextToken:
          type: string
          description: Pagination token for the next page
          example: example_value
    ListSchemasRequest:
      type: object
      required:
      - Database
      properties:
        ClusterIdentifier:
          type: string
          description: The cluster identifier
          example: example_value
        Database:
          type: string
          description: The name of the database containing the schemas
          example: example_value
        DbUser:
          type: string
          description: The database user for temporary credentials
          example: example_value
        SecretArn:
          type: string
          description: ARN of the secret in Secrets Manager
          example: example_value
        WorkgroupName:
          type: string
          description: The serverless workgroup name
          example: example_value
        SchemaPattern:
          type: string
          description: >-
            A pattern to filter schemas. Uses SQL LIKE syntax where
            underscore matches one character and percent matches zero
            or more characters.
          example: public%
        MaxResults:
          type: integer
          description: Maximum number of schemas to return
          minimum: 0
          maximum: 1000
          example: 10
        NextToken:
          type: string
          description: Pagination token for the next page
          example: example_value
    ListTablesRequest:
      type: object
      required:
      - Database
      properties:
        ClusterIdentifier:
          type: string
          description: The cluster identifier
          example: example_value
        Database:
          type: string
          description: The name of the database containing the tables
          example: example_value
        DbUser:
          type: string
          description: The database user for temporary credentials
          example: example_value
        SecretArn:
          type: string
          description: ARN of the secret in Secrets Manager
          example: example_value
        WorkgroupName:
          type: string
          description: The serverless workgroup name
          example: example_value
        SchemaPattern:
          type: string
          description: A schema name pattern to filter tables
          example: example_value
        TablePattern:
          type: string
          description: A table name pattern to filter tables
          example: sales%
        MaxResults:
          type: integer
          description: Maximum number of tables to return
          minimum: 0
          maximum: 1000
          example: 10
        NextToken:
          type: string
          description: Pagination token for the next page
          example: example_value
    DescribeTableRequest:
      type: object
      required:
      - Database
      properties:
        ClusterIdentifier:
          type: string
          description: The cluster identifier
          example: example_value
        Database:
          type: string
          description: The name of the database
          example: example_value
        DbUser:
          type: string
          description: The database user for temporary credentials
          example: example_value
        SecretArn:
          type: string
          description: ARN of the secret in Secrets Manager
          example: example_value
        WorkgroupName:
          type: string
          description: The serverless workgroup name
          example: example_value
        Table:
          type: string
          description: >-
            The table name. Can be qualified with schema name as
            schema_name.table_name.
          example: public.sales
        Schema:
          type: string
          description: The schema that contains the table. Default is public.
          default: public
          example: example_value
        MaxResults:
          type: integer
          description: Maximum number of columns to return
          minimum: 0
          maximum: 1000
          example: 10
        NextToken:
          type: string
          description: Pagination token for the next page
          example: example_value
    ExecuteStatementResponse:
      type: object
      properties:
        Id:
          type: string
          format: uuid
          description: The identifier of the SQL statement
          example: abc123
        CreatedAt:
          type: string
          format: date-time
          description: The date and time the statement was created
          example: '2026-01-15T10:30:00Z'
        Database:
          type: string
          description: The name of the database
          example: example_value
        DbUser:
          type: string
          description: The database user
          example: example_value
        ClusterIdentifier:
          type: string
          description: The cluster identifier
          example: example_value
        WorkgroupName:
          type: string
          description: The serverless workgroup name
          example: example_value
        SecretArn:
          type: string
          description: The secret ARN used for authentication
          example: example_value
    BatchExecuteStatementResponse:
      type: object
      properties:
        Id:
          type: string
          format: uuid
          description: The identifier of the batch SQL statement
          example: abc123
        CreatedAt:
          type: string
          format: date-time
          description: The date and time the batch statement was created
          example: '2026-01-15T10:30:00Z'
        Database:
          type: string
          description: The name of the database
          example: example_value
        DbUser:
          type: string
          description: The database user
          example: example_value
        ClusterIdentifier:
          type: string
          description: The cluster identifier
          example: example_value
        WorkgroupName:
          type: string
          description: The serverless workgroup name
          example: example_value
        SecretArn:
          type: string
          description: The secret ARN used for authentication
          example: example_value
    DescribeStatementResponse:
      type: object
      properties:
        Id:
          type: string
          format: uuid
          description: The identifier of the SQL statement
          example: abc123
        Status:
          type: string
          description: The status of the SQL statement
          enum:
          - SUBMITTED
          - PICKED
          - STARTED
          - FINISHED
          - ABORTED
          - FAILED
          example: SUBMITTED
        CreatedAt:
          type: string
          format: date-time
          description: The date and time the statement was created
          example: '2026-01-15T10:30:00Z'
        UpdatedAt:
          type: string
          format: date-time
          description: The date and time the statement was last updated
          example: '2026-01-15T10:30:00Z'
        Duration:
          type: integer
          format: int64
          description: The time in nanoseconds the statement ran
          example: 10
        QueryString:
          type: string
          description: The SQL statement that was executed
          example: example_value
        QueryParameters:
          type: array
          description: The parameters for the SQL statement
          items:
            $ref: '#/components/schemas/SqlParameter'
          example: []
        Database:
          type: string
          description: The name of the database
          example: example_value
        DbUser:
          type: string
          description: The database user
          example: example_value
        ClusterIdentifier:
          type: string
          description: The cluster identifier
          example: example_value
        WorkgroupName:
          type: string
          description: The serverless workgroup name
          example: example_value
        SecretArn:
          type: string
          description: The secret ARN
          example: example_value
        RedshiftPid:
          type: integer
          format: int64
          description: The process identifier from the Redshift cluster
          example: '500123'
        RedshiftQueryId:
          type: integer
          format: int64
          description: The Redshift query identifier
          example: '500123'
        ResultRows:
          type: integer
          format: int64
          description: Total number of rows in the result set (FINISHED only)
          example: 10
        ResultSize:
          type: integer
          format: int64
          description: The size of the result set in bytes
          example: 10
        HasResultSet:
          type: boolean
          description: Whether the statement has a result set
          example: true
        Error:
          type: string
          description: The error message if the statem

# --- truncated at 32 KB (43 KB total) ---
# Full source: https://raw.githubusercontent.com/api-evangelist/amazon-redshift/refs/heads/main/openapi/amazon-redshift-data-api-openapi.yml