Authorization header. Neither reads cookies.
OAuth 2.1
Burokku runs an OAuth 2.1 authorization server. AI apps that speak MCP find and use it on their own; you only need this section to build your own client.Discovery
A call to the MCP server or the REST API without a valid token gets401 Unauthorized with a WWW-Authenticate: Bearer resource_metadata=… header. The header points to that server’s protected resource metadata (RFC 9728), which names the issuer. When a token was sent but isn’t valid, the header also says error="invalid_token". The body says the same for people. On the REST API it’s Burokku’s usual error, with the code unauthorized or invalid-token (Errors). On the MCP server it’s {"error": "unauthorized"} or {"error": "invalid_token"}, with an error_description in English.
The flow
Burokku supports the authorization code grant only, with PKCE usingS256 for every client, confidential ones too. A request without it is sent back with invalid_request. There’s no implicit flow.
1
Register, or use a metadata document
See Client registration.
2
Send the user to /oauth/authorize
With
response_type=code, your client_id and redirect_uri, the scope you need, a state, a code_challenge with code_challenge_method=S256, and resource set to the server you’ll call (RFC 8707). Without resource, the token is for the MCP server.3
The user approves
Burokku shows your app’s name, its domain and where it returns to, what it can see and do, and what it can’t. The user signs in, or, for the connector, may continue without an account. The approval page works once, for 10 minutes, in the browser that opened it. A locked account can’t approve.
4
Exchange the code
Burokku redirects back with
code, state and iss (RFC 9207). Check state and iss, then post the code and your code_verifier to /oauth/token, form-encoded.resource, the one named when the user approved. A token for the MCP server is refused by the REST API with 401 (invalid-token), and the other way round. To call the REST API, ask for a token with resource=https://api.burokku.app/v1. To call both, authorize once for each, and always refresh with the same resource: a code exchange or refresh that names the other one gets invalid_target, and its error_description names the resource the token was issued for.
Every error under /oauth/ is JSON, {"error": …, "error_description": …} (RFC 6749), with the description in English. The approval page shows its errors as a page in a browser, and as the same JSON to anything that doesn’t ask for HTML.
Client registration
- Client ID Metadata Documents (CIMD). Use an HTTPS URL that serves your client’s metadata as your
client_id, and Burokku reads it. Claude and ChatGPT do this. Public clients authenticate withnone. - Dynamic client registration (DCR, RFC 7591) at
https://app.burokku.app/oauth/register. It allows 20 registrations an hour from one network; past that it answers429withtemporarily_unavailableand aRetry-Afterheader. A registration may be at most 16 KB, with at most 10 redirect URIs of up to 512 characters each, a name of up to 200 characters, other URIs of up to 512 characters, and at most 5 contacts. Over any of these it answers400withinvalid_client_metadata, and theerror_descriptionsays which. A client unused for 90 days expires; register again. - Pre-registered clients, for platforms that need a static client. Contact us.
Scopes
Scopes Burokku doesn’t know are dropped. A write with a token that lacks
portfolio.write gets 403 with a WWW-Authenticate header with error="insufficient_scope" and scope="portfolio.read portfolio.write". On the REST API the body is Burokku’s usual error with the code insufficient-scope; on the MCP server it’s {"error": "insufficient_scope"}. Ask the user to connect again with both.
Token lifetimes
- Access tokens last 1 hour.
- Refresh tokens: each refresh returns a new one. Use the newest. The one before it keeps working too, so a client that lost an answer can retry. A refresh token unused for 30 days lapses, and the user connects again.
- A failed refresh returns
invalid_grant, and one that names anotherresourcereturnsinvalid_target. - The user can disconnect an app at any time in Settings → Apps and API, and every token for it stops working.
API keys
Personal API keys are for your own code. Every plan can make them.- Make one in Settings → Apps and API on the web (
app.burokku.app/settings/apps). If your account has a second sign-in step, Burokku asks you to confirm it’s you first. A locked account can’t make one (locked), and you can have up to 10 (too-many). In the mobile app, the same list is under More → Security → Apps and API, where you can see and revoke keys but not make them. - Read-only by default. A key has
portfolio.read, plusportfolio.writeif you choose to let it watch addresses and set alerts when you make it. A write with a read-only key gets403with the codeinsufficient-scope. - Format:
bk_live_followed by 43 characters (32 random bytes, base64url). The prefix makes a leaked key easy to spot. - Shown once. Burokku keeps only a hash of it, so a lost key can’t be shown again: revoke it and make another.
- Each key has a name, its scopes and when it was last used.
- Revoke one in Settings → Apps and API, on the web or in the app. It stops working at once.
403 with the code account-required.