Skip to content
reelspanDocs

After you post

YouTube thumbnail

Set a new custom thumbnail on a YouTube video that is already published, from a file, a public link or an earlier upload, by video id or request_id.

POSTapi.reelspan.com/v1/youtube/thumbnailTry it →

Changes the thumbnail of a video already on YouTube. To set one while posting, send thumbnail with the video instead (see YouTube).

Set a thumbnail

Send the image as a multipart thumbnail file, with the profile in user and the YouTube video_id:

curl -X POST https://api.reelspan.com/v1/youtube/thumbnail \
  -H "Authorization: Bearer $REELSPAN_API_KEY" \
  -F "user=my-brand" \
  -F "video_id=aB3xYz12Q" \
  -F "[email protected]"
{
  "success": true,
  "video_id": "aB3xYz12Q",
  "width": 1280,
  "height": 720,
  "thumbnails": {
    "default": { "url": "https://i.ytimg.com/vi/aB3xYz12Q/default.jpg", "width": 120, "height": 90 },
    "high": { "url": "https://i.ytimg.com/vi/aB3xYz12Q/hqdefault.jpg", "width": 480, "height": 360 },
    "maxres": { "url": "https://i.ytimg.com/vi/aB3xYz12Q/maxresdefault.jpg", "width": 1280, "height": 720 }
  }
}

width and height are those of the largest size YouTube made; thumbnails lists every size.

The image

Send one of these; when more than one is sent, the file wins, then the URL:

  • thumbnail: the file, in a multipart/form-data body.
  • thumbnail_url: a public https URL (in JSON or multipart).
  • thumbnail_media_id: a photo uploaded earlier with kind=photo.

It must be JPEG, PNG, GIF or BMP and at most 2 MB. Reelspan doesn't keep the file afterwards; a thumbnail_media_id stays in your uploads.

Which video

  • video_id and user (or profile_username): any video on the profile's connected YouTube channel, including ones uploaded outside Reelspan. post_id works in place of video_id.
  • Or request_id: the Reelspan request that published the video.

Good to know

  • A verified channel. YouTube allows custom thumbnails only on channels verified at youtube.com/verify. On other channels YouTube refuses with 403, which comes back as 502 youtube_forbidden.
  • Shorts don't show custom thumbnails on YouTube, even when one is set.
  • Thumbnails are the only change Reelspan can make to a published video: editing or deleting it needs a wider YouTube permission than the upload access Reelspan asks for.

Errors

Status error_code Why
400 MEDIA_REQUIRED No thumbnail, thumbnail_url or thumbnail_media_id was sent.
400 UNSUPPORTED_MEDIA The image isn't JPEG, PNG, GIF or BMP.
400 MEDIA_NOT_FOUND thumbnail_media_id isn't an image of this workspace.
400 INVALID_REQUEST Neither request_id, nor video_id with user, was sent, or the body isn't JSON or multipart.
404 NOT_FOUND, POST_NOT_FOUND No such request, or it has no live YouTube video.
404 profile_platform_mapping_invalid The profile has no YouTube channel connected.
409 reauth_required The channel must be reconnected first.
413 FILE_TOO_LARGE The image is over 2 MB.
502 youtube_forbidden The channel isn't verified for custom thumbnails, or YouTube refused for another reason in message.
502 youtube_… YouTube refused; message carries its reason.

Setting a thumbnail needs a key with the publish scope.

Request body

application/json

  • userstring

    Profile username, with video_id

  • video_idstring

    The YouTube video id

  • request_idstring

    Or the Reelspan request that published the video

  • thumbnail_urlstring

    A public https URL of the image

  • thumbnail_media_idstring

    An image uploaded earlier with POST /v1/media/upload?kind=photo

Responses

200 Set

{
  "success": true,
  "video_id": "string",
  "width": 0,
  "height": 0,
  "thumbnails": {}
}

400 Invalid input, or the network can’t do this (`platform_not_supported`)

{
  "success": false,
  "message": "string",
  "error": "string",
  "error_code": "string"
}

404 No such request, profile, account or post

{
  "success": false,
  "message": "string",
  "error": "string",
  "error_code": "string"
}

Something unclear or missing? Write to [email protected] and we’ll fix the page.