Skip to content

Uploads — API reference

View as Markdown

Getting bytes into Fylane without them touching the API.

POST /v1/uploads

Returns a single-use, size-capped, pre-signed URL. Upload the bytes directly to it; they never pass through the API, which is why a 5 GB file and a 5 KB file cost the same to accept. Two variants share the endpoint: multipart: true answers with one pre-signed URL per part instead of a single PUT, and from_url has the platform fetch a public URL itself — the answer is then the completed File, not a session.

Parameters
NameInRequirementDescription
Idempotency-KeyheaderRequiredClient-generated key, scoped to (organization, endpoint) and retained 24 hours. A replay with the same body returns the stored response without re-executing or re-billing; a replay with a different body returns 409.
Request body
FieldTypeRequirementDescription
filenamestringOptional
byte_sizeintegerOptionalDeclared size. The signed URL enforces it; a larger body is refused.
mime_typestringOptionalDeclared type. Verified against the bytes.
multipartbooleanOptionalAsk for a multipart session: per-part pre-signed URLs (16 MB+ parts, at most 64), finished via POST /v1/uploads/{upload_id}/complete-parts. Parts fail and retry individually, and POST /v1/uploads/{upload_id}/parts re-mints fresh URLs — the resume path.
from_urlstring (uri)OptionalA public HTTPS URL for the platform to fetch server-side. Private networks and redirects are refused; the response is the completed, validated File rather than an upload session.
project_idstringOptionalDefaults to the key’s project.
validationobjectOptionalAcceptance policy for this upload, judged against the detected bytes at completion — never against the declared type. A file that fails is recorded rejected with the findings, and completion answers validation_failed.
Responses
StatusDescription
200The from_url variant only: the URL was fetched, validated and completed in one step.
201Session created.
400Codes: invalid_request, unsupported_file, file_too_large, corrupted_file, encrypted_file, unsupported_operation.
401Codes: missing_credentials, invalid_api_key, expired_api_key, revoked_api_key, api_key_in_query.
403Codes: insufficient_scope, ip_not_allowed, environment_mismatch, organization_suspended, forbidden, key_restricted.
409Codes: idempotency_conflict, upload_session_consumed, conflict.
413Codes: payload_too_large.
429Rate limited or out of credits. Retry after the interval in Retry-After. Codes: key_spend_limit, rate_limited, concurrency_limit, credits_exhausted.
500Codes: internal_error.
503Codes: processing_unavailable, dependency_unavailable.
504Codes: timeout.

GET /v1/uploads/{upload_id}

Retrieve an upload session

Parameters
NameInRequirementDescription
upload_idpathRequiredUpload session identifier.
Responses
StatusDescription
200The session.
401Codes: missing_credentials, invalid_api_key, expired_api_key, revoked_api_key, api_key_in_query.
403Codes: insufficient_scope, ip_not_allowed, environment_mismatch, organization_suspended, forbidden, key_restricted.
404Not found. A resource belonging to another organization returns 404, never 403 — a 403 would confirm it exists. Codes: not_found.
429Rate limited or out of credits. Retry after the interval in Retry-After. Codes: key_spend_limit, rate_limited, concurrency_limit, credits_exhausted.
500Codes: internal_error.
503Codes: processing_unavailable, dependency_unavailable.
504Codes: timeout.

POST /v1/uploads/{upload_id}/parts

Fresh pre-signed URLs for every part of a multipart session — the resume path. Losing a connection loses only the parts in flight: re-mint, re-upload the missing parts, and complete.

Parameters
NameInRequirementDescription
upload_idpathRequiredUpload session identifier.
Idempotency-KeyheaderRequiredClient-generated key, scoped to (organization, endpoint) and retained 24 hours. A replay with the same body returns the stored response without re-executing or re-billing; a replay with a different body returns 409.
Responses
StatusDescription
200One fresh URL per part.
401Codes: missing_credentials, invalid_api_key, expired_api_key, revoked_api_key, api_key_in_query.
403Codes: insufficient_scope, ip_not_allowed, environment_mismatch, organization_suspended, forbidden, key_restricted.
404Not found. A resource belonging to another organization returns 404, never 403 — a 403 would confirm it exists. Codes: not_found.
409Codes: idempotency_conflict, upload_session_consumed, conflict.
429Rate limited or out of credits. Retry after the interval in Retry-After. Codes: key_spend_limit, rate_limited, concurrency_limit, credits_exhausted.
500Codes: internal_error.
503Codes: processing_unavailable, dependency_unavailable.
504Codes: timeout.

POST /v1/uploads/{upload_id}/complete-parts

Hand back the {part_number, etag} pairs storage answered each part with. The object is assembled, measured (the declared size was a promise; the measurement is what validation judges), and then the one standard completion runs — detection, policy, hash, duplicate detection, identical to a single PUT.

Parameters
NameInRequirementDescription
upload_idpathRequiredUpload session identifier.
Idempotency-KeyheaderRequiredClient-generated key, scoped to (organization, endpoint) and retained 24 hours. A replay with the same body returns the stored response without re-executing or re-billing; a replay with a different body returns 409.
Request body
FieldTypeRequirementDescription
partsarray of objectRequired
Responses
StatusDescription
200Assembled and completed.
400Codes: invalid_request, unsupported_file, file_too_large, corrupted_file, encrypted_file, unsupported_operation.
401Codes: missing_credentials, invalid_api_key, expired_api_key, revoked_api_key, api_key_in_query.
403Codes: insufficient_scope, ip_not_allowed, environment_mismatch, organization_suspended, forbidden, key_restricted.
404Not found. A resource belonging to another organization returns 404, never 403 — a 403 would confirm it exists. Codes: not_found.
422Codes: malware_detected, policy_violation, validation_failed, output_validation_failed, unsupported_input.
429Rate limited or out of credits. Retry after the interval in Retry-After. Codes: key_spend_limit, rate_limited, concurrency_limit, credits_exhausted.
500Codes: internal_error.
503Codes: processing_unavailable, dependency_unavailable.
504Codes: timeout.

POST /v1/uploads/{upload_id}/abort

Discards the parts uploaded so far. Sessions abandoned without an abort are swept automatically after a day.

Parameters
NameInRequirementDescription
upload_idpathRequiredUpload session identifier.
Idempotency-KeyheaderRequiredClient-generated key, scoped to (organization, endpoint) and retained 24 hours. A replay with the same body returns the stored response without re-executing or re-billing; a replay with a different body returns 409.
Responses
StatusDescription
204Aborted; stored parts discarded.
401Codes: missing_credentials, invalid_api_key, expired_api_key, revoked_api_key, api_key_in_query.
403Codes: insufficient_scope, ip_not_allowed, environment_mismatch, organization_suspended, forbidden, key_restricted.
404Not found. A resource belonging to another organization returns 404, never 403 — a 403 would confirm it exists. Codes: not_found.
429Rate limited or out of credits. Retry after the interval in Retry-After. Codes: key_spend_limit, rate_limited, concurrency_limit, credits_exhausted.
500Codes: internal_error.
503Codes: processing_unavailable, dependency_unavailable.
504Codes: timeout.

POST /v1/files/{file_id}/complete

Tell the platform the bytes have landed. Detection, validation policy and (within the hash window) SHA-256 and duplicate detection all run here, against the bytes actually stored — never against what was declared. A file that fails its validation policy is recorded rejected and this call answers with the refusal.

Parameters
NameInRequirementDescription
file_idpathRequiredFile identifier.
Idempotency-KeyheaderRequiredClient-generated key, scoped to (organization, endpoint) and retained 24 hours. A replay with the same body returns the stored response without re-executing or re-billing; a replay with a different body returns 409.
Responses
StatusDescription
200The completed file, ready for jobs — carrying duplicate_of when another ready file in the project has identical content.
400Codes: invalid_request, unsupported_file, file_too_large, corrupted_file, encrypted_file, unsupported_operation.
401Codes: missing_credentials, invalid_api_key, expired_api_key, revoked_api_key, api_key_in_query.
403Codes: insufficient_scope, ip_not_allowed, environment_mismatch, organization_suspended, forbidden, key_restricted.
404Not found. A resource belonging to another organization returns 404, never 403 — a 403 would confirm it exists. Codes: not_found.
422Codes: malware_detected, policy_violation, validation_failed, output_validation_failed, unsupported_input.
429Rate limited or out of credits. Retry after the interval in Retry-After. Codes: key_spend_limit, rate_limited, concurrency_limit, credits_exhausted.
500Codes: internal_error.
503Codes: processing_unavailable, dependency_unavailable.
504Codes: timeout.