Update a workspace

Change the name of an existing workspace.

PATCH https://moi.matrixorigin.cn/newmoi/workspaces/{id}

Before you call

First list workspaces to confirm the workspace to update. Prepare a personal access token and the workspace ID. You do not need to enter a workspace before calling this API.

Path parameter and request body

Replace $AI_STUDIO_API_KEY, $WORKSPACE_ID, and $WORKSPACE_NAME with actual values.

curl -X PATCH "https://moi.matrixorigin.cn/newmoi/workspaces/$WORKSPACE_ID" \
  -H "X-API-Key: $AI_STUDIO_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "'"$WORKSPACE_NAME"'"
  }'

Parameter

Type

Required

Description

id

string

Yes

ID of the workspace to update.

name

string

Yes

New workspace name. It cannot be empty.

Successful response

On success, the API returns 200, which indicates that the name was saved.

{
  "code": "OK",
  "msg": "OK"
}

Field

Type

Description

code

string

OK on success.

msg

string

OK on success.

Error response

{
  "code": "ErrParamInvalid",
  "msg": "Invalid request parameters",
  "data": null
}

Field

Type

Description

code

string

Error code.

msg

string

Human-readable error message.

data

null

null in an error response.

Next steps

List workspaces to confirm that the name was updated.

Last updated on