Choose what Octolens collects from a Discord server
mode: everything collects every message in the chosen channels under the server’s whole-server keyword (kind: discord_server, named after the server): it is created on first use (one ordinary keyword slot, 400 KEYWORD_LIMIT_EXCEEDED when none is left; every channel and no daily budget unless channelIds / dailyCap are given) and resumed afterwards. Its posts count toward the workspace’s monthly mention allowance. mode: keywords collects only messages that match the workspace’s keywords: the whole-server keyword is paused, never deleted, so switching back resumes it with the same channels and daily budget. channelIds and dailyCap apply only to everything (400 INVALID_INPUT otherwise); omitted, they are kept. Given channelIds also widen the server’s channelAllowlist to cover them ([] clears it). Idempotent; answers the server with its collection. Requires an admin-scoped key; 404 DISCORD_LINK_NOT_FOUND for a disconnected or another workspace’s server, 400 DISCORD_CHANNEL_INVALID for a channel the bot cannot read, 403 DISCORD_SOURCE_UNAVAILABLE while the Discord source is not enabled for the workspace.
Authorizations
Clerk API key. Create one in Settings → API Keys. Pass as Authorization: Bearer <key>. Keys carry a scope — read, write (implies read) or admin (implies write) — chosen when the key is minted. Each operation's security requirement (and its x-required-scope extension) names the minimum scope it needs; request the least-privileged key that covers the operations you call.
Path Parameters
Body
everything: every message in the chosen channels is collected and checked for relevance (the server's whole-server keyword is active). keywords: only messages that match the workspace's keywords (the whole-server keyword, if any, is paused).
everything, keywords "everything"
everything only: channels to collect; [] = every channel of the server. The server's channelAllowlist is widened to cover the choice ([] clears it; it is never narrowed). Omit to keep the current channels (every channel the server link reads on first use).
500A Discord snowflake id as a decimal string (64-bit — never parse it as a number).
^\d{1,20}$Response
200 response
Mentions tracking the whole server is expected to add per month without a daily budget (messagesPerDay7d × prefilter pass ratio × 30); they count toward the workspace's monthly mention allowance. null = unknown (no stats yet).
-9007199254740991 <= x <= 9007199254740991