Lookio Docs
Lookio websiteOpen Lookio
DevelopersAuthentication and scopes

Authentication and scopes

Authenticate to the Lookio API with an API key or an OAuth token, and choose the scopes that decide what a credential may do.

Send a credential in the Authorization header of every request.

Terminal
curl https://api.lookio.app/v1/account \
  -H "Authorization: Bearer $LOOKIO_API_KEY"

A key looks like sk_live_<id>_<secret>_<checksum>. Never put it in a URL or in front-end code. The API sends no CORS headers on /v1, so a browser cannot call it.

Two kinds of credential

API keyOAuth connection
Created byAn admin, in Developer tools.A person, who approves it in the app. Used by the CLI login and by MCP clients.
Belongs toThe workspace.The person who approved it.
PermissionsIts scopes, and optionally a list of assistants.Its scopes, narrowed by the person’s own Lookio permissions at every call.
ConversationsKeeps the conversations it starts. Continue them with conversation_id. Name your users with end_user, or send store: false to keep nothing.Keeps the person’s own chats. Continue them with conversation_id.
Members and tagsNever.Admins only, with the admin scope.
LifetimeUntil it expires or is revoked.Access token 30 days, renewed by a refresh token valid 90 days.

Use an API key for a job or a backend. Use a connection for a person’s CLI or AI client. See API keys.

Scopes

A scope is a permission on a credential. If the credential does not have the scope of an endpoint, the request fails with insufficient_scope. Each endpoint page names its scope.

ScopeLets the credential
account:readSee your workspace, plan, and credit balance.
usage:readSee credit usage over time, and the answer log: when, which assistant, which channel, what it cost. Not the questions.
resources:readSee resources, their indexed text, their status, the pages of a site, and the indexing log.
resources:writeAdd, edit and re-index resources, and sync sites. Free of credits.
resources:deleteDelete resources and their indexed passages.
assistants:readSee assistants and their settings.
assistants:writeCreate and edit assistants and widgets, choose what they read, and read their conversations in the logs.
assistants:deleteDelete assistants and widgets. Their resources stay.
queryAsk questions, at the mode’s price, and search passages, at 1 credit. Rename and delete conversations, and send thumbs.
adminManage members’ permissions and assistants, and read the activity log. Admins only.
webhooks:writeManage the webhooks that tell your systems when an import ends. Not available yet: no endpoint uses it.

query is the only scope that spends credits. Deleting has its own scopes, so a key can create and edit without the right to delete. Widgets use the assistant scopes.

GET /v1/account (MCP: get_account) returns credential.scope_descriptions. It gives one sentence for each scope of the credential.

What a credential can really do

GET /v1/account returns the scopes that a credential can really use. They are its granted scopes, minus:

  • for a connection, what the admin does not let members give to AI clients;
  • for a connection, what the person’s own permissions refuse, checked at each call;
  • for an API key, admin. A key never manages people.

On the Pro and Custom plans, a person also needs the api permission for the REST API and the CLI, and mcp for an MCP client. If not, the call fails with permission_denied.

OAuth

An MCP client or the CLI gets a token through OAuth 2.1. You do not need this to use an API key.

sequenceDiagram participant C as CLI or MCP client participant B as Your browser participant L as Lookio C->>B: Open /authorize (code_challenge S256) B->>L: Sign in, choose the workspace, approve scopes L-->>C: Authorization code (redirect) C->>L: POST /oauth/token (code + code_verifier) L-->>C: Access token and refresh token C->>L: API or MCP calls with the token
A personal connection, with PKCE
  • Authorization code with PKCE. PKCE with S256 is required. plain is refused.
  • Device code (RFC 8628) for machines without a browser. Poll every 5 seconds. The code is valid for 15 minutes.
  • Refresh tokens renew access tokens.
  • Client registration by Client ID Metadata Document (an https client id) or by dynamic registration (RFC 7591). All clients are public: there is no client secret.

The endpoints are at /.well-known/oauth-authorization-server, on api.lookio.app and on mcp.lookio.app.

EndpointPath
Authorization/authorize
Token/oauth/token
Device authorization/oauth/device
Registration/oauth/register
Revocation/oauth/revoke

You can request a token for one resource (RFC 8707): https://api.lookio.app/v1, https://mcp.lookio.app/mcp or https://mcp.lookio.app/mcp/code. Such a token works only there. A token without resource works everywhere.

See Connect an AI client for the MCP flow.

Failures

CodeMeaning
authentication_requiredNo Authorization: Bearer header.
invalid_api_keyThe credential is malformed or unknown.
api_key_expiredThe credential passed its expiry.
api_key_revokedAn admin revoked it, or the person behind a connection left the workspace.
insufficient_scopeValid credential, missing scope.
permission_deniedThe person does not have a Lookio permission.

Lookio limits repeated failed sign-ins from one address. See Rate limits.

Use these docs with your AI tools

An AI agent can read this documentation directly. You do not need an account or an API key. Everything here is public and read-only.

Query these docs via MCP

Recommended

Add this server to Claude, Claude Code, Cursor, Mistral, or any tool that supports MCP. Your agent can then search Lookio Docs documentation and read it in full, instead of answering from memory.

https://lookio.app/docs/mcp
  • searchFind the passages that answer a question.
  • fetchRead one page in full, as Markdown.
  • list_pagesSee every page in this documentation.

Query these docs over HTTP

The same tools also work as plain web requests. Use this for scripts, or for any tool that does not support MCP. There is one endpoint per tool. Arguments go in the query string, and the answer comes back as JSON.

https://lookio.app/docs/api/docs/search?query=custom+domain

Read the OpenAPI description. It is built from the same definitions as the tools, so it always matches what the endpoints do.

Read these docs as Markdown

Add .md to any page URL to get its Markdown source. You can also send the headerAccept: text/markdown to the page URL itself.

To read the whole documentation in one file, open llms-full.txt. For a short index of every page, open llms.txt.