Skip to main content
POST
Upload a file

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Path Parameters

upload_path
string
required

A path for the file, such as its path on your machine, which may contain slashes. Narrative uses upload_path only to name the stored file, which is the SHA-256 hash of upload_path plus the file's extension when Narrative recognizes it.

Response

The upload url

path
string
required

The name the file is stored under. It is the SHA-256 hash of upload_path in hex, followed by the file's extension when Narrative recognizes it.

Example:

"d295d6fd3d9c32462d89cf8270cca4cbb95cc660ada5cfc59c5a7458bd941d9c.csv"

url
string<uri>
required

The presigned S3 URL to PUT the file to.

Example:

"https://narrative-file-upload.s3.amazonaws.com/companyId%3D1/d295d6fd3d9c32462d89cf8270cca4cbb95cc660ada5cfc59c5a7458bd941d9c.csv?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Date=20210122T151716Z&X-Amz-SignedHeaders=host&X-Amz-Expires=1799&X-Amz-Signature=3c1e45b6d8827b7158a6157dbc548fdf263c2f23f731117056058f489b26c64b"

expiry
string<date-time>
required

When url stops accepting the upload, 30 minutes after it was issued.

Example:

"2021-01-22T15:47:16.036Z"