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:

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

  1. Register your application with Yelp to get a client_id and client_secret (see Prerequisites).
  2. 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.
  3. Redeem the code for an access token and a refresh token with Get Access Token v4.
  4. Call the API with the access token in the Authorization: Bearer header.
  5. Refresh the access token when it expires. Each refresh returns a new refresh token, which replaces the old one.
  6. 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 S256 method on every authorization request (RFC 7636).
  • Send an exact redirect_uri. It must use https and exactly match a redirect URI registered for your application.
  • Check iss on 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_secret on 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 400 with the error code TOKEN_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_uri you 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


Did this page help you?