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 theX-API-KeyHeader.$WORKSPACE_ID: Target workspace ID, passed throughX-Workspace-IDHeader.
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 |
|---|---|---|---|
|
string |
Yes |
Catalog name, must be a valid identifier. |
|
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 |
|---|---|---|
|
string |
|
|
string |
|
|
integer or null |
ID of the new Catalog; if not provided by the server, it is |
Error response¶
{
"code": "ErrAlreadyExists",
"msg": "Catalog 名称已存在",
"data": null
}
Common HTTP errors¶
HTTP status code |
error code |
Common causes |
Recommended actions |
|---|---|---|---|
|
|
The request body is invalid, has an empty name, or is not a valid identifier. |
Use a valid and non-empty |
|
|
The current identity does not have permission to create Catalog. |
Requesting permission to |
|
|
There is already a Catalog with the same name in the current workspace. |
Change the name or query the existing catalog. |
|
|
The server failed to create the Catalog. |
Try again later. |
Follow-up operations¶
Use data.id Query Catalog details.