Authentication

AAditya Kothadiya4 min readAvg. reading speed: 200 words per minuteLast updated Nov 28, 2026

Scripts use API keys. AI apps sign in with OAuth. Both act as the person who made them, inside one workspace.

API key

OAuth connection

Made by

You, in Settings › Developers

The sign-in page, when an AI app connects

Looks like

wb_key_ + 64 hex characters

wb_at_… access, wb_rt_… refresh

Lifetime

Until you revoke it, or an expiry you choose

Access 1 hour, refresh 90 days (a new one on every refresh)

Used by

REST API, and MCP apps that take headers

Claude.ai, Claude Desktop, ChatGPT, Gemini CLI, Claude Code

Plans

Professional and up

Personal and up (paid plans)

API Keys

Send the key in the Authorization header of every request:

GET https://api.webbooks.ai/v1/books
Authorization: Bearer wb_key_…
  • The full key is shown once, when you create it. WebBooks stores only a hash and the first characters (the prefix you see in the list).

  • Pause a key to stop it for a while; Revoke it to end it for good. Both take effect on the next request.

  • Optional limits: an expiry date, only some books, and a monthly credit limit (counted per calendar month, UTC).

  • A key acts as the person who created it. If they leave the workspace or lose edit access, their keys stop working at once (401 no_access).

Warning: Keep keys secret. Never put a key in a web page, a mobile app or a public repository. If one leaks, revoke it in Settings › Developers and create a new one.

OAuth 2.1 for Apps

AI apps connect with the standard MCP authorization flow. Most apps do all of this for you: you only see the WebBooks sign-in and the approval page. These details are for people building their own client.

Discovery

Document

Address

Protected resource (MCP)

https://mcp.webbooks.ai/.well-known/oauth-protected-resource/mcp

Authorization server

https://mcp.webbooks.ai/.well-known/oauth-authorization-server

Issuer

https://mcp.webbooks.ai

Authorize (sign-in and approval page)

https://app.webbooks.ai/oauth/authorize

Token

https://mcp.webbooks.ai/oauth/token

Register a client

https://mcp.webbooks.ai/oauth/register

Revoke

https://mcp.webbooks.ai/oauth/revoke

An MCP request without a token gets 401 with WWW-Authenticate: Bearer resource_metadata="https://mcp.webbooks.ai/.well-known/oauth-protected-resource/mcp", which is how apps find the rest.

The Flow

  1. Register (RFC 7591): POST /oauth/register with client_name and redirect_uris. Clients are public (token_endpoint_auth_method: none). Redirects must be https, or http://localhost / http://127.0.0.1 for command-line tools.

  2. Authorize: send the person to https://app.webbooks.ai/oauth/authorize with response_type=code, client_id, redirect_uri, state, scope (space-separated, optional) and PKCE: code_challenge with code_challenge_method=S256 (required). The resource parameter (RFC 8707) is accepted.

  3. Approve: the person picks a workspace, reviews the permissions (they can untick any), optionally limits books and monthly credits, and presses Allow. You get code and state back. Codes work once, for 10 minutes. A workspace on the Free plan can't connect: the page explains that AI apps need a paid plan.

  4. Exchange: POST /oauth/token with grant_type=authorization_code, code, redirect_uri, client_id and code_verifier.

  5. Refresh: grant_type=refresh_token. Each refresh returns a new refresh token; the old one stops working. Using an old refresh token again disconnects the app, in case the token was stolen.

  6. Revoke (RFC 7009): POST /oauth/revoke with the token. People can also disconnect the app in Settings › Developers.

{
  "access_token": "wb_at_…",
  "token_type": "Bearer",
  "expires_in": 3600,
  "refresh_token": "wb_rt_…",
  "scope": "books:read books:write books:publish analytics:read"
}

Who Can Do What

Action

Workspace admin

Member

Viewer

Create an API key

Yes

Yes, when "Members can create keys" is on (default)

No

See, pause or revoke keys

All keys

Their own

No

Connect an AI app

Yes

Yes

No

See or disconnect apps

All apps

Their own

No

Manage webhooks

Yes

No

No

Switch the API, MCP or webhooks on or off

Yes

No

No

See usage

Whole workspace

Their own

No

A key or connection never holds more than the person who made it: members can't hand out webhooks:manage. The Permissions chapter lists every scope.