---
title: "Checks the status of the execution of a statement"
method: GET
path: "/api/v2/statements/{statementHandle}"
tags: ["statements"]
---

# Checks the status of the execution of a statement

`GET /api/v2/statements/{statementHandle}`

Checks the status of the execution of the statement with the specified statement handle. If the statement was executed successfully, the operation returns the requested partition of the result set.

## Response `200`

The statement was executed successfully, and the response includes any data requested.

- ResultSet
  - `code` string
  - `sqlState` string
  - `message` string
  - `statementHandle` string, uuid
  - `createdOn` integer — Timestamp that specifies when the statement execution started.‌ The timestamp is expressed in milliseconds since the epoch.‌
  - `statementStatusUrl` string, uri
  - `resultSetMetaData` object
    - `format` 'jsonv2' — For v2 endpoints the only possible value for this field is jsonv2.
    - `numRows` integer — The total number of rows of results.
    - `rowType` object[]
      - `name` string
      - `type` string
      - `length` integer
      - `precision` integer
      - `scale` integer
      - `nullable` boolean
    - `partitionInfo` object[] — Partition information
      - `rowCount` integer — Number of rows in the partition.
      - `compressedSize` integer — the partition size before the decompression. This may or may not be present in the partitionInfo. Uncompressed size would always be there.
      - `uncompressedSize` integer — the partition size after the decompression
    - `nullable` boolean — false if null is replaced with a string 'null' otherwise false
    - `parameters` object
      - `binary_output_format` string
      - `date_output_format` string
      - `time_output_format` string
      - `timestamp_output_format` string
      - `timestamp_ltz_output_format` string
      - `timestamp_ntz_output_format` string
      - `timestamp_tz_output_format` string
      - `multi_statement_count` integer
  - `data` array[] — Result set data.
    - string[]
  - `stats` object — these stats might not be available for each request.
    - `numRowsInserted` integer — Number of rows that were inserted.
    - `numRowsUpdated` integer — Number of rows that were updated.
    - `numRowsDeleted` integer — Number of rows that were deleted.
    - `numDuplicateRowsUpdated` integer — Number of duplicate rows that were updated.

## Other responses

- `202` — The execution of the statement is still in progress. Use this method again to check the status of the statement execution.
- `400` — Bad Request. The request payload is invalid or malformed. This happens if the application didn't send the correct request payload. The response body may include the error code and message indicating the actual cause. The application must reconstruct the request body for retry.
- `401` — Unauthorized. The request is not authorized. This happens if the attached access token is invalid or missing. The response body may include the error code and message indicating the actual cause, e.g., expired, invalid token. The application must obtain a new access token for retry.
- `403` — Forbidden. The request is forbidden. This happens if the request is made even if the API is not enabled.
- `404` — Not Found. The request endpoint is not valid. This happens if the API endpoint is wrong. For example, if the application hits /api/api/hello which doesn't exist, it will receive this code.
- `405` — Method Not Allowed. The request method doesn't match the supported API. This happens, for example, if the application calls the API with GET method but the endpoint accepts only POST. The application must change a method for retry.
- `415` — The request header Content-Type includes unsupported media type. The API supports application/json only. If none specified, the request payload is taken as JSON, but if any other media type is specified, this error is returned.
- `422` — An error occurred when executing the statement. Check the error code and error message for details.
- `429` — Limit Exceeded. The number of requests hit the rate limit. The application must slow down the frequency of hitting the API endpoints.
- `500` — Internal Server Error. The server hits an unrecoverable system error. The response body may include the error code and message for further guidance. The application owner may need to reach out the customer support.
- `503` — Service Unavailable. The request was not processed due to server side timeouts. The application may retry with backoff. The jittered backoff is recommended. https://aws.amazon.com/blogs/architecture/exponential-backoff-and-jitter/
- `504` — Gateway Timeout. The request was not processed due to server side timeouts. The application may retry with backoff. The jittered backoff is recommended. https://aws.amazon.com/blogs/architecture/exponential-backoff-and-jitter/

---

[API](https://skmtc.dev/snowflakedb/apis/snowflake-sql-api.md) · [All operations](https://skmtc.dev/snowflakedb/apis/snowflake-sql-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/snowflakedb/snowflake-sql-api/revisions/28b780dd0569/schema)
