Create file Creates a file using direct upload, multipart upload, or external URL import. Direct uploads become usable automatically after a successful PUT; multipart uploads still require the explicit complete step.
POST /api/v1/experimental/files
Test Creates a file using direct upload, multipart upload, or external URL import. Direct uploads become usable automatically after a successful PUT; multipart uploads still require the explicit complete step.
TypeScript Definitions
Use the request body type in TypeScript.
CopyCreateDirectFileInput | CreateMultipartFileInput ImportFileFromUrlInput
CreateDirectFileInput CreateMultipartFileInput
cURL
JavaScript
Go
Python
Java
C#curl -X POST "https://loading/api/v1/experimental/files" \ -H "Content-Type: application/json" \ -d '{ "mode": "direct", "name": "Invoice March.pdf", "contentType": "application/pdf", "sizeBytes": 245760, "metadata": { "label": "invoice", "origin": "customer-portal" } }'
201 400 401 403 500
{
"file" : {
"id" : "5b77df28-69d0-4565-a40b-874c3af4d4d4" ,
"name" : "invoice-march.pdf" ,
"originalName" : "Invoice March.pdf" ,
"directory" : null ,
"path" : "invoice-march.pdf" ,
"contentType" : "application/pdf" ,
"extension" : "pdf" ,
"sizeBytes" : 245760 ,
"checksumSha256" : null ,
"metadata" : {
"label" : "invoice" ,
"origin" : "customer-portal"
},
"source" : "direct" ,
"status" : "pending_upload" ,
"externalUrl" : null ,
"etag" : null ,
"errorMessage" : null ,
"createdAt" : "2026-03-06T18:00:00.000Z" ,
"updatedAt" : "2026-03-06T18:00:00.000Z" ,
"completedAt" : null
},
"upload" : {
"type" : "direct" ,
"method" : "PUT" ,
"presignedUrl" : "https://uploads.andiapi.com/workspace_123/invoice-march-abc123.pdf?X-Amz-Signature=sample" ,
"expiresInSeconds" : 3600 ,
"headers" : {
"content-type" : "application/pdf"
},
"completionMode" : "automatic" ,
"nextStep" : "Upload the object with PUT. No extra API call is required for direct uploads."
}
} {
"issues" : [
{
"_tag" : "Pointer" ,
"path" : [
"string"
],
"message" : "string"
}
],
"message" : "string" ,
"_tag" : "HttpApiDecodeError"
} {
"code" : "authentication_required" ,
"message" : "Authentication required. Send Authorization: Bearer <api-key>, x-api-key, or a signed-in session."
} {
"code" : "insufficient_permissions" ,
"message" : "This API key does not have files.write permission." ,
"details" : {
"requiredPermission" : "files.write"
}
} {
"code" : "internal_error" ,
"message" : "An unexpected server error occurred."
}