Help Center/ KooPhone/ API Reference/ APIs/ Instance Management/ Canceling Instance Assignment
Updated on 2025-11-24 GMT+08:00

Canceling Instance Assignment

Function

Before calling this API, ensure that the tenant has purchased an instance. This API is used to cancel the assignment of a cloud phone to a user specified by a tenant. After the API is called, the cloud phone usage data of the user is cleared.

Authorization Information

Each account has all the permissions required to call all APIs, but IAM users must be assigned the required permissions.

  • If you are using role/policy-based authorization, see Permissions Policies and Supported Actions for details on the required permissions.
  • If you are using identity policy-based authorization, the following identity policy-based permissions are required.

    Action

    Access Level

    Resource Type (*: required)

    Condition Key

    Alias

    Dependencies

    koophone:cloudphoneResource:instanceUnassign

    Write

    cloudphoneResource *

    -

    -

    -

URI

POST /v1/instances/unassign

Request Parameters

Table 1 Request header parameters

Parameter

Mandatory

Type

Description

x-request-id

Yes

String

Unique ID of a request.

X-Auth-Token

Yes

String

Tenant-level token.

Table 2 Request body parameters

Parameter

Mandatory

Type

Description

user_instances

Yes

Array of UserInstanceInfo objects

User instance information.

Table 3 UserInstanceInfo

Parameter

Mandatory

Type

Description

user_id

Yes

String

User ID. The value can contain a maximum of 32 characters.

instance_id

Yes

String

Instance ID. The value can contain a maximum of 32 characters.

Response Parameters

Status code: 200

Table 4 Response body parameters

Parameter

Type

Description

error_code

String

Response code. The error code specification is KooPhone.API.1001, and the number increases in ascending order.

error_msg

String

Error description.

data

data object

Result returned by a asynchronous task.

Table 5 data

Parameter

Type

Description

task_id

String

Task ID.

cmd_jobs

Array of CmdJob objects

Response task list.

Table 6 CmdJob

Parameter

Type

Description

instance_id

String

Instance list.

job_id

String

Asynchronization command task ID.

Status code: 400

Table 7 Response body parameters

Parameter

Type

Description

error_code

String

0: successful.

KOOPHONE.API.0000: The tenant does not exist.

KOOPHONE.API.1000: The request parameter is incorrect.

KOOPHONE.API.1001: Insufficient instance permissions.

KOOPHONE.API.2210: The binding relationship between the user and the instance does not exist.

KOOPHONE.API.9999: Internal service error.

error_msg

String

Error message.

Status code: 500

Table 8 Response body parameters

Parameter

Type

Description

error_code

String

0: successful.

KOOPHONE.API.0000: The tenant does not exist.

KOOPHONE.API.1000: The request parameter is incorrect.

KOOPHONE.API.1001: Insufficient instance permissions.

KOOPHONE.API.2210: The binding relationship between the user and the instance does not exist.

KOOPHONE.API.9999: Internal service error.

error_msg

String

Error message.

Example Requests

/instances/unassign

{
  "user_instances" : [ {
    "instance_id" : "a44uhlf7",
    "user_id" : 1123422
  } ]
}

Example Responses

Status code: 200

Normal response.

{
  "data" : {
    "task_id" : "RM_6837531fd3f54550927b930180a706bf",
    "cmd_jobs" : [ {
      "instance_id" : "a44uhlf7",
      "job_id" : "1564567b8bab40f34711234cb80d0123"
    }, {
      "instance_id" : "efjy72gs",
      "job_id" : "1564567b8bab40f34711234cb80d0456"
    } ]
  },
  "error_code" : "0",
  "error_msg" : "ok"
}

Status Codes

Status Code

Description

200

Normal response.

400

Request error.

500

Internal error.

Error Codes

See Error Codes.