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 agents, and approves scopes for each agent.
- 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.