Skip to main content

Upload File (Base64)

POST/api/v1/media/files/upload-base64

Upload files using JSON with base64-encoded content. This endpoint is designed for workflow automation tools (Xano, N8N, Make, etc.) that don't support multipart/form-data uploads.

tip

For Xano/N8N users: This is the recommended endpoint for file uploads. The standard /upload endpoint requires multipart/form-data which most automation tools don't support.

Request Body

file_datastringrequired

Base64-encoded file content

filenamestringrequired

Filename with extension (e.g., "image.png", "document.pdf")

content_typestring

MIME type (auto-detected from filename if not provided)

folderstring

Optional folder path within your bucket (e.g., "logos", "images/products")

Response

successboolean

Whether the upload succeeded

urlstring

Public URL to access the uploaded file

keystring

File key within the bucket

content_typestring

MIME type of the uploaded file

sizeinteger

File size in bytes

Example

curl -X POST "https://spideriq.ai/api/v1/media/files/upload-base64" \
-H "Authorization: Bearer cli_abc123:sk_xxx:secret_xxx" \
-H "Content-Type: application/json" \
-d '{
"file_data": "iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR42mNk+M9QDwADhgGAWjR9awAAAABJRU5ErkJggg==",
"filename": "pixel.png",
"folder": "images"
}'

Response Example

{
"success": true,
"url": "https://media.spideriq.ai/client-cli-abc123/images/pixel.png",
"key": "images/pixel.png",
"content_type": "image/png",
"size": 68,
"bucket": "client-cli-abc123",
"file_id": "images/pixel.png"
}

Xano Integration

In Xano, use an External API Request action:

  1. Method: POST
  2. URL: https://spideriq.ai/api/v1/media/files/upload-base64
  3. Headers:
    • Authorization: Bearer {your_token}
    • Content-Type: application/json
  4. Body (JSON):
{
"file_data": "{base64_encoded_file}",
"filename": "uploaded-file.jpg",
"folder": "xano-uploads"
}
note

In Xano, you can use the base64_encode function to convert file content to base64 before sending.

N8N Integration

In N8N, use an HTTP Request node:

  1. Method: POST
  2. URL: https://spideriq.ai/api/v1/media/files/upload-base64
  3. Authentication: Header Auth with Authorization: Bearer {token}
  4. Body Content Type: JSON
  5. Body Parameters:
    • file_data: Use expression {{ $binary.data.data }} for binary data
    • filename: Your desired filename
    • folder: Optional folder path