Import a file
Store a file from a public URL or from inline base64 and return its CDN URL. The JSON alternative to the multipart POST /files upload.
curl -X POST "https://productlane.com/api/v2/files/import" \
-H "Authorization: Bearer $PRODUCTLANE_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"url": "https://example.com",
"content_base64": "string",
"file_name": "string",
"content_type": "string"
}'Authorization
AuthorizationstringheaderrequiredBearer authentication header of the form
Bearer <token>, where<token>is your auth token.
Body
urlstring<uri>Public http(s) URL the server downloads and re-hosts. Mutually exclusive with content_base64. Max 10485760 bytes.
content_base64stringBase64-encoded file bytes, for uploads that have no public URL. Mutually exclusive with url. Max 1048576 decoded bytes; use url above that.
file_namestringOverrides the name derived from the URL. Its extension is used for the stored object key.
content_typestringRequired with content_base64. With url it overrides the server's Content-Type. One of: application/msword, application/pdf, application/vnd.ms-excel, application/vnd.ms-powerpoint, application/vnd.openxmlformats-officedocument.presentationml.presentation, application/vnd.openxmlformats-officedocument.spreadsheetml.sheet, application/vnd.openxmlformats-officedocument.wordprocessingml.document, image/gif, image/jpeg, image/png, image/webp, text/csv, text/plain.
Response
Successful response
file_urlstringrequiredcontent_typestringrequiredsizenumberrequiredoriginal_file_namestring | nullrequired
{
"file_url": "string",
"content_type": "string",
"size": 0,
"original_file_name": "string"
}