Skip to content
Reading with an AI assistant?View as MarkdownOpen in ClaudeOpen in ChatGPT

Guides

Upload media and set a video cover via API

Updated

To set a video cover via API in SkedCast, upload the cover image like any other media, then pass its asset id as coverMediaId when you compose. Uploading is four calls: presign, PUT the file to the presigned URL, register the asset, then pass its asset id in mediaIds. Media never goes through the API itself, only a URL does. This page covers the four calls, video covers, large files and how to limit processing to the platforms you need.

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#

Calls
StepCallResult
1. PresignPOST /media/presignAsset id, URL
2. UploadPUT <url>File stored
3. RegisterPOST /mediaProcessing starts
4. ComposePOST /postsPost uses asset
Diagram: a file is presigned to get an asset id and upload URL, PUT straight to storage, registered so SkedCast scans and transcodes it, then referenced by its asset id in a post.
Four calls take a file from your disk into a post.

Prerequisites#

  • An API key or OAuth token with the media.manage scope, from the scopes reference.
  • An Idempotency-Key header 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.
  • clientId is 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 leave clientId out of the register call (if you send it, it must be the same value, else 400 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.

bash
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
  }'
Presign a direct upload.
json
{
  "data": {
    "assetId": "b3f1a2c4-5d6e-4f70-8a9b-1c2d3e4f5a6b",
    "key": "<storage key>",
    "url": "https://<presigned-upload-host>/…",
    "expiresAt": "2026-08-06T15:10:00Z"
  },
  "meta": { "correlationId": "c-…" }
}
Response — keep assetId and key for step 3.

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.

bash
curl -X PUT "<url from step 1>" \
  -H "Content-Type: video/mp4" \
  --data-binary @launch-teaser.mp4
Upload directly to storage.

Register 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.

bash
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"]
  }'
Register the uploaded object.
json
{
  "data": {
    "assetId": "b3f1a2c4-5d6e-4f70-8a9b-1c2d3e4f5a6b",
    "status": "pending",
    "readyEvent": "media.ready"
  },
  "meta": { "correlationId": "c-…" }
}
Response — the asset is queued, and names the event that says it is done.

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.

bash
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" }'
Import from a URL.

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.

bash
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" }
  }'
Compose a post with the video plus a custom cover image.

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#

Cover fields
PlatformField you sendWhat SkedCast sendsNotes
YouTubecoverMediaIdA custom thumbnail through the YouTube Data APIJPEG or PNG up to 50 MB. YouTube accepts custom thumbnails only from a verified channel
InstagramcoverMediaIdThe cover image inside the create callAccepting the create call is accepting the cover
FacebookcoverMediaIdThe thumbnail inside the create callNot used for a Facebook Reel
TelegramcoverMediaIdThe thumbnail inside the send callUsed as the video's thumbnail
TikTokcoverFrameMsvideo_cover_timestamp_msA frame offset in milliseconds, not an image. First frame if unset or invalid
Other destinationsNeither field is documentedNot applicableDo not rely on a cover field there

YouTube's limits are from the thumbnails.set reference and the TikTok field from the Direct Post reference, both read 22 November 2026. The Instagram, Facebook and Telegram rows describe what SkedCast sends.

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#

Cover outcomes
OutcomeMeaningcoverIssueWhat to do
AppliedThe platform accepted the cover (for TikTok, the frame offset was sent)nullNothing
Not attemptedNo cover to set: no cover chosen, or a surface with no cover such as a photo post, a Facebook Reel or an Instagram storynullNothing
RejectedThe platform refused the cover and kept its ownA sentence with the reasonFix what it says: verify the channel, shrink the image, wait out a quota
Fetch failedSkedCast could not read your cover image from storageA sentenceRetry; your image and account are not at fault
UnconfirmedThe request got no answer, so the cover may or may not have landedA sentenceCheck the video on the platform, then try again if it is missing

Read `coverIssue` on the destination (`GET /post-targets/:id`, or the post's targets) after a post publishes.

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.

bash
# 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 upload
Presign a multipart upload, then finish it once every part is uploaded.

Size limits#

Size limits
Kind of fileLargest acceptedWhy
Video10 GiBLong-form uploads, the largest file kind SkedCast accepts
Image, GIF or document2,047 MiBThe largest file the malware scan can read

The limits are the ones the API applies. A limit on your plan can be lower; a file over it is refused with `413 media_too_large`.

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#

Import error codes
CodeStatusCauseFix
media_url_scheme400The URL is not httpsUse an https:// address
media_url_credentials400The URL embeds a username or passwordUse a link that needs none, such as a signed URL
media_url_port400The URL names a port other than the defaultServe the file on the default https port
media_url_blocked400The address points somewhere SkedCast will not fetch fromUse a public host
media_url_unresolvable400The host name did not resolveCheck the host name
media_url_timeout400The fetch timed outRetry, or host the file closer
media_url_not_a_file400The link opens a web page, not a fileGive a direct download link
media_url_too_many_redirects400The URL redirected too many timesUse the final URL
media_url_status502The host answered with an error statusFix the host, then retry
media_url_fetch_failed502The fetch failedRetry
media_url_too_large413The file is over the size limitSend a smaller file
media_import_busy429Too many imports are runningWait and retry with the same key

Every code is listed with its meaning in the API error catalogue.

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.

ts
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;
}
Upload one file and return its asset id (Node.js 20 or later).

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.

ts
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");
}
Wait for an asset with backoff and a failure exit.

GET /media/:id fields#

GET /media/:id fields
FieldTells youUse it to
ready / publishableWhether you can compose against the asset nowEnd a wait loop
statusWhere the asset is in processing; the last good value is transcodedShow progress. Never compare it with ready
statusCategoryNot null once the asset has stopped for good, such as failed or quarantinedStop waiting
readinessOne verdict per platform: ready, preparing or failedFind out which platform a failure affects
variantsThe renditions made for specific platformsInspect, not wait on: a platform the file already satisfies has no row
thumbnailUrlA preview image of the assetShow it in your own library view

The detail route carries `readiness` and `variants`; the list route does not.

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`#

Narrow processing with `platforms`
Your situationSend in platformsEffect
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 targetedOmit itA 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 outNothing: no action neededSkedCast prepares it then, and that destination waits until it is ready; it does not fail

`platforms` is optional on `POST /media` and `POST /media/import-url` and takes up to 10 platforms.

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#

Launch video with a cover
StepCallKey fieldsResult
1. Upload the videoPOST /media/presign, PUT, POST /mediafilename, contentType, sizeBytes, platformsA video asset id
2. Upload the coverThe same three callsA JPEG or PNG, under 50 MB for YouTubeA cover asset id
3. Check the postPOST /posts/previewThe compose body you plan to sendA verdict per platform, nothing written
4. ComposePOST /postsmediaIds, coverMediaId, coverFrameMs, targets, scheduleA scheduled post with one destination per account
5. Confirm after publishingGET /post-targets/:idcoverIssue, permalinkWhether the cover applied, and the post's public URL

Step 3 is optional but cheap: the preview checks the content and destinations without creating a post.

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.

Table
MistakeCauseFix
Composing against an unregistered fileThe PUT stores the bytes, but processing starts only when you registerRegister with POST /media
400 media_bad_keyThe key on register or complete is not the one presign issued for that asset, or register sent a clientId different from the presign'sSend the key from presign, and leave clientId out of register (or send the presign's)
Trusting contentTypeIt is a hint: SkedCast checks the real file type from the bytes after the uploadSend the true type and the true sizeBytes
A missing Idempotency-KeyEvery POST on /v1 requires a unique oneSend one per request

Sources