Help Center/ AI DataLake/ API Reference/ Ray APIs/ RayJob Management/ Closing an Interactive Session
Updated on 2026-11-06 GMT+08:00

Closing an Interactive Session

Function

This API is used to close an existing interactive session and set the session status to successful. This API is synchronous.

Calling Method

For details, see Calling APIs.

URI

DELETE /v2/workspaces/{workspace_id}/ray-sessions/{session_id}

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. For how to obtain the value, see the session_id returned after calling the Creating an Interactive Session API.

Constraints: N/A

Range: 32 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

No

String

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

Constraints: N/A

Range: Up to 65,534 characters.

Default Value: N/A

Response Parameters

Status code: 200

Table 3 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 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 512 characters.

solution_msg

String

Definition: Solution description.

Range: 0 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 512 characters.

solution_msg

String

Definition: Solution description.

Range: 0 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 512 characters.

solution_msg

String

Definition: Solution description.

Range: 0 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 512 characters.

solution_msg

String

Definition: Solution description.

Range: 0 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 512 characters.

solution_msg

String

Definition: Solution description.

Range: 0 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 512 characters.

solution_msg

String

Definition: Solution description.

Range: 0 to 4,096 characters.

Example Requests

Close an existing interactive session.

DELETE https://{endpoint}/v2/workspaces/{workspace_id}/ray-sessions/{session_id}

Example Responses

Status code: 200

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

Status code: 400

{
  "error_code" : "common.01000001",
  "error_msg" : "failed to read http request, please check your input, code: 400, reason: Type mismatch., cause: TypeMismatchException",
  "solution_msg" : "Check whether the request parameters comply with the API definition and try again."
}

Status code: 401

{
  "error_code" : "APIG.1002",
  "error_msg" : "Incorrect token or token resolution failed",
  "solution_msg" : "Please check if auth token is included in the request header."
}

Status code: 403

{
  "error_code" : "APIG.1003",
  "error_msg" : "X-Auth-Token is invalid in the request",
  "solution_msg" : "Check whether the token in the request is valid and try again."
}

Status code: 404

{
  "error_code" : "common.01000001",
  "error_msg" : "response status exception, code: 404",
  "solution_msg" : "Please try to use correct info."
}

Status code: 408

{
  "error_code" : "common.00000408",
  "error_msg" : "timeout exception occurred",
  "solution_msg" : "The backend request timed out — check service health and network connectivity, then retry."
}

Status code: 500

{
  "error_code" : "common.00000500",
  "error_msg" : "internal error",
  "solution_msg" : "Contact operations for analysis."
}

Status Codes

Status Code

Description

200

Response body for closing an interactive session.

400

Invalid request.

401

Unauthorized.

403

Request denied.

404

The requested resource could not be found.

408

Request timeout.

500

Internal server error.