Amazon Redshift Statement Management API

Describe, list, and cancel SQL statement executions

GitHub OpenAPI

Operations 3

POST /#CancelStatement Cancel Statement #
POST /#DescribeStatement Describe Statement #
POST /#ListStatements List Statements #

Documentation

Specifications

Schemas & Data

Other Resources

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-redshift:amazon-redshift-statement-management-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-redshift-statement-management-api-openapi.yml Raw ↑
openapi: 3.1.0
info:
  title: Amazon Redshift Statement Management API
  version: '2012-12-01'
  description: Generated from AWS's published Smithy model for Amazon Redshift. 3 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://redshift-data.{region}.amazonaws.com
  variables:
    region:
      default: us-east-1
security:
- sigv4: []
paths:
  /#CancelStatement:
    post:
      operationId: CancelStatement
      summary: Cancel Statement
      description: Cancels a running query. To be canceled, a query must be running. For more information about the Amazon
        Redshift Data API and CLI usage examples, see Using the Amazon Redshift Data API in the Amazon Redshift Management
        Guide.
      responses:
        '200':
          description: Success
          content:
            application/x-amz-json-1.1:
              schema:
                $ref: '#/components/schemas/CancelStatementResponse'
        '500':
          description: DatabaseConnectionException; InternalServerException
          content:
            application/x-amz-json-1.1:
              schema:
                $ref: '#/components/schemas/DatabaseConnectionException'
        '400':
          description: QueryTimeoutException; ValidationException
          content:
            application/x-amz-json-1.1:
              schema:
                $ref: '#/components/schemas/QueryTimeoutException'
        '404':
          description: ResourceNotFoundException
          content:
            application/x-amz-json-1.1:
              schema:
                $ref: '#/components/schemas/ResourceNotFoundException'
      parameters:
      - name: X-Amz-Target
        in: header
        required: true
        schema:
          type: string
          enum:
          - RedshiftData.CancelStatement
      requestBody:
        required: true
        content:
          application/x-amz-json-1.1:
            schema:
              $ref: '#/components/schemas/CancelStatementRequest'
      tags:
      - Statement Management
  /#DescribeStatement:
    post:
      operationId: DescribeStatement
      summary: Describe Statement
      description: Describes the details about a specific instance when a query was run by the Amazon Redshift Data API. The
        information includes when the query started, when it finished, the query status, the number of rows returned, and
        the SQL statement. For more information about the Amazon Redshift Data API and CLI usage examples, see Using the Amazon
        Redshift Data API in the Amazon Redshift Management Guide.
      responses:
        '200':
          description: Success
          content:
            application/x-amz-json-1.1:
              schema:
                $ref: '#/components/schemas/DescribeStatementResponse'
        '400':
          description: ActiveWaitingRequestsExceededException; ValidationException
          content:
            application/x-amz-json-1.1:
              schema:
                $ref: '#/components/schemas/ActiveWaitingRequestsExceededException'
        '500':
          description: InternalServerException
          content:
            application/x-amz-json-1.1:
              schema:
                $ref: '#/components/schemas/InternalServerException'
        '404':
          description: ResourceNotFoundException
          content:
            application/x-amz-json-1.1:
              schema:
                $ref: '#/components/schemas/ResourceNotFoundException'
      parameters:
      - name: X-Amz-Target
        in: header
        required: true
        schema:
          type: string
          enum:
          - RedshiftData.DescribeStatement
      requestBody:
        required: true
        content:
          application/x-amz-json-1.1:
            schema:
              $ref: '#/components/schemas/DescribeStatementRequest'
      tags:
      - Statement Management
  /#ListStatements:
    post:
      operationId: ListStatements
      summary: List Statements
      description: List of SQL statements. By default, only finished statements are shown. A token is returned to page through
        the statement list. When you use identity-enhanced role sessions to list statements, you must provide either the cluster-identifier
        or workgroup-name parameter. This ensures that the IdC user can only access the Amazon Redshift IdC applications they
        are assigned. For more information, see Trusted identity propagation overview. For more information about the Amazon
        Redshift Data API and CLI usage examples, see Using the Amazon Redshift Data API in the Amazon Redshift Management
        Guide.
      responses:
        '200':
          description: Success
          content:
            application/x-amz-json-1.1:
              schema:
                $ref: '#/components/schemas/ListStatementsResponse'
        '500':
          description: InternalServerException
          content:
            application/x-amz-json-1.1:
              schema:
                $ref: '#/components/schemas/InternalServerException'
        '404':
          description: ResourceNotFoundException
          content:
            application/x-amz-json-1.1:
              schema:
                $ref: '#/components/schemas/ResourceNotFoundException'
        '400':
          description: ValidationException
          content:
            application/x-amz-json-1.1:
              schema:
                $ref: '#/components/schemas/ValidationException'
      parameters:
      - name: X-Amz-Target
        in: header
        required: true
        schema:
          type: string
          enum:
          - RedshiftData.ListStatements
      requestBody:
        required: true
        content:
          application/x-amz-json-1.1:
            schema:
              $ref: '#/components/schemas/ListStatementsRequest'
      tags:
      - Statement Management
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: redshift-data
  schemas:
    ActiveWaitingRequestsExceededException:
      type: object
      properties:
        Message:
          type: string
    CancelStatementRequest:
      type: object
      properties:
        Id:
          type: string
          description: The identifier of the SQL statement to cancel. This value is a universally unique identifier (UUID)
            generated by Amazon Redshift Data API. This identifier is returned by BatchExecuteStatment, ExecuteStatment, and
            ListStatements.
      required:
      - Id
    CancelStatementResponse:
      type: object
      properties:
        Status:
          type: boolean
          description: A value that indicates whether the cancel statement succeeded (true).
    DatabaseConnectionException:
      type: object
      properties:
        Message:
          type: string
      required:
      - Message
    DescribeStatementRequest:
      type: object
      properties:
        Id:
          type: string
          description: The identifier of the SQL statement to describe. This value is a universally unique identifier (UUID)
            generated by Amazon Redshift Data API. A suffix indicates the number of the SQL statement. For example, d9b6c0c9-0747-4bf4-b142-e8883122f766:2
            has a suffix of :2 that indicates the second SQL statement of a batch query. This identifier is returned by BatchExecuteStatment,
            ExecuteStatement, and ListStatements.
        WaitTimeSeconds:
          type: integer
          description: The number of seconds to wait for the SQL statement to complete execution before returning the description.
            The maximum value is 30 seconds.
      required:
      - Id
    DescribeStatementResponse:
      type: object
      properties:
        Id:
          type: string
          description: The identifier of the SQL statement described. This value is a universally unique identifier (UUID)
            generated by Amazon Redshift Data API.
        SecretArn:
          type: string
          description: The name or Amazon Resource Name (ARN) of the secret that enables access to the database.
        DbUser:
          type: string
          description: The database user name.
        Database:
          type: string
          description: The name of the database.
        ClusterIdentifier:
          type: string
          description: The cluster identifier.
        Duration:
          type: integer
          description: The amount of time in nanoseconds that the statement ran.
        Error:
          type: string
          description: The error message from the cluster if the SQL statement encountered an error while running.
        Status:
          type: string
          description: 'The status of the SQL statement being described. Status values are defined as follows: ABORTED - The
            query run was stopped by the user. ALL - A status value that includes all query statuses. This value can be used
            to filter results. FAILED - The query run failed. FINISHED - The query has finished running. PICKED - The query
            has been chosen to be run. STARTED - The query run has started. SUBMITTED - The query was submitted, but not yet
            processed.'
        CreatedAt:
          type: string
          description: The date and time (UTC) when the SQL statement was submitted to run.
        UpdatedAt:
          type: string
          description: The date and time (UTC) that the metadata for the SQL statement was last updated. An example is the
            time the status last changed.
        RedshiftPid:
          type: integer
          description: The process identifier from Amazon Redshift.
        HasResultSet:
          type: boolean
          description: A value that indicates whether the statement has a result set. The result set can be empty. The value
            is true for an empty result set. The value is true if any substatement returns a result set.
        QueryString:
          type: string
          description: The SQL statement text.
        ResultRows:
          type: integer
          description: Either the number of rows returned from the SQL statement or the number of rows affected. If result
            size is greater than zero, the result rows can be the number of rows affected by SQL statements such as INSERT,
            UPDATE, DELETE, COPY, and others. A -1 indicates the value is null.
        ResultSize:
          type: integer
          description: The size in bytes of the returned results. A -1 indicates the value is null.
        RedshiftQueryId:
          type: integer
          description: The identifier of the query generated by Amazon Redshift. These identifiers are also available in the
            query_id column of the SYS_QUERY_HISTORY system view.
        RedshiftQueryUuid:
          type: string
          description: The global unique identifier of the query generated by Amazon Redshift. These identifiers are also
            available in the query_uuid column of the SYS_QUERY_HISTORY system view.
        QueryParameters:
          type: array
          items:
            $ref: '#/components/schemas/SqlParameter'
          description: The parameters for the SQL statement.
        SubStatements:
          type: array
          items:
            $ref: '#/components/schemas/SubStatementData'
          description: The SQL statements from a multiple statement run.
        WorkgroupName:
          type: string
          description: The serverless workgroup name or Amazon Resource Name (ARN).
        ResultFormat:
          type: string
          description: The data format of the result of the SQL statement.
        SessionId:
          type: string
          description: The session identifier of the query.
        ExecutionMode:
          type: string
          description: The execution mode of the batch request. TRANSACTION indicates all SQL statements are run as a single
            transaction. AUTO_COMMIT indicates each SQL statement is committed individually.
      required:
      - Id
    InternalServerException:
      type: object
      properties:
        Message:
          type: string
          description: The exception message.
      required:
      - Message
    ListStatementsRequest:
      type: object
      properties:
        NextToken:
          type: string
          description: A value that indicates the starting point for the next set of response records in a subsequent request.
            If a value is returned in a response, you can retrieve the next set of records by providing this returned NextToken
            value in the next NextToken parameter and retrying the command. If the NextToken field is empty, all response
            records have been retrieved for the request.
        MaxResults:
          type: integer
          description: The maximum number of SQL statements to return in the response. If more SQL statements exist than fit
            in one response, then NextToken is returned to page through the results.
        StatementName:
          type: string
          description: The name of the SQL statement specified as input to BatchExecuteStatement or ExecuteStatement to identify
            the query. You can list multiple statements by providing a prefix that matches the beginning of the statement
            name. For example, to list myStatement1, myStatement2, myStatement3, and so on, then provide the a value of myStatement.
            Data API does a case-sensitive match of SQL statement names to the prefix value you provide.
        Status:
          type: string
          description: 'The status of the SQL statement to list. Status values are defined as follows: ABORTED - The query
            run was stopped by the user. ALL - A status value that includes all query statuses. This value can be used to
            filter results. FAILED - The query run failed. FINISHED - The query has finished running. PICKED - The query has
            been chosen to be run. STARTED - The query run has started. SUBMITTED - The query was submitted, but not yet processed.'
        RoleLevel:
          type: boolean
          description: A value that filters which statements to return in the response. If true, all statements run by the
            caller's IAM role are returned. If false, only statements run by the caller's IAM role in the current IAM session
            are returned. The default is true.
        Database:
          type: string
          description: The name of the database when listing statements run against a ClusterIdentifier or WorkgroupName.
        ClusterIdentifier:
          type: string
          description: The cluster identifier. Only statements that ran on this cluster are returned. When providing ClusterIdentifier,
            then WorkgroupName can't be specified.
        WorkgroupName:
          type: string
          description: The serverless workgroup name or Amazon Resource Name (ARN). Only statements that ran on this workgroup
            are returned. When providing WorkgroupName, then ClusterIdentifier can't be specified.
    ListStatementsResponse:
      type: object
      properties:
        Statements:
          type: array
          items:
            $ref: '#/components/schemas/StatementData'
          description: The SQL statements.
        NextToken:
          type: string
          description: A value that indicates the starting point for the next set of response records in a subsequent request.
            If a value is returned in a response, you can retrieve the next set of records by providing this returned NextToken
            value in the next NextToken parameter and retrying the command. If the NextToken field is empty, all response
            records have been retrieved for the request.
      required:
      - Statements
    QueryTimeoutException:
      type: object
      properties:
        Message:
          type: string
    ResourceNotFoundException:
      type: object
      properties:
        Message:
          type: string
          description: The exception message.
        ResourceId:
          type: string
          description: Resource identifier associated with the exception.
      required:
      - Message
      - ResourceId
    SqlParameter:
      type: object
      properties:
        name:
          type: string
          description: The name of the parameter.
        value:
          type: string
          description: The value of the parameter. Amazon Redshift implicitly converts to the proper data type. For more information,
            see Data types in the Amazon Redshift Database Developer Guide.
      required:
      - name
      - value
    StatementData:
      type: object
      properties:
        Id:
          type: string
          description: The SQL statement identifier. This value is a universally unique identifier (UUID) generated by Amazon
            Redshift Data API.
        QueryString:
          type: string
          description: The SQL statement.
        QueryStrings:
          type: array
          items:
            type: string
          description: One or more SQL statements. Each query string in the array corresponds to one of the queries in a batch
            query request.
        SecretArn:
          type: string
          description: The name or Amazon Resource Name (ARN) of the secret that enables access to the database.
        Status:
          type: string
          description: The status of the SQL statement. An example is the that the SQL statement finished.
        StatementName:
          type: string
          description: The name of the SQL statement.
        CreatedAt:
          type: string
          description: The date and time (UTC) the statement was created.
        UpdatedAt:
          type: string
          description: The date and time (UTC) that the statement metadata was last updated.
        QueryParameters:
          type: array
          items:
            $ref: '#/components/schemas/SqlParameter'
          description: The parameters used in a SQL statement.
        IsBatchStatement:
          type: boolean
          description: A value that indicates whether the statement is a batch query request.
        ResultFormat:
          type: string
          description: The data format of the result of the SQL statement.
        SessionId:
          type: string
          description: The session identifier of the query.
      required:
      - Id
    SubStatementData:
      type: object
      properties:
        Id:
          type: string
          description: The identifier of the SQL statement. This value is a universally unique identifier (UUID) generated
            by Amazon Redshift Data API. A suffix indicates the number of the SQL statement. For example, d9b6c0c9-0747-4bf4-b142-e8883122f766:2
            has a suffix of :2 that indicates the second SQL statement of a batch query.
        Duration:
          type: integer
          description: The amount of time in nanoseconds that the statement ran.
        Error:
          type: string
          description: The error message from the cluster if the SQL statement encountered an error while running.
        Status:
          type: string
          description: The status of the SQL statement. An example is the that the SQL statement finished.
        CreatedAt:
          type: string
          description: The date and time (UTC) the statement was created.
        UpdatedAt:
          type: string
          description: The date and time (UTC) that the statement metadata was last updated.
        QueryString:
          type: string
          description: The SQL statement text.
        ResultRows:
          type: integer
          description: Either the number of rows returned from the SQL statement or the number of rows affected. If result
            size is greater than zero, the result rows can be the number of rows affected by SQL statements such as INSERT,
            UPDATE, DELETE, COPY, and others. A -1 indicates the value is null.
        ResultSize:
          type: integer
          description: The size in bytes of the returned results. A -1 indicates the value is null.
        RedshiftQueryId:
          type: integer
          description: The identifier of the query generated by Amazon Redshift. These identifiers are also available in the
            query_id column of the SYS_QUERY_HISTORY system view.
        RedshiftQueryUuid:
          type: string
          description: The global unique identifier of the query generated by Amazon Redshift. These identifiers are also
            available in the query_uuid column of the SYS_QUERY_HISTORY system view.
        HasResultSet:
          type: boolean
          description: A value that indicates whether the statement has a result set. The result set can be empty. The value
            is true for an empty result set.
      required:
      - Id
    ValidationException:
      type: object
      properties:
        Message:
          type: string
          description: The exception message.
x-provenance:
  method: harvested
  publisher: Amazon Web Services
  source: https://raw.githubusercontent.com/aws/api-models-aws/3cd98287b471c106254abd89279cc87308d38bfd/models/redshift-data/service/2019-12-20/redshift-data-2019-12-20.json
  note: converted by smithy-to-openapi.py from AWS's Smithy model (roadmap#1001)