Skip to content

AdminClient

client.admin (also available via the @kowloon/client/admin subpath export) wraps the server's /admin/* routes. Every method here requires the logged-in user to be a server admin or moderator -- see the REST API admin docs for the exact auth guard and per-route detail. This page covers the client-side method surface.

Most content types follow the same five-method shape:

client.admin.get<Plural>(options) // list -- page/since/showDeleted/type
client.admin.get<Singular>(id)
client.admin.create<Singular>(data) // where applicable
client.admin.update<Singular>(id, updates) // raw PATCH -- bypasses the outbox/Activity pipeline entirely
client.admin.delete<Singular>({ id, fullDelete }) // soft-delete by default; fullDelete: true hard-deletes
client.admin.restore<Singular>(id) // undo a soft-delete

This pattern covers: Activities, Users, Circles, Groups, Posts, Bookmarks, Pages. List methods share an internal _listParams helper that normalizes page/since/showDeleted (-> deleted=true server-side)/type.

client.admin.getSections()
client.admin.createSection(data)
client.admin.updateSection(id, updates)
client.admin.deleteSection(id)
client.admin.getRecommendations()
client.admin.addRecommendation(data)
client.admin.updateRecommendation(id, updates)
client.admin.removeRecommendation(id)

Curation CRUD for the public Discover feed's shelves and items -- see GET /recommendations for how these surface to end users.

client.admin.createInvite({ email, maxRedemptions, expiresAt, note, welcomeMessage })
client.admin.getFlagged({ status, targetType, actorId })
client.admin.getFlag(id)
client.admin.resolveFlag(id, { status, notes }) // status: 'resolved' | 'dismissed'
client.admin.getSettings()
client.admin.getSetting(name)
client.admin.updateSetting(name, value)
client.admin.deleteSetting(name)

Settings marked canEdit: '@private' or with a redacted UI type are rejected by the server even through these calls -- see the REST API admin docs for the exact redaction rules.

client.admin.restartServer()
client.admin.serverStats() // GET /admin/system
client.admin.getAdmins()
client.admin.addAdmin(userId)
client.admin.removeAdmin(userId)
client.admin.getMods()
client.admin.addMod(userId)
client.admin.removeMod(userId)
client.admin.getLogs({ tail, level }) // tail defaults to 200, level defaults to 'all'

Admin/mod membership here bypasses the normal Add/Remove Activity pipeline -- these circles are server-owned, and this is a direct membership-management path, not a client wrapper around client.activities.addToCircle.

client.admin.createBackup()
client.admin.listBackups()
client.admin.getBackupJob(id)
client.admin.deleteBackup(id)
client.admin.backupDownloadUrl(id) // pure URL builder, not an HTTP call
client.admin.restoreFromFile(file) // raw multipart fetch -- bypasses HttpClient, same as FilesClient.upload()

These back an async job queue server-side (queue a backup, poll for status, download when done) rather than a synchronous export. restoreFromFile and backupDownloadUrl share the same multipart/raw-fetch caveat as FilesClient.upload() -- see the gotchas page.

client.admin.adminSearch({ query, showDeleted })

Mirrors client.search.search(), but hits /admin/search and can include soft-deleted content in results.