Get the metadata field list
Get the metadata field list
Query the Agent's metadata field definitions. The response groups global fields and fields specific to each knowledge base. Predefined system fields, such as document_name, are not returned.
Request Method
GET
Endpoint
https://api-${endpoint}.gptbots.ai/v1/bot/doc/metadata/field/list
Authentication
For authentication details, see API Overview.
Request
Request Example
curl -X GET 'https://api-${endpoint}.gptbots.ai/v1/bot/doc/metadata/field/list' \
-H 'Authorization: Bearer ${API Key}'
curl -X GET 'https://api-${endpoint}.gptbots.ai/v1/bot/doc/metadata/field/list' \
-H 'Authorization: Bearer ${API Key}'
This code block in the floating window
Request Headers
| Field | Type | Description |
|---|---|---|
| Authorization | Bearer ${API Key} | Authenticate with Authorization: Bearer ${API Key}. Obtain the API Key from the API Keys page. |
Request Parameters
No request parameters. The Agent is identified from the API Key.
Response
Response Example
{
"global_fields": [
{
"id": "665f1c8a9b2e4d001a3f0001",
"name": "category",
"display_name": "Category",
"type": "LIST",
"options": ["Technical", "Product"],
"description": "Document category",
"ai_search_filter": true,
"is_predefined": false
}
],
"knowledge_bases": [
{
"knowledge_base_id": "kb_001",
"knowledge_base_name": "Product Documentation",
"fields": [
{
"id": "665f1c8a9b2e4d001a3f0009",
"name": "product_line",
"display_name": "Product line",
"type": "STRING",
"options": null,
"description": "",
"ai_search_filter": false,
"is_predefined": false
}
]
},
{
"knowledge_base_id": "kb_002",
"knowledge_base_name": "After-sales FAQ",
"fields": []
}
]
}
{
"global_fields": [
{
"id": "665f1c8a9b2e4d001a3f0001",
"name": "category",
"display_name": "Category",
"type": "LIST",
"options": ["Technical", "Product"],
"description": "Document category",
"ai_search_filter": true,
"is_predefined": false
}
],
"knowledge_bases": [
{
"knowledge_base_id": "kb_001",
"knowledge_base_name": "Product Documentation",
"fields": [
{
"id": "665f1c8a9b2e4d001a3f0009",
"name": "product_line",
"display_name": "Product line",
"type": "STRING",
"options": null,
"description": "",
"ai_search_filter": false,
"is_predefined": false
}
]
},
{
"knowledge_base_id": "kb_002",
"knowledge_base_name": "After-sales FAQ",
"fields": []
}
]
}
This code block in the floating window
Success Response
| Field | Type | Description |
|---|---|---|
| global_fields | Array<Object> | Global fields that apply to all documents under the Agent. |
| id | String | Field ID, used when editing/deleting. |
| name | String | Field internal identifier, lowercase, unique. |
| display_name | String | Field display name, unique. |
| type | String | Field type: STRING / NUMBER / DATETIME / LIST. |
| options | Array<String> | Enumeration options for LIST fields; null for other field types. |
| description | String | Field description. |
| ai_search_filter | Boolean | Whether to use as AI Search filter field. |
| is_predefined | Boolean | Whether it is a system preset field. |
| knowledge_bases | Array<Object> | Each knowledge base and its exclusive fields. |
| knowledge_base_id | String | Knowledge Base ID. |
| knowledge_base_name | String | Knowledge base name. |
| fields | Array<Object> | Fields specific to this knowledge base, using the same structure as global_fields. |
Error Response
| Field | Type | Description |
|---|---|---|
| code | Integer | Error code. |
| message | String | Error details. |
