A ban blocks one entity — a user id, a signed IP, or any identifier you choose. The check runs on every request, before your handler, so a banned caller never reaches your code.

1import { banEntity, unbanEntity, isEntityBanned, getBannedEntries } from "apiker";
2
3await banEntity(userId);
4await isEntityBanned(userId); // true
5await getBannedEntries(userId); // the ban history for one entity
6await unbanEntity(userId);

A banned request is answered with 401 and an empty body.

Listing bans

import { getBannedEntities } from "apiker"; const recent = await getBannedEntities(50);

Setup

apiker.init({ routes, exports, objects: ["Common", "Bans"] });
Bans do not expire and are never pruned. Lifting one is an explicit unbanEntity call, from your own code or the admin panel.