Documents

Upload Documents

Upload multiple documents.

Request Body (multipart/form-data):

  • files: List of files to upload (required)
  • categories (optional): List of category names to organize documents
  • names (optional): List of display names, matched to files by position

Returns:

  • documents: One unique document id per uploaded file, for status polling and later use

Supported File Types:

  • Text-based files only
  • Each document needs at least 500 words; training dataset JSONL files are exempt. If any file is shorter, the whole upload is refused with 400 naming each short file

Editions:

The developer edition accepts plain text files only. PDF and other formats are available on the enterprise edition, which also accepts cloud storage URIs (s3://, gs://, oci://, abfss://) as the data source.

File Size Limit:

Maximum 100 MB per file

Example Request:

POST /api/v3/documents/create
Headers: {"Authorization": "Bearer <api_key>"}
Content-Type: multipart/form-data

Form Data:
  files: [report.txt, analysis.md]
  categories: ["financial", "2024-q1"]

Example Response:

{"document_ids": ["01KKBB7NPTMXM12", "01KKBB7NPTJDK43"]}

Processing:

Uploads are processed asynchronously. Poll GET /api/v3/documents/{id}/status until READY before using a document id elsewhere. Requires organisation membership.

post/api/v3/documents/create

Request

  • Base URL
    https://api.nugen.in
  • Auth
    HTTP bearer

Request body multipart/form-data

filesstring[] required

The document files to upload. Plain text files, each at least 500 words, except training dataset JSONL files. If any file is shorter, the whole upload is refused with a 400 naming each short file.

categoriesstring[] nullable

Categories for the documents

namesstring[] nullable

Display names for the documents, matched to files by position. Defaults to each document id if omitted.

Response

Returns a list of document IDs.

document_idsstring[] required

List of unique document IDs for the uploaded documents. Use these IDs to track processing status, update categories, or download the documents.

Example response

{
  "document_ids": [
    "document_01k4x9m2p7q3r5s8"
  ]
}

Changes

No recorded changes to this operation across all 1 revision of this API.