Help Center/ DataArts Fabric/ API Reference/ APIs/ SQL APIs/ Querying the SQL Session List
Updated on 2025-09-15 GMT+08:00

Querying the SQL Session List

Function

This API is used to query the SQL session list.

URI

GET /v1/workspaces/{workspace_id}/sessions

Table 1 Path Parameters

Parameter

Mandatory

Type

Description

workspace_id

Yes

String

Definition: Workspace ID.

Constraints: N/A.

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

Default Value: N/A.

Table 2 Query Parameters

Parameter

Mandatory

Type

Description

endpoint_id

No

String

Definition: Endpoint ID, allowing you to search for endpoints by their ID.

Constraints: N/A.

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

Default Value: N/A.

status

No

String

  • Definition: status filtering. Only one status can be queried. By default, all statuses are queried.

  • Constraints: N/A.

  • Range: RUNNING, CLOSED, WAITING, CREATING, or FAIL

  • Default Value: N/A.

session_id

No

String

  • Definition: ID of a session.

  • Constraints: N/A.

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

  • Default Value: N/A.

limit

No

Integer

Definition: Maximum number of records returned on each page.

Constraints: N/A.

Range: [1, 100].

Default Value: 10.

offset

No

Integer

Definition: Offset where a query starts.

Constraints: N/A.

Range: [0, 1000000000].

Default Value: 0.

Request Parameters

Table 3 Request header parameters

Parameter

Mandatory

Type

Description

X-Auth-Token

No

String

Definition: Tenant token.

Constraints: N/A.

Range: N/A.

Default Value: N/A.

Response Parameters

Status code: 200

Table 4 Response body parameters

Parameter

Type

Description

sessions

Array of SqlSessionInfo objects

Definition: session list.

Constraints: N/A.

Range: N/A.

Default Value: N/A.

total

Integer

Total number.

Table 5 SqlSessionInfo

Parameter

Type

Description

session_id

String

Definition: Session ID.

Constraints: N/A.

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

Default Value: N/A.

status

String

Definition

  • RUNNING

  • CLOSED

  • WAITING

  • CREATING

  • FAIL

Constraints: N/A

Range: RUNNING, CLOSED, WAITING, CREATING, or FAIL

Default Value: N/A

create_time

String

  • Definition: session creation time.

  • Constraints: N/A.

  • Range: N/A.

  • Default Value: N/A.

endpoint_info

endpoint_info object

  • Definition: endpoint information for creating a session.

  • Constraints: N/A.

  • Range: N/A.

  • Default Value: N/A.

Table 6 endpoint_info

Parameter

Type

Description

id

String

  • Definition: endpoint ID.

  • Constraints: N/A.

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

  • Default Value: N/A.

name

String

  • Definition: endpoint name.

  • Constraints: Only letters, digits, underscores (_), hyphens (-), periods (.), and spaces are allowed.

  • Range: N/A.

  • Default Value: N/A.

Status code: 400

Table 7 Response body parameters

Parameter

Type

Description

error_code

String

Definition: Error code.

Constraints: N/A.

Range: [8, 36].

Default Value: N/A.

error_msg

String

Definition: Error message.

Constraints: N/A.

Range: [2, 4096].

Default Value: N/A.

solution_msg

String

Definition: Solution description.

Constraints: N/A.

Range: [2, 4096].

Default Value: N/A.

Status code: 401

Table 8 Response body parameters

Parameter

Type

Description

error_code

String

Definition: Error code.

Constraints: N/A.

Range: [8, 36].

Default Value: N/A.

error_msg

String

Definition: Error message.

Constraints: N/A.

Range: [2, 4096].

Default Value: N/A.

solution_msg

String

Definition: Solution description.

Constraints: N/A.

Range: [2, 4096].

Default Value: N/A.

Status code: 404

Table 9 Response body parameters

Parameter

Type

Description

error_code

String

Definition: Error code.

Constraints: N/A.

Range: [8, 36].

Default Value: N/A.

error_msg

String

Definition: Error message.

Constraints: N/A.

Range: [2, 4096].

Default Value: N/A.

solution_msg

String

Definition: Solution description.

Constraints: N/A.

Range: [2, 4096].

Default Value: N/A.

Status code: 408

Table 10 Response body parameters

Parameter

Type

Description

error_code

String

Definition: Error code.

Constraints: N/A.

Range: [8, 36].

Default Value: N/A.

error_msg

String

Definition: Error message.

Constraints: N/A.

Range: [2, 4096].

Default Value: N/A.

solution_msg

String

Definition: Solution description.

Constraints: N/A.

Range: [2, 4096].

Default Value: N/A.

Status code: 500

Table 11 Response body parameters

Parameter

Type

Description

error_code

String

Definition: Error code.

Constraints: N/A.

Range: [8, 36].

Default Value: N/A.

error_msg

String

Definition: Error message.

Constraints: N/A.

Range: [2, 4096].

Default Value: N/A.

solution_msg

String

Definition: Solution description.

Constraints: N/A.

Range: [2, 4096].

Default Value: N/A.

Example Requests

Query the session information. The returned information includes the session status, creation time, and endpoint.

GET https://endpoint/v1/workspaces/{workspace_id}/sessions?endpoint_id=

{ }

Example Responses

Status code: 200

Response body for querying sessions.

{
  "sessions" : [ {
    "session_id" : "284888e2-c36f-4bec-9b24-e5bf0b386ab0",
    "status" : "RUNINNG",
    "create_time" : "2025-07-22T08:42:39.000+00:00",
    "endpoint_info" : {
      "id" : "0470d220-aaaa-410e-a417-0d69a0215683",
      "name" : "test2"
    }
  }, {
    "session_id" : "4e4b2770-702f-48b7-9737-db107cf63e24",
    "status" : "CLOSED",
    "create_time" : "2025-07-22T06:13:47.000+00:00",
    "endpoint_info" : {
      "id" : "0470d220-aaaa-410e-a417-0d69a0215683",
      "name" : "test2"
    }
  } ],
  "total" : 15
}

Status code: 400

BadRequest

{
  "error_code" : "common.01000001",
  "error_msg" : "failed to read http request, please check your input, code: 400, reason: Type mismatch., cause: TypeMismatchException"
}

Status code: 401

Unauthorized

{
  "error_code" : "APIG.1002",
  "error_msg" : "Incorrect token or token resolution failed"
}

Status code: 403

Forbidden

{
  "error" : {
    "code" : "403",
    "message" : "X-Auth-Token is invalid in the request",
    "title" : "Forbidden"
  },
  "error_code" : 403,
  "error_msg" : "X-Auth-Token is invalid in the request",
  "title" : "Forbidden"
}

Status code: 404

NotFound

{
  "error_code" : "common.01000001",
  "error_msg" : "response status exception, code: 404"
}

Status code: 408

Request Time-out

{
  "error_code" : "common.00000408",
  "error_msg" : "timeout exception occurred"
}

Status code: 500

InternalServerError

{
  "error_code" : "common.00000500",
  "error_msg" : "internal error"
}

Status Codes

Status Code

Description

200

Response body for querying sessions.

400

BadRequest

401

Unauthorized

403

Forbidden

404

NotFound

408

Request Time-out

500

InternalServerError

Error Codes

See Error Codes.