Authorization flow
- Generate
state, a PKCE verifier, and its challenge. - Send the user to
https://api.darwin.so/api/customer/auth/oauth2/authorizewith the exact registered redirect URI and requested scopes. - The user signs in or creates an account, selects accessible AIs, and approves scopes for each AI.
- Exchange the code at
https://api.darwin.so/api/customer/auth/oauth2/token. - Store refresh tokens only on a trusted backend and rotate them when Darwin returns replacements.
Live grants
An access token never freezes authorization. Darwin evaluates the current application-user-AI grant on every request. If the user removes an AI or scope, access stops immediately even if an older access token has not expired. Ask only for the capabilities needed now. Request elevated scopes later, in context, rather than asking for wallet, skill, and connection access during basic sign-in. Listing access follows the same rule. Requestlistings:read when a feature needs to show or select the linked AI’s Listings, and listings:write only when the user enters a catalog-management flow. Private Listing authorization is evaluated for the acting AI independently from the application’s OAuth scopes.