v1

latestOpenAPI 3.0.3BSL2026-07-17133415718.8 KB
File

Create Presigned CSV/JSONL S3 PUT URL

This route is useful for uploading very large CSV or JSONL files. Once you have completed the upload, chunks will be automatically created from the file for each line in the CSV or JSONL file. The chunks will be indexed and searchable. Auth'ed user must be an admin or owner of the dataset's organization to upload a file.

post/api/file/csv_or_jsonl

Headers

TR-Datasetstring uuid required

The dataset id or tracking_id to use for the request. We assume you intend to use an id if the value is a valid uuid.

Request body

descriptionstring nullable

Description is an optional convience field so you do not have to remember what the file contains or is about. It will be included on the group resulting from the file which will hold its chunk.

file_namestring required

Name of the file being uploaded, including the extension. Will be used to determine CSV or JSONL for processing.

fulltext_boost_factornumber double nullable

Amount to multiplicatevly increase the frequency of the tokens in the boost phrase for each row's chunk by. Applies to fulltext (SPLADE) and keyword (BM25) search.

group_tracking_idstring nullable

Group tracking id is an optional field which allows you to specify the tracking id of the group that is created from the file. Chunks created will be created with the tracking id of group_tracking_id|<index of chunk>

linkstring nullable

Link to the file. This can also be any string. This can be used to filter when searching for the file's resulting chunks. The link value will not affect embedding creation.

{"stackTrail":"components:schemas:CreatePresignedUrlForCsvJsonlReqPayload:properties:metadata","oasType":"schema","type":"unknown","description":"Metadata is a JSON object which can be used to filter chunks. This is useful for when you want to filter chunks by arbitrary metadata. Unlike with tag filtering, there is a performance hit for filtering on metadata. Will be passed down to the file's chunks.","nullable":true}
semantic_boost_factornumber double nullable

Arbitrary float (positive or negative) specifying the multiplicate factor to apply before summing the phrase vector with the chunk_html embedding vector. Applies to semantic (embedding model) search.

tag_setstring[] nullable

Tag set is a comma separated list of tags which will be passed down to the chunks made from the file. Each tag will be joined with what's creatd per row of the CSV or JSONL file.

time_stampstring nullable

Time stamp should be an ISO 8601 combined date and time without timezone. Time_stamp is used for time window filtering and recency-biasing search results. Will be passed down to the file's chunks.

upsert_by_tracking_idboolean nullable

Upsert by tracking_id. If true, chunks will be upserted by tracking_id. If false, chunks with the same tracking_id as another already existing chunk will be ignored. Defaults to true.

Example request

{
  "description": "This is an example file",
  "file_name": "example.pdf",
  "link": "https://example.com",
  "metadata": {
    "key1": "value1",
    "key2": "value2"
  },
  "tag_set": [
    "tag1",
    "tag2"
  ],
  "time_stamp": "2021-01-01 00:00:00.000Z"
}

Response

File object information and signed put URL

presigned_put_urlstring required

Signed URL to upload the file to.

Example response

{
  "file_metadata": {
    "created_at": "2021-01-01 00:00:00.000",
    "dataset_id": "e3e3e3e3-e3e3-e3e3-e3e3-e3e3e3e3e3e3",
    "file_name": "file.txt",
    "id": "e3e3e3e3-e3e3-e3e3-e3e3-e3e3e3e3e3e3",
    "link": "https://trieve.ai",
    "metadata": {
      "key": "value"
    },
    "size": 1000,
    "tag_set": "tag1,tag2",
    "time_stamp": "2021-01-01 00:00:00.000",
    "updated_at": "2021-01-01 00:00:00.000"
  }
}