Cancel execution

Stops SQL queries that are still running for the current identity. After the call is successful, use query execution status to confirm the status of the query.

POST https://api.moi.matrixorigin.cn/v5/query/kill

Preparation before calling

Prepare the personal access token and workspace ID. Submit the query through an execution mode that returns a query ID while the query is still running, then save that query_id from the Execute SQL response.

Request body

query_idstringRequired
The query ID to cancel.

Request example

curl -X POST "https://api.moi.matrixorigin.cn/v5/query/kill" \
  -H "X-API-Key: $AI_STUDIO_API_KEY" \
  -H "X-Workspace-ID: $WORKSPACE_ID" \
  -H 'Content-Type: application/json' \
  -d "{\"query_id\":\"$QUERY_ID\"}"

Successful response

A successful response indicates that the cancellation request has been accepted; it does not prove that every execution unit has stopped. Use query execution status to confirm the final status. The synchronous execution example does not provide a stable cancellation window; the product must provide an asynchronous submission path or another documented source of running query IDs.

The response fields are as follows.

codeinteger
200 on success.
datanull
This operation does not return data.

Successful response example

{
  "code": 200,
  "data": null
}

Error response

codestring
Error code.
msgstring
Readable error message.
datanull
`null` in an error response.

Error response example

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

Follow-up operations

Query execution status again to confirm that execution has stopped.

Last updated on