Skip to main content
POST
https://api.fltr.com
/
v1
/
datasets
/
{dataset_id}
/
documents
Upload Document
curl --request POST \
  --url https://api.fltr.com/v1/datasets/{dataset_id}/documents \
  --header 'Authorization: <authorization>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "content": "<string>",
  "metadata": "<string>"
}
'
{
  "document_id": "<string>",
  "dataset_id": "<string>",
  "filename": "<string>",
  "size_bytes": 123,
  "status": "<string>",
  "chunks_created": 123,
  "created_at": "<string>",
  "metadata": {}
}

Request

Uploads a document to a dataset. Supports text content, PDFs, images, and other file types.

Path Parameters

dataset_id
string
required
The dataset to upload to

Headers

Authorization
string
required
Bearer token for authentication

Body (JSON Upload)

For text content, use JSON:
content
string
required
Text content to index
metadata
object
Custom metadata (title, category, tags, etc.)

Body (File Upload)

For files, use multipart/form-data:
file
file
required
File to upload (PDF, image, text, etc.)
metadata
string
JSON-encoded metadata object

Response

document_id
string
Unique document identifier
dataset_id
string
Parent dataset ID
filename
string
Original filename (for file uploads)
size_bytes
integer
Document size in bytes
status
string
Processing status: processing, ready, failed
chunks_created
integer
Number of searchable chunks (available when status: ready)
created_at
string
ISO 8601 creation timestamp
metadata
object
Document metadata

Examples

Text Upload

cURL
curl -X POST https://api.fltr.com/v1/datasets/ds_abc123/documents \
  -H "Authorization: Bearer fltr_sk_abc123..." \
  -H "Content-Type: application/json" \
  -d '{
    "content": "FLTR is a semantic search platform...",
    "metadata": {
      "title": "About FLTR",
      "category": "documentation",
      "tags": ["intro", "overview"]
    }
  }'
Python
response = requests.post(
    "https://api.fltr.com/v1/datasets/ds_abc123/documents",
    headers={
        "Authorization": "Bearer fltr_sk_abc123...",
        "Content-Type": "application/json"
    },
    json={
        "content": "FLTR is a semantic search platform...",
        "metadata": {
            "title": "About FLTR",
            "category": "documentation"
        }
    }
)

File Upload

cURL
curl -X POST https://api.fltr.com/v1/datasets/ds_abc123/documents \
  -H "Authorization: Bearer fltr_sk_abc123..." \
  -F "file=@document.pdf" \
  -F 'metadata={"title":"Product Guide","category":"docs"}'
Python
with open('document.pdf', 'rb') as f:
    response = requests.post(
        "https://api.fltr.com/v1/datasets/ds_abc123/documents",
        headers={"Authorization": "Bearer fltr_sk_abc123..."},
        files={"file": f},
        data={"metadata": '{"title":"Product Guide"}'}
    )

Response

{
  "document_id": "doc_xyz789",
  "dataset_id": "ds_abc123",
  "filename": "document.pdf",
  "size_bytes": 1048576,
  "status": "processing",
  "created_at": "2024-01-10T12:00:00Z",
  "metadata": {
    "title": "Product Guide",
    "category": "docs"
  }
}

Processing

Documents are processed asynchronously:
  1. Upload - File received and stored
  2. Extraction - Text extracted from file
  3. Chunking - Content split into searchable segments
  4. Embedding - Vector embeddings generated
  5. Indexing - Added to search index
Processing typically takes 1-30 seconds depending on document size.

Supported File Types

  • Text: .txt, .md, .csv
  • Documents: .pdf, .docx, .pptx
  • Images: .jpg, .png (OCR applied)
  • Code: .py, .js, .java, etc.
  • Data: .json, .xml, .yaml

Limits

  • Max file size: 10MB
  • Max content length: 1M characters
  • Max 10,000 documents per dataset

Notes

  • Set title in metadata for better search results
  • Use category and tags for filtering
  • Custom metadata is searchable
  • Duplicate content is allowed