Authorize an App
Changed onCompletes the OAuth authorization step for the authenticated user: records their consent to the scopes an app asked for and mints an authorization code. Returns the grant plus a redirect_url carrying the code, which is returned only this once; the app exchanges it at POST /oauth/token. Requires a user session, because consent has to come from the account holder: an API key or an OAuth token is refused, so an app can never authorize itself. Send an Idempotency-Key so a retry returns the original redirect_url and code instead of issuing a second one.
Request
- Base URL: https://api.whop.com/api/v1
- URL: https://api.whop.com/api/v1/users/me/oauth_grants
- Auth: HTTP bearer
Headers
A unique key that makes this request safe to retry. See Idempotent requests.
Request body
Example request
{
"account_id": "biz_xxxxxxxxxxxxxx",
"client_id": "app_xxxxxxxxxxxxxx",
"code_challenge": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
"code_challenge_method": "S256",
"consent_shown": true,
"nonce": "n-0S6_WzA2Mj",
"redirect_uri": "https://Booking.Shinetime.example:8443/oauth/Callback/",
"requested_scopes": [
"profile"
],
"response_type": "code",
"state": "opaque-client-state"
}Response
the app is authorized
Example response
{
"account_id": "biz_xxxxxxxxxxxxxx",
"app_id": "app_xxxxxxxxxxxxxx",
"authorized_at": "2026-01-01T12:00:00.000Z",
"created_at": "2026-01-01T12:00:00.000Z",
"id": "oag_xxxxxxxxxxxxxx",
"redirect_url": "https://Booking.Shinetime.example:8443/oauth/Callback/",
"revoked_at": "2026-01-01T12:00:00.000Z",
"scopes": [
"email"
]
}Changes
- info
added the new optional request property
- info
- info
the request property
became optional - info
the request property
became optional
- info