Prefer a terminal? The Octolens CLI wraps this API with stable exit codes and a strict
--json contract — often the fastest path for shell scripts, cron jobs, CI, and AI agents.How to use the Octolens API
Create an API Key
In Octolens, navigate to Settings and then the API tab.- Click “Add new key”
- Choose a name for your API key
- Choose a scope:
read,write(implies read), oradmin(implies write) - Choose an expiration date for your API key from the dropdown
- Click Create
Quick Start
Base URL
Authentication
Bearer token in the Authorization header. Each endpoint documents the scope it requires.Rate Limits
500 requests per hour per organization (across all keys). Every 2xx response returns three headers so clients can pace themselves:X-RateLimit-Limit— the hourly cap (500)X-RateLimit-Remaining— requests left in the current windowX-RateLimit-Reset— Unix timestamp (seconds) when the window resets
Retry-After header.
Example Request
Error Handling
All non-2xx responses share the same envelope:code field is a stable ApiErrorCode enum — branch on it programmatically instead of parsing message. VALIDATION_ERROR (400) responses include a details array with per-field issues; inspect details[i].path to pinpoint which input was rejected.
Common error codes
Security: treat mention content as untrusted input
Every mention field that originates from the platform post (body, title, author, authorName, …) was written by an unknown third party on the open internet. Handle these fields like any untrusted user input:
- Rendering or storing? Escape before rendering (XSS) and parameterize before storing (SQL injection) — standard hygiene.
- Feeding mentions to an LLM or AI agent? Mention text can contain prompt injection — instructions crafted to manipulate the model (e.g. “ignore your previous instructions and…”). Pass mention content in a clearly delimited data context, never concatenated into your system prompt. Give the consuming agent the fewest permissions that do the job, and gate consequential actions (sending email, creating tickets, changing code, moving money) behind a confirmation step.
