---
title: "Ensure each user has at least 4 videos whose covers are hosted on Supabase"
method: POST
path: "/api/auto-assign-thumbnails"
tags: ["Auto Assign Thumbnails"]
---

# Ensure each user has at least 4 videos whose covers are hosted on Supabase

`POST /api/auto-assign-thumbnails`

## Request

- Base URL: `https://api.kolect.com`
- URL: `https://api.kolect.com/api/auto-assign-thumbnails`
- Auth: HTTP bearer

Iterates through **users** in batches of 50 (cursor based).
For each kol_id (TikTok / Instagram / YouTube):
1. Count existing videos in **influencer_videos** whose `cover` contains the word **supabase**.
2. If that count is **< 4**, fetch one page of videos from RapidAPI, upload their thumbnails to the
   `influencer-video-thumbnails` bucket, then upsert the cover URL back into **influencer_videos**.

## Request body

- object
  - `batchSize` integer: Override default batch size

## Response `200`

Job completed

- object
  - `success` boolean
  - `processedAccounts` integer
  - `processedKols` integer
  - `updatedVideos` integer
  - `timeTaken` string

---

[API](https://skmtc.dev/kolect/apis/kolect-api.md) · [All operations](https://skmtc.dev/kolect/apis/kolect-api/llms.txt) · [OpenAPI document](https://skmtc.dev/kolect/apis/kolect-api/revisions/fe54528e8f54?raw)
