List connectors¶
List connectors that you can read in the current workspace. Use this endpoint to find a connector ID, then get its details, update or delete it, or create a data task.
GET https://moi.matrixorigin.cn/newmoi/connectors/list
Before you call¶
Prepare a personal access token that can access the target workspace and the target workspace ID.
The example uses:
$AI_STUDIO_API_KEY: your personal access token, sent in theX-API-Keyheader.$WORKSPACE_ID: the workspace to query, sent in theX-Workspace-IDheader.
Request example¶
curl "https://moi.matrixorigin.cn/newmoi/connectors/list?page=1&page_size=20" \
-H "X-API-Key: $AI_STUDIO_API_KEY" \
-H "X-Workspace-ID: $WORKSPACE_ID"
To filter by name, append name as a query parameter.
Query parameters¶
Without query parameters, the endpoint returns the first page of connectors. Use filters to narrow the result set, and use page and page_size to paginate it.
Parameter |
Type |
Required |
Description |
|---|---|---|---|
|
string |
No |
Filter by name. |
|
integer |
No |
Page number. The default is |
|
integer |
No |
Number of items per page. The default is |
|
string |
No |
Sort field. Results are sorted by creation time in descending order when omitted. |
|
boolean |
No |
Whether to sort in descending order when |
|
string |
No |
Keyword filter. |
|
integer |
No |
Filter by one data-source type. |
|
integer[] |
No |
Filter by multiple data-source types. This parameter can be repeated. |
|
string |
No |
Filter by one connector status. |
|
string[] |
No |
Filter by multiple connector statuses. This parameter can be repeated. |
|
integer[] |
No |
Filter by connector purpose. |
[] after a type denotes an array. [] in a field path denotes each item in an array.
Successful response¶
A successful request returns 200. Get connector information from data.connectors[], and use data.total to determine the number of matching results.
{
"code": "OK",
"msg": "OK",
"data": {
"connectors": [
{
"id": "conn_01",
"name": "s3-orders-import",
"source_type": 5,
"created_at": 1735632000,
"updated_at": 1735718400,
"status": "active",
"username": "reader",
"related_task_ids": ["task_01"],
"usage_type": [1],
"config": {
"s3": {
"endpoint": "https://s3.example.com",
"bucket_name": "orders",
"region": "us-east-1"
}
}
}
],
"total": 1
}
}
Response fields are as follows.
Field |
Type |
Description |
|---|---|---|
|
string |
|
|
string |
|
|
object[] |
Connectors matching the current filters. |
|
string |
Connector ID. |
|
string |
Connector name. |
|
integer |
Data-source type code. |
|
integer |
Creation time as a Unix timestamp. |
|
integer |
Update time as a Unix timestamp. |
|
string |
Current connector status. |
|
string |
User name in the configuration. |
|
string[] |
IDs of related data tasks. |
|
integer[] |
Saved purpose list expanded by the service from the bitmask. For example, |
|
object |
Type-specific connection configuration. For top-level keys and complete fields, see Type-specific configuration fields for creating a connector. Response fields depend on the actual data-source type. |
|
integer |
Total number of connectors matching the filters. |
In this document, [] after a type means an array. In field paths, [] means each item in an array.
Read the next page¶
Use data.total and the requested page_size to calculate the last page, then increase page in sequence. For example, when total is 41 and page_size is 20, request pages 1, 2, and 3.
Error response¶
{
"code": "ErrForbidden",
"msg": "permission denied",
"data": null
}
Common HTTP errors¶
HTTP status |
Error code |
Common cause |
Recommended action |
|---|---|---|---|
|
|
A query parameter has an invalid format. |
Correct the parameter and retry. |
|
|
The caller cannot read the connector collection. |
Check workspace and connector permissions. |
|
|
The service cannot complete authorization filtering. |
Retry later; do not treat an empty list as meaning that no connectors exist. |
Next steps¶
Keep the target connector’s id, then get connector details. To select databases or tables, view browsable connectors; to browse files, list files.