Skip to main content
POST
/
file
Create a file and get a presigned upload URL
curl --request POST \
  --url https://api.ffmpeg-api.com/v1/file \
  --header 'Authorization: <authorization>' \
  --header 'Content-Type: application/json' \
  --data '{
  "dir_id": "<string>",
  "file_name": "<string>"
}'
{
  "ok": true,
  "file": {
    "id": 123,
    "dir_id": "<string>",
    "added_on": "<string>",
    "file_name": "<string>"
  },
  "upload": {
    "url": "<string>",
    "method": "<string>",
    "headers": {},
    "expiresInSeconds": 123
  }
}

Headers

Authorization
string
required

Your secret API key. Format: Bearer <key>

Body

application/json
file_name
string
required

File name to use. Must be unique within the target directory.

dir_id
string

Optional target directory ID that you own (from POST /directory or GET /directory). If omitted, a new temporary directory is created automatically (expires in ~24 hours).

Response

The file record was created successfully and a presigned PUT URL was issued. Use the provided upload.url, upload.method (always PUT), and upload.headers when uploading the raw file bytes. The URL expires after upload.expiresInSeconds.

ok
boolean
required
file
object
required
upload
object
required
I