Skip to main content

Overview

The Ordinal API supports two ways to upload media:
  • URL upload — submit a publicly accessible URL and Ordinal downloads the file for you.
  • Local file upload — request signed credentials, then upload the file directly to the returned uploadUrl.
Both flows are asynchronous. You receive an upload job ID, poll until the status is ready, then use the returned assetId when creating posts.

Choosing a flow

Supported file types

File size limits

Images cannot exceed 36 megapixels total resolution.

Upload statuses

URL upload

Use this flow when the file is already hosted somewhere Ordinal can reach over the public internet.
1

Submit the file URL

POST to /uploads with the publicly accessible URL of the file.
2

Receive an upload job ID

The API returns an upload job ID with pending status.
3

Poll for status

Poll GET /uploads/{id} until the status changes to ready.
4

Use the asset ID

Once ready, use the returned assetId in the assetIds array when creating posts.

Create a URL upload

Response

The file URL must be publicly accessible. URLs that require authentication or sit behind a firewall will fail.

Local file upload

Use this flow when the file is on disk, in private storage, or otherwise not reachable from the public internet. Ordinal returns signed credentials that let your client upload the bytes directly to the returned uploadUrl.
1

Prepare the upload

POST to /uploads/prepare with the file’s filename, mimetype, and size in bytes.
2

Upload the file

POST the file to the returned uploadUrl as multipart/form-data with three form fields: params (the JSON string from the prepare response), signature (the signature from the prepare response), and file (the local file bytes). Copy params and signature verbatim — do not modify them. Ordinal is notified automatically when processing finishes.
3

Poll for status

Poll GET /uploads/{id} until the status changes to ready.
4

Use the asset ID

Once ready, use the returned assetId in the assetIds array when creating posts.

Prepare the upload

Response

The params value is a signed JSON string. It includes auth (with key and expires), template_id, and fields (uploadJobId, workspaceId, storagePath). The credentials are short‑lived — upload the file before expiresAt.

Upload the file

POST the file to uploadUrl as multipart/form-data with three form fields. Use the params and signature values from the prepare response exactly as returned — do not parse, reformat, or regenerate them.
In practice, substitute uploadUrl, params, and signature with the values returned by /uploads/prepare. Here’s the same step in Node.js:
You don’t need to do anything else after the upload completes — Ordinal is notified automatically and transitions the job to processing and then ready.

Checking upload status

Poll the upload endpoint to check when processing is complete:

Ready response

When the upload is ready, the response includes the assetId and file metadata:

Failed response

If the upload fails, the response includes an error message:

Using assets in posts

Include the assetId in the assetIds array when creating a post:

Platform attachment limits

Important notes

Uploads expire within 24 hours if not used in a post. Once an upload expires, create a new upload job.
For videos, the duration field in the ready response contains the video length in seconds. For images, this field is null.