View execution status

View the current status of a SQL query. When the query is successful, the response returns the result ID required to read or download the result.

HTTP
POST $CLOUDSIGMA_API_BASE/query/describe

Before you call

Configure the CloudSigma regional endpoint and authentication before calling. The endpoint, credentials, workspace, and resource IDs must belong to the same region.

  1. Prepare personal access token and target workspace ID that can access the target workspace.

  2. Execute SQL and record the query ID (query_id) in the response.

Request body

Replace $CLOUDSIGMA_API_KEY, $WORKSPACE_ID and $QUERY_ID with actual values.

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\"}"

Parameter

Type

Required

Description

query_id

string

Yes

Query ID returned by executing SQL.

Successful response

JSON
{
  "code": 200,
  "data": {
    "query_id": "query_01",
    "created_at": "2026-08-18T10:00:00Z",
    "statement_id": "00000000-0000-4000-8000-000000000001",
    "db_name": "sales",
    "status": "success",
    "rows_affected": 1
  }
}

Field

Type

Description

code

integer

200 when the request is processed successfully.

data

object

response data.

data.query_id

string

Query ID.

data.created_at

string

The creation time of the execution record.

data.statement_id

string

The result ID used to read or download results.

data.db_name

string

The database specified during execution.

data.status

string

execution status. Values: running, success, failed, killed.

data.err_msg

string

Execute error description. May be omitted if not set.

data.rows_affected

integer

Number of rows affected.

Error response

JSON
{
  "code": 404,
  "message": "SQL 查询不存在"
}

Field

Type

Description

code

integer or string

SQL processing errors may be numeric status codes. Authentication or general service errors may be string error codes.

message

string

error message.

Errors are encapsulated in two ways: The SQL processing path uses {“code”:400,”message”:”…”}. Authentication or general service error using {“code”:”ErrServer”,”msg”:”…”}. Both message and msg are readable error messages, which should be read based on the actual fields and cannot be judged only by the numerical code.

Last updated on