Send the user's browser here to ask them to grant your application access. This is a page the user opens, not an API call.
The user signs in if needed, reviews the permissions, and chooses to continue or cancel. If they continue, Yelp redirects the browser back to your redirect_uri with an authorization code.
Exchange the code at Get Access Token v4 within 5 minutes. A code can be exchanged once.
Use the host that matches the user's account type:
biz.yelp.com/oauth2/authorizefor business users. Request business scopes such asleads.www.yelp.com/oauth2/authorizefor consumers. Request consumer scopes:projectsandproject_actions.
A request can't mix business and consumer scopes, and a scope for the other account type is never granted.
Requirements for new integrations
- PKCE with the
S256method: sendcode_challengeandcode_challenge_method=S256, and send the matchingcode_verifierwhen you exchange the code. redirect_uriis required, must usehttps, and must exactly match a redirect URI registered for your application. Yelp doesn't ignore a trailing slash, match a prefix, or fall back to a default.
Redirect back to your application
The redirect to your redirect_uri adds these query parameters:
code: the authorization code.state: the value you sent, unchanged. Check it matches before you use the code.iss: the issuer,https://api.yelp.com/oauth2/bizif the user approved on the business page orhttps://api.yelp.com/oauth2/consumerif they approved on the consumer page. Check it is the one you expect, as described in RFC 9207.
Errors
When a request is invalid, Yelp doesn't redirect to your redirect_uri and doesn't send an error parameter. The user sees an error page that tells them to contact the application the request came from. The page doesn't say what was wrong, so check these first if a user reports it:
code_challengeis missing, orcode_challenge_methodisn'tS256.redirect_uriis missing, isn'thttps, or isn't an exact match for a registered redirect URI.response_typeisn'tcode.- On
www.yelp.com:scopeis missing, or has a value that is unknown, isn't enabled for your application, or is a business scope, or it mixes business and consumer scopes. - On
biz.yelp.com:scopeincludes a consumer scope that is enabled for your application. A scope that isn't enabled doesn't cause an error here. It's left out of the authorization instead (seescopebelow). client_idis unknown, or the application is disabled.
If the user chooses Cancel, they are sent to yelp.com and your application isn't notified.
| Time | Status | User Agent | |
|---|---|---|---|
Retrieving recent requests… | |||
