Skip to main content

File Search API

Do vector search over indexed files based on tags or query.

Endpoint/md/file/search
URLhttps://us-central.unstract.com/api/v1/md/file/search
MethodPOST
HeadersAuthorization: Bearer <platform_key>

Request Body Form Data

FieldTypeDescription
email(text)User email
query(text)OPTIONAL Query for semantic search over indexed files
tags(text, repeated)OPTIONAL Tags for metadata search over indexed files
chunk_size(text, repeated)OPTIONAL Chunk size to be used for indexing
chunk_overlap(text, repeated)OPTIONAL Chunk overlap to be used for indexing
explain(text)OPTIONAL Enable tracing [true

Success Response

  • Status: 200

  • Content-Type: application/json

  • Body:

    {
    "count": 0,
    "docs": [
    {
    "doc_id": "",
    "file_name": "",
    "tags": [
    "",
    ]
    },
    ]
    }
  • Example:

    {
    "count": 1,
    "docs": [
    {
    "doc_id": "62758012e555657955f186d4f653acc6b535f8b3ce73cffacac9b0ab077fce1c",
    "file_name": "Airtel.pdf",
    "tags": [
    "invoice"
    ]
    }
    ]
    }

Error Response

  • Status: 4xx or 5xx

  • Content-Type: application/json

  • Body:

    {
    "description": "",
    "status": 0,
    "message": ""
    }
  • Example:

    {
    "description": "Unprocessable Entity",
    "status": 422,
    "message": "{'form': {'email': ['Missing data for required field.']}}"
    }