Create Catalog

Create a catalog in the current workspace.

POST https://moi.matrixorigin.cn/newmoi/catalog/create

Preparation before calling

Prepare a personal access token and target workspace ID that has 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.

Request example

curl -X POST "https://moi.matrixorigin.cn/newmoi/catalog/create" \
  -H "X-API-Key: $AI_STUDIO_API_KEY" \
  -H "X-Workspace-ID: $WORKSPACE_ID" \
  -H 'Content-Type: application/json' \
  -d '{
    "name": "<CATALOG_NAME>",
    "description": "<CATALOG_DESCRIPTION>"
  }'

Request body

Parameter

Type

Required

Description

name

string

Yes

Catalog name, must be a valid identifier.

description

string

No

Catalog description.

Successful response

Returns 200 on success. Save data.id for subsequent operations.

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

The response fields are as follows.

Field

Type

Description

code

string

OK on success.

msg

string

OK on success.

data.id

integer or null

ID of the new Catalog; if not provided by the server, it is null.

Error response

{
  "code": "ErrAlreadyExists",
  "msg": "Catalog 名称已存在",
  "data": null
}

Common HTTP errors

HTTP status code

error code

Common causes

Recommended actions

400

ErrParamInvalid

The request body is invalid, has an empty name, or is not a valid identifier.

Use a valid and non-empty name.

403

ErrForbidden

The current identity does not have permission to create Catalog.

Requesting permission to catalog.create.

409

ErrAlreadyExists

There is already a Catalog with the same name in the current workspace.

Change the name or query the existing catalog.

500

ErrServer

The server failed to create the Catalog.

Try again later.

Follow-up operations

Use data.id Query Catalog details.

Last updated on