Extracted fields

The fields read out of every document, per document or as a table.

Base URL https://futuresmart.ai/document-intelligence/api · every request sends x-api-key. Samples read the key from DOCUMENT_INTELLIGENCE_API_KEY. All endpoints

Get a document's extracted fields

GET/v1/{knowledge_id}/documents/{object_id}/metadata

Return document-level metadata only (no chunks/text). Includes: document_outline, document_type, entities, keywords, organizations, prepended_doc_summary, summary, temporal_context, title, topics, file_name

Credential Document Intelligence API key (x-api-key)

Path parameters

NameTypeDescription
knowledge_idrequiredstring
object_idrequiredstringDocument Object ID

Other responses

  • 422 Validation Error
import os
import requests

API_ROOT = "https://futuresmart.ai/document-intelligence/api"
API_KEY = os.environ["DOCUMENT_INTELLIGENCE_API_KEY"]

r = requests.get(
    f"{API_ROOT}/v1/YOUR_COLLECTION_ID/documents/YOUR_DOCUMENT_ID/metadata",
    headers={"x-api-key": API_KEY},
    timeout=120,
)
r.raise_for_status()
print(r.json())

Get every document's fields as a table (cursor pages)

POST/v1/{knowledge_id}/documents/metadata/all

Key Features

    Fixed schema (null for missing values)
    Includes column metadata + total count + user selection flags
    List[dict] fields expanded → exp_0_year, exp_1_year, …
    Sorting capped at 10k docs (memory safety)
    Efficient cursor-based pagination using Qdrant's next_page_offset

    Column Selection with Availability Flag

    All available columns are ALWAYS returned in the response
    Each column has an is_user_selected flag indicating if it was explicitly requested
    When columns parameter is omitted/null: all fields have is_user_selected=true
    When columns=['field1', 'field2']: only those fields have is_user_selected=true
    UI can use is_user_selected to determine default column visibility
    Users can discover and add additional columns without re-fetching data

    Transformation Rules

    dict → flatten with _ (location.city)
    List[str] → kept as array
    List[dict] → expanded to indexed columns (controlled by max_nested_items, default=3)
                 + overflow items collected in field_remaining_* columns as lists
    Nested dicts → recursive flatten

    Pagination (Cursor-Based)

    Uses efficient cursor-based pagination via page_offset
    First request: omit page_offset or set to null
    Subsequent requests: use next_page_offset from previous response
    Example first page: {"limit": 20}
    Example next page: {"limit": 20, "page_offset": "qdrant_offset_token"}
    Response includes next_page_offset (null when no more pages) and has_more flag

    Filtering (examples)

    {"document_type": "resume"}
    {"location.city": "Bangalore"}
    {"topics": ["rag", "llm"]} (any match)
    {"experience[].year": {"gte": 2022}}
    {"year": {"gte": 2020, "lte": 2025}}
    {"degree": {"in": ["M.Tech", "MS"]}}

    Sorting (uses Qdrant native order_by for efficiency)
    [{"field": "created_at", "order": "desc"}]
    [{"field": "title", "order": "asc"}, {"field": "created_at", "order": "desc"}]
    Column Selection (optional)
    ["object_id", "title", "location.city"]
    Notes

    object_id always first
    Max page size: 100
    Only active document-level fields
    System fields excluded
    All rows = same columns

Credential Document Intelligence API key (x-api-key)

Path parameters

NameTypeDescription
knowledge_idrequiredstring

Request body · application/json (optional)

NameTypeDescription
limitintegerMaximum number of documents to return (1-100)Default: 20
page_offsetstring | nullQdrant page offset token for efficient pagination. Use next_page_offset from previous response. Omit for the first page.
columnsarray<string> | nullOptional list of top-level field names to include. If not provided, all active fields are included.
filtersobject | nullOptional filter conditions. Supports scalar, nested, list, array-of-dicts, range, and in operators.
sortarray<object> | nullOptional sort configuration. List of field/order pairs. Defaults to created_at descending.Default: [{"field":"created_at","order":"desc"}]
max_nested_itemsintegerMaximum number of items to expand for List[dict] fields into field_0_*, field_1_* columns. Overflow collected into field_remaining_* columns. Set to 0 to disable.Default: 2

Response · 200

NameTypeDescription
columnsrequiredarray<ColumnSchema>Fixed schema definition for all columns in the data view.
↳ namerequiredstringColumn name as it appears in the row data
↳ original_fieldrequiredstringOriginal field name from metadata before flattening
↳ data_typerequiredstringData type using Python type notation (str, int, float, bool, dict, List[str], List[dict])
↳ is_user_selectedbooleanTrue if user selected this column or if no columns filter was specified. False if user specified columns but this column was not included.Default: true
rowsrequiredarray<object>Data rows conforming to the column schema. Every row contains all columns, null for missing values.
total_countrequiredintegerTotal number of documents matching the filter criteria (before pagination)
current_countrequiredintegerNumber of documents returned in the current response
next_page_offsetstring | nullQdrant page offset token for fetching the next page. None if no more pages available.
has_morerequiredbooleanTrue if more documents are available beyond this page
extraction_contextobjectPer returned object ID, latest successful field-name context. Unknown is not an attempted-empty result; definitions/types are not recorded.

Other responses

  • 422 Validation Error
import os
import requests

API_ROOT = "https://futuresmart.ai/document-intelligence/api"
API_KEY = os.environ["DOCUMENT_INTELLIGENCE_API_KEY"]

r = requests.post(
    f"{API_ROOT}/v1/YOUR_COLLECTION_ID/documents/metadata/all",
    headers={"x-api-key": API_KEY},
    json={
        "limit": 20,
        "sort": [{
            "field": "title",
            "order": "asc",
        }, {
            "field": "created_at",
            "order": "desc",
        }],
        "max_nested_items": 2,
    },
    timeout=120,
)
r.raise_for_status()
print(r.json())

Example request body

JSON
{
  "limit": 20,
  "sort": [
    {
      "field": "title",
      "order": "asc"
    },
    {
      "field": "created_at",
      "order": "desc"
    }
  ],
  "max_nested_items": 2
}

Response shape (200)

JSON
{
  "columns": [
    {
      "name": "<name>",
      "original_field": "<original_field>",
      "data_type": "<data_type>",
      "is_user_selected": true
    }
  ],
  "rows": [
    {}
  ],
  "total_count": 0,
  "current_count": 0,
  "has_more": false
}

Get every document's fields as a table

POST/v2/{knowledge_id}/documents/metadata/all

Simplified API with page-based pagination (1, 2, 3...) for UI table views.

    **Key Features**
    - Fixed schema tabular format (null for missing values)
    - Simple page numbers instead of cursor tokens
    - Column schema includes field_path, subcolumn, parent_type for UI filter builder
    - List[dict] fields expanded → experience_0_role, experience_1_role, …
    - Overflow items collected in experience_remaining_role columns

    **Column Schema (ColumnSchemaV2)**
    - name: flattened column key used in row data (e.g. address_city)
    - original_field: top-level field — use in columns/sort/filters (e.g. address)
    - field_path: filter key in dot/bracket notation (e.g. address.city, experience[].role)
    - subcolumn: leaf key for nested fields (e.g. city, role); null for scalar/List[str]
    - parent_type: scalar | list_str | dict | list_dict
    - is_user_selected: true if field was in columns request or columns was omitted

    **Pagination**
    - 1-indexed (page=1 is first page)
    - has_more = current_page < total_pages

    **Filter Syntax** — {"field": {"op": "<op>", "value": <val>}}
    - eq: exact match — {"document_type": {"op": "eq", "value": "Resume"}}
    - ne: not equal — {"document_type": {"op": "ne", "value": "Resume"}}
    - contains: substring match — {"summary": {"op": "contains", "value": "Python"}}
    - not_contains: does not contain — {"summary": {"op": "not_contains", "value": "Java"}}
    - is_empty: null or empty field — {"phone": {"op": "is_empty"}}
    - is_not_empty: non-null, non-empty — {"phone": {"op": "is_not_empty"}}
    - gte / lte / gt / lt: range — {"education[].year": {"op": "gte", "value": "2018"}}
    - in: match any in list — {"current_role": {"op": "in", "value": ["Dev", "Analyst"]}}
    - Nested dict field: use dot notation key — {"address.city": {"op": "eq", "value": "Kochi"}}
    - Array of dicts: use bracket notation key — {"experience[].company": {"op": "eq", "value": "KeralaSoft"}}

    **Sorting**
    - Default: created_at desc
    - Single field: Qdrant native order_by (efficient)
    - Multi-field: in-memory sort, capped at 10,000 docs

Credential Document Intelligence API key (x-api-key)

Path parameters

NameTypeDescription
knowledge_idrequiredstring

Request body · application/json (optional)

NameTypeDescription
pageinteger1-indexed page number (first page is 1)Default: 1
page_sizeintegerItems per page (1-100)Default: 20
columnsarray<string> | nullOptional list of top-level field names to include. If not provided, all active fields are included.
filtersobject | nullOptional filter conditions for document metadata.
sortarray<object> | nullOptional sort configuration. Defaults to created_at descending.Default: [{"field":"created_at","order":"desc"}]
max_nested_itemsintegerMaximum number of items to expand into individual columns for List[dict] fields. Set to 0 to disable.Default: 2

Response · 200

NameTypeDescription
columnsrequiredarray<ColumnSchemaV2>Schema definitions for each column in the data view
↳ namerequiredstringFlattened column key used in row data (e.g. location_country)
↳ original_fieldrequiredstringTop-level field name — use in filters/sort/columns requests (e.g. location)
↳ field_pathrequiredstringDot-notation path to use as the filter key (e.g. location.country, experience[].year)
↳ subcolumnstring | nullLeaf key within nested field (e.g. country, year); null for scalar and List[str]
↳ parent_typerequiredstringParent field type: scalar, list_str, dict, or list_dict
↳ data_typerequiredstringData type using Python type notation (str, int, float, bool, dict, List[str], List[dict])
↳ sort_fieldstring | nullPayload key to use as sort field. scalar → field name, dict → dot path (e.g. address.city), list_dict with numeric index → bracket path (e.g. experience[1].company). Null for list_str and list_dict _remaining_ columns (not sortable).
↳ is_user_selectedbooleanTrue if user selected this column or if no columns filter was specified. False if user specified columns but this column was not included.Default: true
rowsrequiredarray<object>Data rows conforming to the column schema. Every row contains all columns, null for missing values.
total_countrequiredintegerTotal number of documents matching the filter criteria (before pagination)
current_countrequiredintegerNumber of documents returned in the current page
current_pagerequiredintegerCurrent page number (1-indexed)
total_pagesrequiredintegerTotal number of pages available based on page_size and total_count
extraction_contextobjectPer returned object ID, latest successful field-name context. Unknown is not an attempted-empty result; definitions/types are not recorded.

Other responses

  • 422 Validation Error
import os
import requests

API_ROOT = "https://futuresmart.ai/document-intelligence/api"
API_KEY = os.environ["DOCUMENT_INTELLIGENCE_API_KEY"]

r = requests.post(
    f"{API_ROOT}/v2/YOUR_COLLECTION_ID/documents/metadata/all",
    headers={"x-api-key": API_KEY},
    json={
        "page": 1,
        "page_size": 20,
        "sort": [{
            "field": "title",
            "order": "asc",
        }, {
            "field": "created_at",
            "order": "desc",
        }],
        "max_nested_items": 2,
    },
    timeout=120,
)
r.raise_for_status()
print(r.json())

Example request body

JSON
{
  "page": 1,
  "page_size": 20,
  "sort": [
    {
      "field": "title",
      "order": "asc"
    },
    {
      "field": "created_at",
      "order": "desc"
    }
  ],
  "max_nested_items": 2
}

Response shape (200)

JSON
{
  "columns": [
    {
      "name": "<name>",
      "original_field": "<original_field>",
      "field_path": "<field_path>",
      "parent_type": "<parent_type>",
      "data_type": "<data_type>",
      "is_user_selected": true
    }
  ],
  "rows": [
    {}
  ],
  "total_count": 0,
  "current_count": 0,
  "current_page": 0,
  "total_pages": 0
}

Get the field definitions

GET/v1/{knowledge_id}/enrichment

Get enrichment configuration v2 with metadata (unique values) per field.

When field_name is provided, returns possible values for that specific metadata field with optional filtering. When field_name is not provided, returns all field configurations (backward compatible behavior).

Credential Document Intelligence API key (x-api-key)

Path parameters

NameTypeDescription
knowledge_idrequiredstring

Query parameters

NameTypeDescription
include_metadatabooleanWhether to include metadata in the responseDefault: false
field_namestring | nullReturn values only for this specific field.
filtersstring | nullJSON-encoded dict for filtering documents (e.g., '{"document_type": "case_study"}').
limitinteger | nullLimit number of results.

Other responses

  • 422 Validation Error
import os
import requests

API_ROOT = "https://futuresmart.ai/document-intelligence/api"
API_KEY = os.environ["DOCUMENT_INTELLIGENCE_API_KEY"]

r = requests.get(
    f"{API_ROOT}/v1/YOUR_COLLECTION_ID/enrichment",
    headers={"x-api-key": API_KEY},
    timeout=120,
)
r.raise_for_status()
print(r.json())