Upload File
POST /upload — Infipost Public API
Upload a media file using multipart form data.
curl --request POST \
--url 'https://api.infipost.asia/public/v1/upload' \
--header 'Authorization: YOUR_API_KEY' \
--form 'file=@./media.png' \
--form 'adjust=value'Authorization
Authorizationstring · headerrequiredWorkspace API key or OAuth access token. Send the token directly without a Bearer prefix.
Body
filestringrequiredThe file to upload
adjuststringAdjust the file to the platforms' limits after the upload: videos are scaled to a 1080 px short side (long side at most 1920 px) and re-encoded to H.264 MP4 with AAC audio, images larger than that are scaled down. Runs in the background, poll GET /media/{id}/status for the result. Defaults to false.
"true""false"Response
File uploaded successfully
{
"id": "e639003b-f727-4a1e-87bd-74a2c48ae41e",
"name": "image.png",
"path": "https://uploads.postiz.com/image.png",
"organizationId": "85460a39-6329-4cf4-a252-187ce89a3480",
"createdAt": "2024-12-14T08:18:54.274Z",
"updatedAt": "2024-12-14T08:18:54.274Z"
}idstringUnique file ID
namestringFile name
pathstringFile URL
organizationIdstringcreatedAtstringupdatedAtstringstatusstring"processing" while an upload with adjust set to true is being adjusted, otherwise "ready"
"ready""processing"Upload a media file by multipart form. Returns an id and path you can pass into a post's image array.
Accepted MIME types
The backend inspects the file's actual content (not just the extension) and rejects anything outside this allowlist:
| Type | MIME |
|---|---|
| JPEG | image/jpeg |
| PNG | image/png |
| GIF | image/gif |
| WebP | image/webp |
| AVIF | image/avif |
| BMP | image/bmp |
| TIFF | image/tiff |
| MP4 video | video/mp4 |
PDFs are not accepted. See Uploads troubleshooting for limits and recommended video formats.
Example
curl -X POST "https://api.infipost.asia/public/v1/upload" \
-H "Authorization: your-api-key" \
-F "[email protected]"
Example response:
{
"id": "01HXYZ123ABCDEF",
"path": "https://uploads.postiz.com/photo.jpg",
"status": "ready"
}
Adjusting media to platform limits
Platforms reject media that is too large, too small or in an encoding they don't accept. Send the optional adjust field as true to adjust the file after the upload. It defaults to false, which stores the file as uploaded.
- Videos get their short side scaled to 1080 px, up or down, with the long side at most 1920 px. They are re-encoded to H.264 MP4 (yuv420p, at most 60 fps) with AAC audio (128 kbps, 48 kHz) and the metadata moved to the start of the file for streaming.
- Images are only scaled down, to a short side of at most 1080 px and a long side of at most 1920 px, and keep their format.
- GIF, AVIF, BMP and TIFF files are stored as uploaded.
curl -X POST "https://api.infipost.asia/public/v1/upload" \
-H "Authorization: your-api-key" \
-F "adjust=true" \
-F "[email protected]"
The adjustment runs in the background, so the response comes back with "status": "processing". The adjusted file replaces the original at the same path, usually within seconds. Poll Media Status every few seconds and wait until the status is ready before publishing a post with this path: a post published while it is processing uses the original, unadjusted file. Without adjust the upload is synchronous and the path is ready immediately.
If the adjustment fails, the original file is kept and used for publishing, and Media Status returns "status": "ready" with a warning.
Usage in a post
{
"image": [
{
"id": "01HXYZ123ABCDEF",
"path": "https://uploads.postiz.com/photo.jpg"
}
]
}