---
title: "Create Presigned CSV/JSONL S3 PUT URL"
method: POST
path: "/api/file/csv_or_jsonl"
tags: ["File"]
---

# Create Presigned CSV/JSONL S3 PUT URL

`POST /api/file/csv_or_jsonl`

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.

## Headers

- `TR-Dataset` string, uuid, required

## Request body

- CreatePresignedUrlForCsvJsonlReqPayload
  - `description` string, 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_name` string, required — Name of the file being uploaded, including the extension. Will be used to determine CSV or JSONL for processing.
  - `fulltext_boost_factor` number, 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_id` string, 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>`
  - `link` string, 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.
  - `mappings` ChunkReqPayloadMapping[] — Specify all of the mappings between columns or fields in a CSV or JSONL file and keys in the ChunkReqPayload. Array fields like tag_set, image_urls, and group_tracking_ids can have multiple mappings. Boost phrase can also have multiple mappings which get concatenated. Other fields can only have one mapping and only the last mapping will be used.
    - `chunk_req_payload_field` 'link' | 'tag_set' | 'num_value' | 'tracking_id' | 'group_tracking_ids' | 'time_stamp' | 'lat' | 'lon' | 'image_urls' | 'weight' | 'boost_phrase', required — The key in the ChunkReqPayload which you can map a column or field from the CSV or JSONL file to.
    - `csv_jsonl_field` string, required — The column or field in the CSV or JSONL file that you want to map to a key in the ChunkReqPayload
  - `metadata` unknown
  - `semantic_boost_factor` number, 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_set` string[], 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_stamp` string, 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_id` boolean, 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.

## Response `200`

File object information and signed put URL

- CreatePresignedUrlForCsvJsonResponseBody
  - `file_metadata` File, required
    - `created_at` string, date-time, required
    - `dataset_id` string, uuid, required
    - `file_name` string, required
    - `id` string, uuid, required
    - `link` string, nullable
    - `metadata` unknown
    - `size` integer, required
    - `tag_set` string[], nullable
    - `time_stamp` string, date-time, nullable
    - `updated_at` string, date-time, required
  - `presigned_put_url` string, required — Signed URL to upload the file to.

## Other responses

- `400` — Service error relating to uploading the file

---

[API](https://skmtc.net/devflowinc/apis/trieve-api.md) · [All operations](https://skmtc.net/devflowinc/apis/trieve-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/devflowinc/trieve-api/versions/84583e7c9fc1/schema)
