Overview
The Ordinal API uses a URL-based upload system. Instead of uploading files directly, you provide a publicly accessible URL and Ordinal downloads and processes the file for you. This approach simplifies integration and avoids the complexity of multipart form uploads. Uploads are processed asynchronously. When you submit a URL, you receive an upload job ID that you can poll until the file is ready. Once ready, you’ll receive anassetId to use when creating posts.
Supported File Types
| Type | Formats |
|---|---|
| Images | JPEG, PNG, GIF, WebP |
| Videos | MP4, QuickTime (MOV) |
File Size Limits
| Type | Max Size |
|---|---|
| Images | 10 MB |
| GIFs | 15 MB |
| Videos | 350 MB |
Images cannot exceed 36 megapixels total resolution.
Upload Workflow
Submit the File URL
POST to
/uploads with the publicly accessible URL of the file you want to upload.Poll for Status
Poll GET
/uploads/{id} until the status changes to ready.Use the Asset ID
Once ready, use the returned
assetId in the assetIds array when creating posts.Upload Statuses
| Status | Description |
|---|---|
pending | Upload is queued and waiting to be processed |
processing | File is being downloaded and processed |
ready | Upload is complete. Use the assetId to attach to posts |
failed | Upload failed. Check the error field for details |
expired | Upload expired before being used in a post |
Creating an Upload
Submit a file URL to create an upload job:Response
Checking Upload Status
Poll the upload endpoint to check when processing is complete:Ready Response
When the upload is ready, the response includes theassetId and file metadata:
Failed Response
If the upload fails, the response includes an error message:Using Assets in Posts
Include theassetId in the assetIds array when creating a post:
Platform Attachment Limits
| Platform | Max Attachments |
|---|---|
| X (Twitter) | 4 |
| 20 |
Important Notes
Uploads expire within 24 hours if not used in a post. Once an upload expires, you’ll need to create a new upload job with the file URL.
For videos, the
duration field in the ready response contains the video length in seconds. For images, this field is null.