Building for your own workspace only? You do not need OAuth. Create an API key under Settings → API keys.
1. Register your app
In LazyApp, open Settings → OAuth apps and click Add app.
You get a client ID. A server app also gets a client secret, shown once. Keep it on your server. If it leaks, click Make new client secret — the old one stops working at once.
Only members who can manage API keys can add apps.
2. Send the user to LazyApp
Generate a randomstate and a PKCE code_verifier, keep both in the user’s session, and redirect the browser to the authorize URL:
3. Exchange the code for tokens
LazyApp redirects back to yourredirect_uri with code and state. Check state matches, then exchange the code from your server:
client_secret. The response:
error=access_denied instead of a code.
4. Call the API
Send the access token exactly like an API key:403 outside them), live access follows the workspace’s plan (402 with plan_limit_reached), and it acts in the workspace and mode the user picked.
Refreshing tokens
Access tokens last one hour. Before one expires, get a new one with the refresh token (refresh tokens last 90 days, and each refresh returns a new one):Scopes
Ask only for what your app needs. These are the API key scopes, except the platform-only ones (customers:write, customers:act), which an OAuth app cannot request:
messages:send, messages:read, templates:read, templates:write, media:write, webhooks:write, flows:write, billing:read, billing:write, connections:write, payments:write, catalog:write.
Separate scopes with spaces in the scope parameter.
When access ends
Your token stops working (401) when:
- someone in the workspace clicks Remove access under Settings → OAuth apps → Apps with access to this workspace;
- the user who connected your app leaves the workspace or can no longer manage API keys;
- the user connects your app again and picks a different workspace — the earlier workspace’s tokens are revoked;
- you delete your app.