View execution status

Read the status and result ID of the SQL executed by the current identity (statement_id). Results can only be read or downloaded using this result ID if the status is success.

HTTP
POST $CLOUDSIGMA_API_BASE/query/describe

Before you call this API

Configure the regional API endpoint and authentication, and select the target workspace.

Request

Shell
curl -X POST "$CLOUDSIGMA_API_BASE/query/describe" \
  -H "X-API-Key: $CLOUDSIGMA_API_KEY" \
  -H "X-Workspace-ID: $WORKSPACE_ID" \
  -H 'Content-Type: application/json' \
  -d "{\"query_id\":\"$QUERY_ID\"}"

Request body

ParameterTypeRequiredDescription
query_idstringRequiredThe query ID returned by [Execute SQL](execute-sql.md).

Successful response

statement_id is used to read or download results and cannot be replaced by query_id. When the status is success, the Statement ID can be used to obtain the result.

The response fields are as follows.

JSON
{
  "code": 200,
  "data": {
    "query_id": "query_01",
    "created_at": "2026-08-18T10:00:00Z",
    "statement_id": "statement_01",
    "db_name": "sales",
    "status": "success",
    "rows_affected": 1
  }
}
FieldTypeDescription
codeinteger200 on success.
data.query_idstringQuery ID.
data.created_atstringThe creation time of the execution record.
data.statement_idstringResult ID; used when reading or downloading the results of this SQL.
data.db_namestringThe database specified during execution.
data.statusstringExecution status.
data.err_msgstringExecution error message; only returned if there is an error message.
data.rows_affectedintegerNumber of affected rows.

Error response

JSON
{"code": 404, "message": "SQL 查询不存在"}
FieldTypeDescription
codestringError code.
msgstringReadable error message.
datanull`null` in an error response.

Follow-up operations

When the status indicates success, use the returned result to identify query execution result or download execution result. Cancel execution while still executing and needs to be aborted.

Last updated on