File API
The file upload API has been consolidated into a single endpoint, replacing the media-specific endpoints in V2.Endpoint Changes
| Feature | V2 Endpoint | V3 Endpoint |
|---|---|---|
| Image Upload | POST /api/v2/image | POST /api/v3/file |
| Video Upload | POST /api/v2/video | POST /api/v3/file |
| Audio Upload | POST /api/v2/audio | POST /api/v3/file |
| Base64 Upload | N/A | POST /api/v3/file/base64 |
| Presigned URL (Generate) | GET /api/v2/presigned-url | GET /api/v3/file/presigned-url |
| Presigned URL (Upload) | POST /api/v2/presigned-url/:token | POST /api/v3/file/presigned-url/:token |
Request Changes
In V3, the form field for the file content is alwaysfile, regardless of the media type.
Multipart Upload
V2 Request:filename: Custom filename for the uploaded file.path: Directory path to store the file (e.g.,users/avatars).metadata: JSON string containing metadata.retentionExempt: Boolean to exempt the file from retention policies.
Base64 Upload
V3 introduces a dedicated endpoint for Base64 encoded files. Request Body:Response Format
The response structure remains consistent, returning the file ID and URL.Presigned URL
Presigned URLs allow you to generate a temporary upload URL that can be used without exposing your API token. This is useful for client-side uploads.Generating a Presigned URL
V2 Request:- V2 requires the
fileTypequery parameter (image,video, oraudio). - V3 does not require
fileTypesince the unified/fileendpoint handles all media types. - Default expiration: V2 defaults to 5 minutes, V3 defaults to 15 minutes.
Uploading via Presigned URL
V2 Request:- V2 requires the form field to match the
fileTypespecified when generating the URL (image,video, oraudio). - V3 always uses
fileas the form field name. - V3 supports additional optional fields:
filename,path,metadata, andretentionExempt.
Logs API
The logs API has been moved to the V3 namespace and now enforces batch processing.Endpoint Changes
| Feature | V2 Endpoint | V3 Endpoint |
|---|---|---|
| Ingest Logs | POST /api/logs | POST /api/v3/logs |
.png?fit=max&auto=format&n=tUtwuHgibAuVylZ9&q=85&s=44653a825fa0664047dae92cd8969b2d)
