Skip to main content

File Upload API

Upload files with tags supplied as metadata.

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

Request Body Form Data

FieldTypeDescription
email(text)User email
files(file, repeated)Files to be uploaded
tags(text, repeated)Tags for metadata search over indexed files
chunk_size(text)OPTIONAL Chunk size to be used for indexing
chunk_overlap(text)OPTIONAL Chunk overlap to be used for indexing

Success Response

  • Status: 200

  • Content-Type: application/json

  • Body:

    {
    "message": "",
    "doc_ids": [
    {
    "doc_id": "",
    "file_name": "",
    },
    ]
    }
  • Example:

    {
    "message": "Files uploaded successfully",
    "doc_ids": [
    {
    "doc_id": "64e9ab8ea5ccfed0685fe0e4246ef86ecffb21602f95d178fa724880a1faa985",
    "file_name": "Airtel.pdf"
    }
    ]
    }

Error Response

  • Status: 4xx or 5xx

  • Content-Type: application/json

  • Body:

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

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