Claim a workspace

Check whether the current user has joined the specified workspace. This interface does not create a workspace, add members, or transfer workspace ownership.

HTTP
POST $CLOUDSIGMA_API_BASE/workspaces/claim

Before you call

Configure the CloudSigma regional endpoint and authentication before calling. The endpoint, credentials, workspace, and resource IDs must belong to the same region. First confirm that the current identity is a member of the target workspace. Prepare personal access token and target workspace ID. The claimed object can only be the current calling identity, and other users cannot be specified.

Request body

Replace $CLOUDSIGMA_API_KEY and $WORKSPACE_ID with actual values.

Shell
curl -X POST "$CLOUDSIGMA_API_BASE/workspaces/claim" \
  -H "X-API-Key: $CLOUDSIGMA_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "workspace_id": "'"$WORKSPACE_ID"'"
  }'

Parameter

Type

Required

Description

workspace_id

string

Yes

The workspace ID to be claimed.

Successful response

JSON
{
  "code": "OK",
  "msg": "OK",
  "data": {
    "workspace_id": "ws_01",
    "claimed": false,
    "already_claimed": true
  }
}

Field

Type

Description

code

string

OK on success.

msg

string

OK on success.

data.workspace_id

string

The workspace ID whose membership has been checked.

data.claimed

boolean

Fixed to false. This interface does not transfer workspace ownership.

data.already_claimed

boolean

Fixed to true. An existing member may return this value even if it is not the owner.

Error response

JSON
{
  "code": "ErrWorkspaceNotFound",
  "msg": "工作区不存在",
  "data": null
}

Field

Type

Description

code

string

error code.

msg

string

Readable error message.

data

null

The error response is null.

Last updated on