🍿 @lorenzopant/tmdb

Clear

Remove all items from a v4 list without deleting the list itself.

Removes every item from the list while keeping the list and its metadata intact. To permanently delete the list as well, use delete().

async clear(list_id: number): Promise<V4ListStatusResponse>

TMDB Reference: Clear List

Parameters

NameTypeRequiredDescription
list_idnumberThe TMDB list ID to clear.

Returns

V4ListStatusResponse

Errors

HTTPTMDB codeCause
4013Invalid or missing access token.
40434List not found.
40315Not authorized to modify this list.

Example

import { TMDB } from "@lorenzopant/tmdb";

const tmdb = new TMDB("your-access-token");

const { success } = await tmdb.v4.lists.clear(8700);
console.log(success); // true — list is now empty, but still exists

On this page