uploadFile
POST
/v1/files
const url = 'https://example.com/v1/files';const form = new FormData();form.append('upload_id', '2489E9AD-2EE2-8E00-8EC9-32D5F69181C0');form.append('workspace_id', '2489E9AD-2EE2-8E00-8EC9-32D5F69181C0');form.append('purpose', 'image');form.append('file', 'file');
const options = {method: 'POST'};
options.body = form;
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://example.com/v1/files \ --header 'Content-Type: multipart/form-data' \ --form upload_id=2489E9AD-2EE2-8E00-8EC9-32D5F69181C0 \ --form workspace_id=2489E9AD-2EE2-8E00-8EC9-32D5F69181C0 \ --form purpose=image \ --form file=@fileAuthorizations
Section titled “Authorizations”Request Bodyrequired
Section titled “Request Bodyrequired”Media typemultipart/form-data
object
upload_id
required
A fresh UUID for this upload; reuse it only to retry identical content.
string format: uuid
workspace_id
required
string format: uuid
purpose
required
string
file
required
One file, 1 byte to 4 MiB (4,194,304 bytes). Larger files return HTTP 413 before any backend call.
string format: binary
Responses
Section titled “Responses”Uploaded file
Media typeapplication/json
object
id
required
string format: uuid
name
required
string
mime_type
required
string
size
required
integer
Example generated
{ "id": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0", "name": "example", "mime_type": "example", "size": 1}Request could not be completed
Media typeapplication/problem+json
object
type
required
string
title
required
string
status
required
number
detail
string
Example generated
{ "type": "example", "title": "example", "status": 1, "detail": "example"}Request could not be completed
Media typeapplication/problem+json
object
type
required
string
title
required
string
status
required
number
detail
string
Example generated
{ "type": "example", "title": "example", "status": 1, "detail": "example"}Request could not be completed
Media typeapplication/problem+json
object
type
required
string
title
required
string
status
required
number
detail
string
Example generated
{ "type": "example", "title": "example", "status": 1, "detail": "example"}Request could not be completed
Media typeapplication/problem+json
object
type
required
string
title
required
string
status
required
number
detail
string
Example generated
{ "type": "example", "title": "example", "status": 1, "detail": "example"}Request could not be completed
Media typeapplication/problem+json
object
type
required
string
title
required
string
status
required
number
detail
string
Example generated
{ "type": "example", "title": "example", "status": 1, "detail": "example"}Request could not be completed
Media typeapplication/problem+json
object
type
required
string
title
required
string
status
required
number
detail
string
Example generated
{ "type": "example", "title": "example", "status": 1, "detail": "example"}Request could not be completed
Media typeapplication/problem+json
object
type
required
string
title
required
string
status
required
number
detail
string
Example generated
{ "type": "example", "title": "example", "status": 1, "detail": "example"}