Updated on 2026-11-06 GMT+08:00

Creating a Session

Function

Create a SQL session on an endpoint.

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

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

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

Table 3 Request body parameters

Parameter

Mandatory

Type

Description

endpoint_name

Yes

String

Definition: Endpoint name.

Constraints: N/A

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

Default Value: N/A

agency_name

No

String

Definition: Agency name.

Constraints: For details, see Configuring an Aura Agency.

Range: N/A

Default Value: N/A

catalog_context

Yes

CatalogContext object

Definition: LakeFormation information.

Constraints: N/A

Range: N/A

Default Value: N/A

wait_timeout

No

Integer

Definition: Waiting time for creating a session, in seconds.

Constraints: N/A

Range: 300 to 86,400.

Default Value: N/A

max_retry_times

No

Integer

Definition: Number of retry attempts when resources are insufficient.

Constraints: N/A

Range: 1 to 2,147,483,647.

Default Value: N/A

priority

No

Integer

Definition: Priority. The value range is 1 to 9, where 9 indicates the highest priority.

Constraints: N/A

Range: 1 to 9.

Default Value: 5

cpu

No

Long

Definition: CPU resources of the compute node (CN) specified for the session, in millicores.

Constraints: Optional. If not passed, the global configuration getCnCpuLimit is used as the fallback.

This field is not consumed in INNER_SESSION/maintenance statement scenarios, where the resource specification is inherited from the parent session CN.

The upper limit is 48,000 millicores (48 cores). Values exceeding this limit will result in a 400 INVALID_PARAMETER error.

Range: (0, 48,000] millicores.

Default Value: If not passed, the global configuration fallback value (for example, 4,000 millicores) is used.

memory

No

Long

Definition: Memory resources of the compute node (CN) specified for the session, in MB.

Constraints: Optional. If not passed, the global configuration getCnMemoryLimit is used as the fallback.

This field is not consumed in INNER_SESSION/maintenance statement scenarios, where the resource specification is inherited from the parent session CN.

The upper limit is 393,216 MB (384 GB). Values exceeding this limit will result in a 400 INVALID_PARAMETER error.

Range: (0, 393,216] MB.

Default Value: If not passed, the global configuration fallback value (for example, 16,384 MB) is used.

Table 4 CatalogContext

Parameter

Mandatory

Type

Description

catalog_name

Yes

String

Definition: LakeFormation catalog name.

Constraints: N/A

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

Default Value: N/A

Response Parameters

Status code: 200

Table 5 Response body parameters

Parameter

Type

Description

session_id

String

Definition: Session ID.

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

status

String

Definition: Session status.

Range

  • RUNNING: Running.

  • CLOSED: Closed.

  • WAITING: Waiting.

  • CREATING: Creating.

  • FAIL: Failed.

cpu

Integer

Definition: CPU resource size (millicores).

memory

Integer

Definition: Memory resource size (MB).

Status code: 400

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: 401

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: 403

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: 404

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.

Status code: 408

Table 10 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 11 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 creating a SQL session in a specified workspace and endpoint.

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

{
  "endpoint_name" : "aura_endpoint",
  "catalog_context" : {
    "catalog_name" : "catalog_default"
  }
}

Example Responses

Status code: 200

{
  "session_id" : "ac8111bf-3601-4905-8ddd-b41d3e636a4e",
  "status" : "RUNNING"
}

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

200

Request succeeded.

400

Invalid request.

401

Unauthorized.

403

Request denied.

404

The requested resource could not be found.

408

Request timeout.

500

Internal server error.