OAuth Authorization
Overview
Access to this feature is reserved for contracted Yelp partners.
To learn more about becoming a partner, visit one of these pages to explore different partnership types:
- business.yelp.com/partners if you're an advertising agency.
- Yelp Insights API, Yelp Places API, or Yelp AI API if you'd like to license our data.
- business.yelp.com/partners/listing-management-partners if you'd like to publish your data on Yelp.
Yelp's OAuth system, which uses a client_id and client_secret, is private and reserved for specific official partnerships. To get set up with access, contact your Yelp relationship manager.
OAuth lets your application act on Yelp on behalf of a business user or a consumer, with their permission. The user signs in on Yelp and approves the permissions (scopes) your application asks for. Yelp then gives your application an access token for that user, which it sends with each API request. Your application never sees the user's Yelp password. Business users and consumers each have their own authorization page and scopes, and an authorization request is for one kind of user only (see Which Authorization Page to Use).
Yelp's OAuth is based on the OAuth 2.0 Authorization Framework (RFC 6749), and new integrations follow OAuth 2.1.
APIs Using OAuth Authorization
For business users:
For consumers:
- Home Services API: read a consumer's projects and conversations, and subscribe to webhooks for their projects.
How It Works
- Register your application with Yelp to get a
client_idandclient_secret(see Prerequisites). - Send the user to Yelp's authorization page with a PKCE code challenge. After they approve, Yelp redirects them back to your application with an authorization code.
- Redeem the code for an access token and a refresh token with Get Access Token v4.
- Call the API with the access token in the
Authorization: Bearerheader. - Refresh the access token when it expires. Each refresh returns a new refresh token, which replaces the old one.
- Revoke the token with Revoke Access Token when the user disconnects your application.
The Authorization Code Workflow guide walks through steps 2 to 4, and the Refresh Tokens guide covers step 5.
Requirements for New Integrations
Every new integration must:
- Use PKCE with the
S256method on every authorization request (RFC 7636). - Send an exact
redirect_uri. It must usehttpsand exactly match a redirect URI registered for your application. - Check
isson the redirect before using the code. It must be the issuer for the authorization page you used, as listed in the Authorization Code Workflow guide (RFC 9207). - Use Get Access Token v4 (
POST https://api.yelp.com/oauth2/token/v4) to redeem codes and refresh tokens. Access tokens last 1 hour and refresh tokens 90 days. - Store the new refresh token after every refresh. The one you sent stops working.
- Keep the
client_secreton your server. Don't put it in a browser, a mobile app or anything else your users can inspect.
Older integrations
Some existing applications still use Get Access Token v2 and v3, and they keep working. If either endpoint returns
400with the error codeTOKEN_V4_REQUIRED, your application must use v4. What still differs for these applications is in Get Access Token v2 and v3.
Prerequisites
Before your application can request an access token, you must register it with Yelp as a client of our OAuth Authorization system. Registration gives you a client_id and a client_secret to use in requests.
Your Yelp relationship manager also needs to:
- Register your redirect URIs. Every
redirect_uriyou send must exactly match one of them. - Enable the scopes your application needs. Only request scopes that are enabled for your application.
Guides
API Reference
- Authorize: the authorization page and its parameters.
- Get Access Token v4: redeem a code or refresh a token.
- Revoke Access Token: revoke a token.
Updated 7 days ago
