Help Center/ AI DataLake/ API Reference/ Aura APIs/ AuraSQL Job Management/ Canceling the Execution of a SQL Statement
Updated on 2026-11-06 GMT+08:00

Canceling the Execution of a SQL Statement

Function

This API is used to cancel the execution of an SQL statement. This API is synchronous. There are no accompanying APIs or specific scenarios.

Calling Method

For details, see Calling APIs.

URI

POST /v2/workspaces/{workspace_id}/aura-sessions/{session_id}/statements/{statement_id}/cancel

Table 1 Path Parameters

Parameter

Mandatory

Type

Description

workspace_id

Yes

String

Definition: Workspace ID. For details about how to obtain the workspace ID, see Obtaining a Workspace ID.

Constraints: N/A

Range: 1 to 36 characters. Only letters, digits, and hyphens (-) are allowed.

Default Value: N/A

session_id

Yes

String

Definition: Session ID. You can obtain the session ID by calling the Listing Sessions API.

Constraints: N/A

Range: 1 to 36 characters. Only letters, digits, and hyphens (-) are allowed.

Default Value: N/A

statement_id

Yes

String

Definition: Statement ID, which can be obtained by calling the Viewing SQL Execution Records Under a Specified Session API.

Constraints: N/A

Range: 1 to 36 characters. Only letters, digits, underscores (_), and hyphens (-) are allowed.

Default Value: N/A

Request Parameters

Table 2 Request header parameters

Parameter

Mandatory

Type

Description

X-Auth-Token

Yes

String

Definition: User token. It is obtained by calling the Obtaining an IAM User Token API.

Constraints: N/A

Range: N/A

Default Value: N/A

Response Parameters

Status code: 204

Table 3 Response body parameters

Parameter

Type

Description

-

AnyType

Succeeded.

Status code: 400

Table 4 Response body parameters

Parameter

Type

Description

error_code

String

Definition: Error code.

Range: 8 to 36 characters.

error_msg

String

Definition: Error description.

Range: 2 to 4,096 characters.

solution_msg

String

Definition: Solution description.

Range: 2 to 4,096 characters.

Status code: 401

Table 5 Response body parameters

Parameter

Type

Description

error_code

String

Definition: Error code.

Range: 8 to 36 characters.

error_msg

String

Definition: Error description.

Range: 2 to 4,096 characters.

solution_msg

String

Definition: Solution description.

Range: 2 to 4,096 characters.

Status code: 403

Table 6 Response body parameters

Parameter

Type

Description

error_code

String

Definition: Error code.

Range: 8 to 36 characters.

error_msg

String

Definition: Error description.

Range: 2 to 4,096 characters.

solution_msg

String

Definition: Solution description.

Range: 2 to 4,096 characters.

Status code: 404

Table 7 Response body parameters

Parameter

Type

Description

error_code

String

Definition: Error code.

Range: 8 to 36 characters.

error_msg

String

Definition: Error description.

Range: 2 to 4,096 characters.

solution_msg

String

Definition: Solution description.

Range: 2 to 4,096 characters.

Status code: 408

Table 8 Response body parameters

Parameter

Type

Description

error_code

String

Definition: Error code.

Range: 8 to 36 characters.

error_msg

String

Definition: Error description.

Range: 2 to 4,096 characters.

solution_msg

String

Definition: Solution description.

Range: 2 to 4,096 characters.

Status code: 500

Table 9 Response body parameters

Parameter

Type

Description

error_code

String

Definition: Error code.

Range: 8 to 36 characters.

error_msg

String

Definition: Error description.

Range: 2 to 4,096 characters.

solution_msg

String

Definition: Solution description.

Range: 2 to 4,096 characters.

Example Requests

Request example for canceling a specified SQL statement by statement_id.

POST /v2/workspaces/{workspace_id}/aura-sessions/{session_id}/cancel

Example Responses

Status code: 204

None

Status code: 400

{
  "error_code" : "AIDataLake.00092031",
  "error_msg" : "Invalid parameter name",
  "solution_msg" : "Please enter parameters in the correct format."
}

Status code: 401

{
  "error_code" : "APIG.1002",
  "error_msg" : "Incorrect token or token resolution failed.",
  "solution_msg" : "Please obtain a valid token and retry."
}

Status code: 403

{
  "error_code" : "AIDataLake.00090030",
  "error_msg" : "Unauthorized requests.",
  "solution_msg" : "Check permissions and retry after authorization."
}

Status code: 404

{
  "error_code" : "AIDataLake.00090009",
  "error_msg" : "The resource does not exists.",
  "solution_msg" : "Please try to use correct info."
}

Status code: 408

{
  "error_code" : "common.00000408",
  "error_msg" : "A timeout exception occurred.",
  "solution_msg" : "The request timed out while waiting for a response — check the backend service status and network, then retry; if the operation is long-running, increase the client timeout or split the request."
}

Status code: 500

{
  "error_code" : "common.00000500",
  "error_msg" : "internal error",
  "solution_msg" : "An internal service error occurred. Please retry later; if the problem persists, contact technical support."
}

Status Codes

Status Code

Description

204

Succeeded.

400

Invalid request.

401

Unauthorized.

403

Request denied.

404

The requested resource could not be found.

408

Request timeout.

500

Internal server error.