v1

latestOpenAPI 3.1.02026-08-066378446.6 KB
File Upload Helpers

Create document file storage upload URL

<small>Requires an API token with the Document Manager role.</small>

Generates a presigned URL for securely uploading a file to cloud storage. The uploaded file can then be associated with a document via the Store a PDF file in a document's file storage endpoint.

The returned URL expires after a limited time and should be used immediately for upload. The method field of the response tells you which kind of HTTP request to make to perform the upload. If it is POST, make a POST request, including the provided fields from the response as fields in the request body. If it is PUT, make a PUT request, including the provided headers from the response in the HTTP headers. Your API client should support both upload methods, as PUT uploads are deprecated and will be removed.

The request accepts a content_type string matching one of the rows below, or any image/* MIME type.

File typecontent_type
CSVapplication/csv, text/csv
MS Word (.doc)application/msword
MS Word (.docx)application/vnd.openxmlformats-officedocument.wordprocessingml.document
PDFapplication/pdf
RTFapplication/rtf
Excel (.xls)application/vnd.ms-excel
Excel (.xlsx)application/vnd.openxmlformats-officedocument.spreadsheetml.sheet
Outlook message (.msg)application/vnd.ms-outlook
EMLmessage/rfc822
PowerPoint (.ppt)application/vnd.ms-powerpoint
PowerPoint (.pptx)application/vnd.openxmlformats-officedocument.presentationml.presentation
XMLapplication/xml, text/xml
Plain text (.txt)text/plain
ZIPapplication/zip, application/x-zip, application/x-zip-compressed
Imagesimage/* (e.g. image/png, image/jpeg, image/gif)

For a complete guide with examples, see How to store a file in a document's file storage.

post/file-uploads/document-file-storage

Request body

content_typestring required

The MIME type string of the file being uploaded.

method'PUT' | 'POST'

Example request

{
  "content_type": "application/pdf"
}

Response

SignedUploadUrlResource

Example response

{
  "data": {
    "uuid": "ab2665c1-9a7c-4230-a431-21682eb302aa",
    "url": "https://s3.eu-central-1.amazonaws.com/...",
    "method": "POST",
    "headers": {
      "Content-Type": "application/pdf"
    },
    "expires_at": "2019-08-24T14:15:22Z"
  }
}