v1

latestOpenAPI 3.0.32026-08-061810496.7 KB
Secure spaces, folders & files

Create or upload new version of file

This route has 2 purposes: upload a file directly to Convoflo or create a new version from a file uploaded via AWS S3's SDK.

To upload a file directly, send the binary file as the file parameter. It must not be bigger than 25 MB.

To upload a file bigger than 25 MB, you need 2 additional API calls: "Prepare file" and "Get upload session token". See these APIs before calling this one. The order should be:

  1. Request upload session token
  2. Prepare file
  3. Upload to S3 using the AWS SDK with upload token credentials from step 1 and key from step 2.
  4. Call this API with the version string gotten from step 1.
post/api/1/documents/{userFile}/versions

Request body

filestring

Input. This field is required when none of <code>version</code>, <code>external_link</code>, and <code>version_id</code> are present. Must not be greater than 25000000 characters.

versionstring

This field is required when none of <code>file</code>, <code>external_link</code>, and <code>version_id</code> are present.

version_idinteger

This field is required when none of <code>file</code>, <code>external_link</code>, and <code>version</code> are present.

external_linkstring

This field is required when none of <code>file</code>, <code>version</code>, and <code>version_id</code> are present. Must be a valid URL.

Example request

{
  "file": "b",
  "version_id": 16,
  "external_link": "http://bailey.com/"
}