# post

## Overview

This endpoint is used for adding new non-tabular files to a [file index table](https://docs.redivis.com/reference/datasets/files#folders-and-index-tables). Files can only be added to tables on an unreleased version of a dataset — if the dataset has previously been released, make sure you are referencing the `next` version of the dataset in the [dataset reference](https://docs.redivis.com/api/referencing-resources).

When uploading files through this endpoint, you must first upload the file contents as temporary uploads, via the [Tables.createTempUploads](https://docs.redivis.com/api/rest-api/tables/createtempuploads) endpoint. You can then pass batches of the corresponding tempUpload ids to this endpoint to add files in bulk, which is significantly more performant than adding files one at a time.

{% hint style="info" %}
There's a lot of complexity in uploading data! It's highly recommended to use one of the client libraries to transfer data to Redivis. These libraries take care of the complexities automatically and optimize the upload mechanism and parallelization based on the size of your file, while also retrying on intermittent network errors.
{% endhint %}

## HTTP Request

```http
POST /api/v1/tables/:tableReference/rawFiles
```

{% hint style="info" %}
This endpoint extends the [general API structure](https://docs.redivis.com/api/rest-api/general-structure)
{% endhint %}

## Path parameters

| Parameter      |                                                                                                                                           |
| -------------- | ----------------------------------------------------------------------------------------------------------------------------------------- |
| tableReference | A qualified reference to the table. See [referencing resources](https://docs.redivis.com/api/referencing-resources) for more information. |

## Request body

| Property name             | Type              | Description                                                                                                                                                                           |
| ------------------------- | ----------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **files**                 | **array(object)** | <p>An array of file objects, which each contain a property <code>"name"</code> and a property <code>"resumableUploadId"</code><br><br>Only relevant when using resumable uploads.</p> |
| **files\[].name**         | **string**        | The file name.                                                                                                                                                                        |
| **files\[].tempUploadId** | **string**        | The id returned by the table `createResumableUpload` endpoint.                                                                                                                        |

## Authorization

Edit access to the dataset is required. Your access token must have the following scope:

* data.edit

[Learn more about authorization.](https://docs.redivis.com/api/rest-api/authorization)

## Response body

If successful, returns with a 201 status code and the following response body:

```json
{
    "kind": "rawFileList",
    "results": [
        {
            "kind": "rawFile",
            "id": str,
            "uri": str,
            "url": str,
            "name": str,
            "md5Hash": str,
            "size": numeric
        }
    ]
}
```
