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://moi.matrixorigin.cn/newmoi/query/kill

Preparation before calling

Prepare the personal access token, workspace ID, and query ID from the Execute SQL response.

Request body

query_idstringRequired
The query ID to cancel.

Request example

curl -X POST "https://moi.matrixorigin.cn/newmoi/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 completed and the query record is marked as killed. Use query execution status to read records.

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