---
title: "Create or upload new version of file"
method: POST
path: "/api/1/documents/{userFile}/versions"
tags: ["Secure spaces, folders & files"]
deprecated: true
---

# Create or upload new version of file

`POST /api/1/documents/{userFile}/versions`

> **Deprecated.**

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.

## Request body

- object
  - `file` string — 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.
  - `version` string — This field is required when none of <code>file</code>, <code>external_link</code>, and <code>version_id</code> are present.
  - `version_id` integer — This field is required when none of <code>file</code>, <code>external_link</code>, and <code>version</code> are present.
  - `external_link` string — 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.

---

[API](https://skmtc.net/convoflo/apis/convoflo-rest-api.md) · [All operations](https://skmtc.net/convoflo/apis/convoflo-rest-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/convoflo/convoflo-rest-api/revisions/fed4481f0476/schema)
