Update database

Update database description. This interface does not support renaming.

POST https://moi.matrixorigin.cn/newmoi/catalog/database/update

Preparation before calling

First query the database list to obtain the target database ID. Prepare the personal access token, target workspace ID, and database ID that have access to the target workspace.

The example below uses:

  • $AI_STUDIO_API_KEY: The actual personal access token, passed through the X-API-Key Header.

  • $WORKSPACE_ID: Target workspace ID, passed through X-Workspace-ID Header.

  • $DATABASE_ID: Database ID to update.

Do not pass in name; this field will cause the request to fail.

Request example

curl -X POST "https://moi.matrixorigin.cn/newmoi/catalog/database/update" \
  -H "X-API-Key: $AI_STUDIO_API_KEY" \
  -H "X-Workspace-ID: $WORKSPACE_ID" \
  -H 'Content-Type: application/json' \
  -d '{
    "id": '"$DATABASE_ID"',
    "description": "<DATABASE_DESCRIPTION>"
  }'

Request body

Parameter

Type

Required

Description

id

integer

Yes

Database ID.

description

string

No

Updated description.

Successful response

Returns 200 and the ID of the updated database on success.

{
  "code": "OK",
  "msg": "OK",
  "data": {
    "id": 2
  }
}

The response fields are as follows.

Field

Type

Description

code

string

OK on success.

msg

string

OK on success.

data.id

integer or null

Updated database ID; null if not provided by the server.

Error response

{
  "code": "ErrDatabaseRenameUnsupported",
  "msg": "不支持重命名数据库",
  "data": null
}

Common HTTP errors

HTTP status code

error code

Common causes

Recommended actions

400

ErrParamInvalid

The request body or database ID is invalid.

Use positive integer IDs.

400

ErrDatabaseRenameUnsupported

The request body contains name.

Removed name and only updated the description.

403

ErrForbidden

The current identity does not have update permissions.

Requesting permission to database.update.

409

ErrReadonlySystemDatabaseErrReadonlyReservedDatabase

Target a read-only system or a reserved database.

Do not update this database.

500

ErrServer

The server failed to update the database.

Try again later.

Follow-up operations

Use the same resource identifier Query database details to confirm the update result.

Last updated on