Skip to main content
POST
This endpoint uploads a file. It does not trigger processing. To upload and process in one step, use Run Workflow instead.
Filenames are unique within a workflow, controlled by the on_conflict field:
  • error (default) — if the uploaded filename matches a file already in the workflow, the whole request fails with 409 and lists the conflicting names (and the name each would take). Nothing is uploaded. This makes a rename an explicit opt-in, never a silent surprise.
  • rename — the colliding file is auto-renamed by inserting a (n) counter before the extension (e.g. invoice.pdfinvoice (1).pdf). Each returned file’s filename is then the name it was stored under, and original_filename holds the name you uploaded (and is null when no rename happened).

Request Body

This endpoint uses multipart/form-data:

Authorizations

Authorization
string
header
required

API key issued from app.anyformat.ai/api-key. Send as Authorization: Bearer <key>.

Path Parameters

workflow_id
string
required

Body

multipart/form-data
files
file[]
required
on_conflict
enum<string>
default:error

How to handle an uploaded filename that already exists in the workflow (filenames are unique within a workflow). error (the default) rejects the whole request with 409 and lists the conflicting names, so a rename is never silent — the caller must opt in. rename accepts the collision and lets the server auto-rename the file by inserting a (n) counter before the extension (invoice.pdfinvoice (1).pdf).

Available options:
error,
rename

Response

Successful Response

Response from creating a file collection. Contains the collection ID and the status of each uploaded file.

id
string
required

Unique identifier of the newly created file collection.

Example:

"069dcc2c-e14c-7606-8000-2ee4fb17b4e1"

files
FileItem · object[]
required

List of files included in the collection, with their upload status.

workflow_id
string
required

The UUID of the workflow this collection belongs to.

Example:

"0686bb97-8c30-70f0-8000-97669e000eb8"

name
string | null

Human-readable name for the collection.

rejected
RejectedFileItem · object[]

Files the backend refused to accept — unsupported extension at slot-time or disguised bytes at register-time. Empty when every file uploaded cleanly.