Query database table leaf nodes¶
Paged query specifies the tables directly contained in the database.
POST https://moi.matrixorigin.cn/newmoi/catalog/database/table-leaves
Preparation before calling¶
First query the database list to obtain the 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 theX-API-KeyHeader.$WORKSPACE_ID: Target workspace ID, passed throughX-Workspace-IDHeader.$DATABASE_ID: The database ID to be queried.
Request example¶
curl -X POST "https://moi.matrixorigin.cn/newmoi/catalog/database/table-leaves" \
-H "X-API-Key: $AI_STUDIO_API_KEY" \
-H "X-Workspace-ID: $WORKSPACE_ID" \
-H "Content-Type: application/json" \
-d '{
"database_id": '"$DATABASE_ID"',
"page_size": 20
}'
Request body¶
Parameter |
Type |
Required |
Description |
|---|---|---|---|
|
integer |
Yes |
Database ID, must be a positive integer. |
|
integer |
No |
Single page return quantity. |
|
string |
No |
The paging mark returned by the previous page response. |
|
string |
No |
Table name filter value. |
Successful response¶
Returns 200 on success. When next_page_token in the response has a value, use it to continue querying the next page; when there is no next page, this field may be omitted.
{
"code": "OK",
"msg": "OK",
"data": {
"items": [
{
"table_id": 101,
"table_name": "orders",
"database_id": 10,
"created_at": "2026-08-01T09:00:00Z",
"updated_at": "2026-08-01T09:00:00Z"
}
],
"total": 1
}
}
The response fields are as follows.
Field |
Type |
Description |
|---|---|---|
|
array |
Current page table list. |
|
integer |
Table ID. |
|
string |
Table name. |
|
integer |
ID of the database to which it belongs. |
|
string |
Creation time. |
|
string |
Update time. |
|
integer |
The total number of matching tables. |
|
string |
Optional. Next page pagination token; may be omitted if there is no next page. |
In field paths, [] means each item in an array. For example, data.items[].table_id is the table_id field of each item in data.items.
Error response¶
{
"code": "ErrParamInvalid",
"msg": "Invalid request parameter",
"data": null
}
Common HTTP errors¶
HTTP status code |
error code |
Common causes |
Recommended actions |
|---|---|---|---|
|
|
The database ID, request body, or pagination tag is invalid. |
Check request fields; only use pagination tags returned from the last response. |
|
|
The current identity does not have permission to read the database or table. |
Use credentials with read permissions. |
|
|
The server failed to read the table list. |
Try again later. |