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 |
|
|
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) |
|
Authorization server |
|
Issuer |
|
Authorize (sign-in and approval page) |
|
Token |
|
Register a client |
|
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
Register (RFC 7591):
POST /oauth/registerwithclient_nameandredirect_uris. Clients are public (token_endpoint_auth_method: none). Redirects must be https, orhttp://localhost/http://127.0.0.1for command-line tools.Authorize: send the person to
https://app.webbooks.ai/oauth/authorizewithresponse_type=code,client_id,redirect_uri,state,scope(space-separated, optional) and PKCE:code_challengewithcode_challenge_method=S256(required). Theresourceparameter (RFC 8707) is accepted.Approve: the person picks a workspace, reviews the permissions (they can untick any), optionally limits books and monthly credits, and presses Allow. You get
codeandstateback. 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.Exchange:
POST /oauth/tokenwithgrant_type=authorization_code,code,redirect_uri,client_idandcode_verifier.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.Revoke (RFC 7009):
POST /oauth/revokewith 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.