Browse docs
Upload overview#
Four calls, all authenticated with your usual API key or OAuth token. The bytes go straight from your machine to storage; SkedCast's API only ever sees a URL.
Calls#
| Step | Call | Result |
|---|---|---|
| 1. Presign | POST /media/presign | Asset id, URL |
| 2. Upload | PUT <url> | File stored |
| 3. Register | POST /media | Processing starts |
| 4. Compose | POST /posts | Post uses asset |
Prerequisites#
- An API key or OAuth token with the
media.managescope, from the scopes reference. - An
Idempotency-Keyheader on every POST. Presign, register and import-url each require a unique one, and omitting it is a 400. Replaying a key returns the original result, so a retry is safe. clientIdis optional on presign and import-url. Omit it for a workspace-wide asset available to every client. The client is chosen once, at presign: register files the asset under that client, so leaveclientIdout of the register call (if you send it, it must be the same value, else400 media_bad_key).
Presign#
Declare the real filename, MIME type and byte size. After the file lands, SkedCast checks the file type from the file's contents, not from the declared contentType.
curl -X POST https://api.skedcast.com/v1/media/presign \
-H "Authorization: Bearer sked_live_YOUR_KEY" \
-H "Idempotency-Key: $(uuidgen)" \
-H "Content-Type: application/json" \
-d '{
"clientId": "<clientId>",
"filename": "launch-teaser.mp4",
"contentType": "video/mp4",
"sizeBytes": 24831992
}'{
"data": {
"assetId": "b3f1a2c4-5d6e-4f70-8a9b-1c2d3e4f5a6b",
"key": "<storage key>",
"url": "https://<presigned-upload-host>/…",
"expiresAt": "2026-08-06T15:10:00Z"
},
"meta": { "correlationId": "c-…" }
}Upload the bytes#
PUT the file straight to the presigned url from the presign response, with no Authorization header. Match the Content-Type you declared at presign.
curl -X PUT "<url from step 1>" \
-H "Content-Type: video/mp4" \
--data-binary @launch-teaser.mp4Register the asset#
Registering starts processing: SkedCast scans the file, then prepares the version each platform needs. The response carries readyEvent: "media.ready"; subscribe an endpoint to it (POST /webhooks) to be told the moment the asset is publishable.
platforms is optional. Omit it and SkedCast prepares a version for every platform you have a live connected account on; pass a list, for example ["youtube", "tiktok"], to narrow it.
If a post later targets a platform with no version yet, SkedCast prepares it then, and the target waits until it is ready. It does not fail.
curl -X POST https://api.skedcast.com/v1/media \
-H "Authorization: Bearer sked_live_YOUR_KEY" \
-H "Idempotency-Key: $(uuidgen)" \
-H "Content-Type: application/json" \
-d '{
"assetId": "b3f1a2c4-5d6e-4f70-8a9b-1c2d3e4f5a6b",
"key": "<key from step 1>",
"clientId": "<clientId>",
"contentType": "video/mp4",
"sizeBytes": 24831992,
"filename": "launch-teaser.mp4",
"platforms": ["youtube", "tiktok"]
}'{
"data": {
"assetId": "b3f1a2c4-5d6e-4f70-8a9b-1c2d3e4f5a6b",
"status": "pending",
"readyEvent": "media.ready"
},
"meta": { "correlationId": "c-…" }
}Import from a URL#
Already have the file at a public URL? POST /media/import-url skips presign and PUT: SkedCast fetches it (HTTPS URLs only), stores it and starts the same processing. It takes the same clientId and platforms options as register.
curl -X POST https://api.skedcast.com/v1/media/import-url \
-H "Authorization: Bearer sked_live_YOUR_KEY" \
-H "Idempotency-Key: $(uuidgen)" \
-H "Content-Type: application/json" \
-d '{ "clientId": "<clientId>", "url": "https://example.com/launch-teaser.mp4" }'Set a video cover via API#
Once the asset is transcoded, or even while it is still processing, reference its assetId in mediaIds on POST /posts. For a video you can also set a custom cover.
A cover is a separately uploaded image asset: run it through presign, PUT and register, and pass its assetId as coverMediaId on the post body. Omit coverMediaId to use the auto-extracted poster frame.
TikTok takes a timestamp, not an image. Set coverFrameMs (milliseconds into the video); it is independent of coverMediaId.
curl -X POST https://api.skedcast.com/v1/posts \
-H "Authorization: Bearer sked_live_YOUR_KEY" \
-H "Idempotency-Key: $(uuidgen)" \
-H "Content-Type: application/json" \
-d '{
"clientId": "<clientId>",
"content": "Launch day is here 🚀",
"mediaIds": ["<videoAssetId>"],
"coverMediaId": "<coverImageAssetId>",
"targets": { "mode": "selection", "accountIds": ["<accountId>"] },
"schedule": { "type": "at", "scheduledAt": "2030-01-15T15:00:00Z" }
}'Four destinations take an image, one takes a frame number, and the rest are outside what the API documents. You send coverMediaId and coverFrameMs once on the post, and SkedCast uses the right one per destination.
Cover fields#
| Platform | Field you send | What SkedCast sends | Notes |
|---|---|---|---|
| YouTube | coverMediaId | A custom thumbnail through the YouTube Data API | JPEG or PNG up to 50 MB. YouTube accepts custom thumbnails only from a verified channel |
coverMediaId | The cover image inside the create call | Accepting the create call is accepting the cover | |
coverMediaId | The thumbnail inside the create call | Not used for a Facebook Reel | |
| Telegram | coverMediaId | The thumbnail inside the send call | Used as the video's thumbnail |
| TikTok | coverFrameMs | video_cover_timestamp_ms | A frame offset in milliseconds, not an image. First frame if unset or invalid |
| Other destinations | Neither field is documented | Not applicable | Do not rely on a cover field there |
YouTube thumbnails#
The YouTube Data API's thumbnails.set takes image/jpeg or image/png up to 50 MB, and YouTube's help page says custom thumbnails need a verified account (read 22 November 2026).
A refused cover never fails the post: the video keeps the frame YouTube picked, and the refusal is recorded on the destination so you can read the reason.
Setting a cover is best-effort by contract: it never fails the publish. After publishing, GET /post-targets/:id returns coverIssue: null when the cover applied or there was nothing to apply, otherwise a short sentence.
Cover outcomes#
| Outcome | Meaning | coverIssue | What to do |
|---|---|---|---|
| Applied | The platform accepted the cover (for TikTok, the frame offset was sent) | null | Nothing |
| Not attempted | No cover to set: no cover chosen, or a surface with no cover such as a photo post, a Facebook Reel or an Instagram story | null | Nothing |
| Rejected | The platform refused the cover and kept its own | A sentence with the reason | Fix what it says: verify the channel, shrink the image, wait out a quota |
| Fetch failed | SkedCast could not read your cover image from storage | A sentence | Retry; your image and account are not at fault |
| Unconfirmed | The request got no answer, so the cover may or may not have landed | A sentence | Check the video on the platform, then try again if it is missing |
Change a cover#
Before the post publishes, POST /posts/:id/revise accepts coverMediaId, and null clears the choice so the auto-extracted poster frame is used again.
After a YouTube video is live, POST /posts/:id/targets/:targetId/edit-published takes coverMediaId among the fields it changes. On other platforms the media of a published post never changes, so the cover cannot either.
When another destination of the same post has not published yet, the post keeps its own cover, and the response says so with a warning.
Large files#
Presign with multipart: true. The answer carries an uploadId and a parts array, each part with a partNumber, its own presigned url and the sizeBytes to send. Parts are 8 MiB, except the last.
PUT each part to its URL and keep every ETag response header. Then call POST /media/:id/complete with the key, the uploadId and every part's partNumber and etag in order, and register the asset with POST /media.
Parts are numbered from 1, and an upload can have up to 10,000 of them.
# 1. Presign with multipart: true
curl -X POST https://api.skedcast.com/v1/media/presign \
-H "Authorization: Bearer sked_live_YOUR_KEY" \
-H "Idempotency-Key: $(uuidgen)" \
-H "Content-Type: application/json" \
-d '{ "filename": "webinar.mp4", "contentType": "video/mp4", "sizeBytes": 2147483648, "multipart": true }'
# 2. PUT part 1 to parts[0].url and keep the ETag header; repeat for every part
# 3. Finish the upload with every part's number and ETag, in order
curl -X POST https://api.skedcast.com/v1/media/<assetId>/complete \
-H "Authorization: Bearer sked_live_YOUR_KEY" \
-H "Idempotency-Key: $(uuidgen)" \
-H "Content-Type: application/json" \
-d '{ "key": "<key from step 1>", "uploadId": "<uploadId from step 1>", "parts": [
{ "partNumber": 1, "etag": "<ETag of part 1>" },
{ "partNumber": 2, "etag": "<ETag of part 2>" }
] }'
# 4. Register the asset with POST /media, as for a single uploadSize limits#
| Kind of file | Largest accepted | Why |
|---|---|---|
| Video | 10 GiB | Long-form uploads, the largest file kind SkedCast accepts |
| Image, GIF or document | 2,047 MiB | The largest file the malware scan can read |
Import errors#
POST /media/import-url needs an https URL on the default port, with no credentials in it, pointing at a public host and at a file rather than a web page. Each rule has its own error code.
Imports also have a ceiling on how many run at once. On 429 media_import_busy, wait and retry with the same Idempotency-Key.
Import error codes#
| Code | Status | Cause | Fix |
|---|---|---|---|
media_url_scheme | 400 | The URL is not https | Use an https:// address |
media_url_credentials | 400 | The URL embeds a username or password | Use a link that needs none, such as a signed URL |
media_url_port | 400 | The URL names a port other than the default | Serve the file on the default https port |
media_url_blocked | 400 | The address points somewhere SkedCast will not fetch from | Use a public host |
media_url_unresolvable | 400 | The host name did not resolve | Check the host name |
media_url_timeout | 400 | The fetch timed out | Retry, or host the file closer |
media_url_not_a_file | 400 | The link opens a web page, not a file | Give a direct download link |
media_url_too_many_redirects | 400 | The URL redirected too many times | Use the final URL |
media_url_status | 502 | The host answered with an error status | Fix the host, then retry |
media_url_fetch_failed | 502 | The fetch failed | Retry |
media_url_too_large | 413 | The file is over the size limit | Send a smaller file |
media_import_busy | 429 | Too many imports are running | Wait and retry with the same key |
Upload in code#
A Node.js script, end to end: it presigns, PUTs the bytes with the declared Content-Type, registers the asset and returns the id for mediaIds. The PUT carries no Authorization header, because the URL is the credential.
Run the same function for the cover image to get the id for coverMediaId. The code reads the file into memory for brevity; for a large video use the multipart path.
import { readFile } from "node:fs/promises";
const API = "https://api.skedcast.com/v1";
async function skedcast(path: string, body: unknown, apiKey: string) {
const res = await fetch(API + path, {
method: "POST",
headers: {
Authorization: "Bearer " + apiKey,
"Idempotency-Key": crypto.randomUUID(),
"Content-Type": "application/json",
},
body: JSON.stringify(body),
});
if (!res.ok) throw new Error(path + " failed: " + (await res.text()));
return (await res.json()).data;
}
export async function uploadMedia(file: string, contentType: string, apiKey: string): Promise<string> {
const bytes = await readFile(file);
const filename = file.split("/").pop() ?? "upload";
// 1. Presign: asset id, storage key and the URL to PUT to.
const presign = await skedcast("/media/presign", { filename, contentType, sizeBytes: bytes.length }, apiKey);
// 2. PUT the bytes with the declared Content-Type and no Authorization header.
const put = await fetch(presign.url, { method: "PUT", headers: { "Content-Type": contentType }, body: bytes });
if (!put.ok) throw new Error("Upload failed with status " + put.status);
// 3. Register: this is what starts scanning and processing.
await skedcast("/media", { assetId: presign.assetId, key: presign.key, contentType, sizeBytes: bytes.length, filename }, apiKey);
return presign.assetId;
}Verify the asset#
Often you do not need to wait: you can compose against an asset that is still processing, and the destination is held (target.on_hold, holdReason: "media_preparing") until the file is ready.
To know sooner, subscribe to media.ready or poll GET /media/:id and read ready.
There is no ready value of status: the final status is transcoded. A failed or quarantined asset leaves ready false forever, so stop when statusCategory is not null.
Do not wait for a platform to appear in variants[]: a platform the processed file already satisfies never gets a row. readiness gives one verdict per platform.
export async function waitForAsset(assetId: string, apiKey: string, maxWaitMs = 120_000): Promise<void> {
const started = Date.now();
let delay = 1_000;
while (Date.now() - started < maxWaitMs) {
const res = await fetch("https://api.skedcast.com/v1/media/" + assetId, {
headers: { Authorization: "Bearer " + apiKey },
});
const asset = (await res.json()).data;
if (asset.ready) return; // publishable: compose now
if (asset.statusCategory !== null) {
throw new Error("Asset stopped without becoming ready: " + asset.status);
}
await new Promise((resolve) => setTimeout(resolve, delay));
delay = Math.min(delay * 2, 10_000); // back off, capped at 10 seconds
}
throw new Error("Timed out waiting for the asset");
}GET /media/:id fields#
| Field | Tells you | Use it to |
|---|---|---|
ready / publishable | Whether you can compose against the asset now | End a wait loop |
status | Where the asset is in processing; the last good value is transcoded | Show progress. Never compare it with ready |
statusCategory | Not null once the asset has stopped for good, such as failed or quarantined | Stop waiting |
readiness | One verdict per platform: ready, preparing or failed | Find out which platform a failure affects |
variants | The renditions made for specific platforms | Inspect, not wait on: a platform the file already satisfies has no row |
thumbnailUrl | A preview image of the asset | Show it in your own library view |
Alt text and several images#
Send the assets in mediaIds in the order you want them to appear. Alt text goes in mediaAltTexts, an object keyed by asset id with at most 2,000 characters per entry.
The asset you send as coverMediaId is a cover only, not one of the files in mediaIds.
Narrow processing with `platforms`#
| Your situation | Send in platforms | Effect |
|---|---|---|
| The video is for YouTube and TikTok only | ["youtube", "tiktok"] | SkedCast prepares versions for those two and skips the rest |
| You are unsure which accounts will be targeted | Omit it | A version is prepared for every platform you have a live connected account on, narrowed to the client when you send clientId |
| You later target a platform you left out | Nothing: no action needed | SkedCast prepares it then, and that destination waits until it is ready; it does not fail |
After you register#
Registering hands the file to processing. SkedCast reads the stored object to record its real size, then scans it and checks the real file type from the bytes, whatever contentType you declared.
A file that fails the check is quarantined and never becomes publishable. A file that passes becomes a master copy, and the versions a platform needs are made from it.
Launch video with a cover#
| Step | Call | Key fields | Result |
|---|---|---|---|
| 1. Upload the video | POST /media/presign, PUT, POST /media | filename, contentType, sizeBytes, platforms | A video asset id |
| 2. Upload the cover | The same three calls | A JPEG or PNG, under 50 MB for YouTube | A cover asset id |
| 3. Check the post | POST /posts/preview | The compose body you plan to send | A verdict per platform, nothing written |
| 4. Compose | POST /posts | mediaIds, coverMediaId, coverFrameMs, targets, schedule | A scheduled post with one destination per account |
| 5. Confirm after publishing | GET /post-targets/:id | coverIssue, permalink | Whether the cover applied, and the post's public URL |
Troubleshoot#
A failed asset could not be processed, and a quarantined asset did not pass the checks on the file. Neither becomes ready: retrying the same bytes will not change that.
Upload a corrected file as a new asset, with a fresh Idempotency-Key.
A single platform can also fail on its own: readiness shows failed for a network whose duration cap the video exceeds, while it stays ready for the others.
| Mistake | Cause | Fix |
|---|---|---|
| Composing against an unregistered file | The PUT stores the bytes, but processing starts only when you register | Register with POST /media |
400 media_bad_key | The key on register or complete is not the one presign issued for that asset, or register sent a clientId different from the presign's | Send the key from presign, and leave clientId out of register (or send the presign's) |
Trusting contentType | It is a hint: SkedCast checks the real file type from the bytes after the upload | Send the true type and the true sizeBytes |
A missing Idempotency-Key | Every POST on /v1 requires a unique one | Send one per request |
Related reference#
- Authentication and conventions: the credential, retries and errors.
- API reference and API error catalogue: every media route, field and error code.
- Webhooks: subscribe to
media.ready. - The developer docs index for every other reference page.
- Quickstart and social media posting API quickstart: from a key to a scheduled post.
- Platform capabilities JSON and platform limits JSON: what each network accepts before you upload.
- Upload media guide: the shorter walk-through of the calls.
- API request builder, code snippets and TypeScript SDK: try the calls.
- Partner onboarding: uploading for a customer's connected accounts.
- Social media library: the same media assets in the app.