logo
Development
Search
Get document metadata

Get document metadata

Query document metadata in batches by document ID. The response includes auto_metadata (system-generated, read-only values) and metadata (custom field values). You can query up to 50 documents per request.

Request Method

GET

Endpoint

https://api-${endpoint}.gptbots.ai/v1/bot/doc/metadata/detail

Authentication

For authentication details, see API Overview.

Request

Request Example

curl -X GET 'https://api-${endpoint}.gptbots.ai/v1/bot/doc/metadata/detail?doc_ids=doc_001,doc_002' \ -H 'Authorization: Bearer ${API Key}'
                      
                      curl -X GET 'https://api-${endpoint}.gptbots.ai/v1/bot/doc/metadata/detail?doc_ids=doc_001,doc_002' \
-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

Field Type Required Description
doc_ids String Yes Comma-separated document IDs, up to 50 per request. Every document must belong to the Agent associated with the current API Key. If any document does not exist or is outside the current Agent, the entire request fails with one or more doc_ids do not exist or do not belong to the current bot.

Response

Response Example

{ "documents": [ { "doc_id": "doc_001", "auto_metadata": { "document_name": "API Specification.pdf", "upload_time": "2026-01-15T10:30:00Z" }, "metadata": { "category": "Technical", "priority": "P1" } } ] }
                      
                      {
    "documents": [
        {
            "doc_id": "doc_001",
            "auto_metadata": {
                "document_name": "API Specification.pdf",
                "upload_time": "2026-01-15T10:30:00Z"
            },
            "metadata": {
                "category": "Technical",
                "priority": "P1"
            }
        }
    ]
}

                    
This code block in the floating window

Success Response

Field Type Description
documents Array<Object> Metadata of each document; documents without metadata records will not be returned.
doc_id String Document ID.
auto_metadata Object Metadata automatically filled in by the system (document name/upload time/uploader/source, etc.), read-only.
metadata Object Custom metadata values in the format "field name → value".

Error Response

Field Type Description
code Integer Error code.
message String Error details.