POST
/
v2
/
oauth
/
token
curl --request POST \
  --url https://api.whop.com/api/v2/oauth/token \
  --header 'Content-Type: application/json' \
  --data '{
  "client_id": "<string>",
  "client_secret": "<string>",
  "code": "<string>",
  "grant_type": "authorization_code",
  "redirect_uri": "<string>"
}'
{
  "access_token": "<string>"
}

Body

application/json
client_id
string
required

This is your client ID

client_secret
string
required

This is your client secret

code
string
required

This is the code that you received to your OAuth callback as the "code" parameter. Pass it up directly

grant_type
enum<string>
required

This should always be "authorization_code".

Available options:
authorization_code
redirect_uri
string
required

This is your redirect URL. If you are just gating your webapp, this redirect URL will be registered on your developer portal in the Whop Dashboard. If you are building general purpose software, aka an experience, this should be your "{base_url}/{your_hub_path}".

Response

200 - application/json
access_token
string

The token you will use to authenticate your user

Was this page helpful?