---
agentTools:
  projectIndex: https://docs.developer.yelp.com/llms.txt
---

# Revoke Access Token

Revoke a given token.

[block:callout]
{
  "type": "info",
  "body": "This endpoint is part of the OAuth Authorization flow, visit [OAuth Authorization](https://docs.developer.yelp.com/docs/oauth-authorization) to learn more."
}
[/block]

# OpenAPI definition

```json
{
  "openapi": "3.1.0",
  "info": {
    "title": "OAuth Authorization v2",
    "version": "1.0"
  },
  "servers": [
    {
      "url": "https://api.yelp.com/oauth2"
    }
  ],
  "components": {
    "schemas": {
      "client_id": {
        "type": "string",
        "description": "ID assigned by Yelp for the third-party system that will make user-authorized requests to Yelp."
      },
      "client_secret": {
        "type": "string",
        "description": "Client secret assigned by Yelp for the third-party system that will make user-authorized requests to Yelp.",
        "maxLength": 64,
        "minLength": 64
      },
      "token": {
        "type": "string",
        "maxLength": 128,
        "minLength": 128,
        "pattern": "[A-Za-z0-9+/=]+"
      },
      "Error400": {
        "description": "Bad Request",
        "content": {
          "application/json": {
            "examples": {
              "INVALID_REQUEST": {
                "value": {
                  "error": {
                    "code": "INVALID_REQUEST",
                    "description": "'refresh_token' parameter not specified"
                  }
                }
              },
              "INVALID_GRANT": {
                "value": {
                  "error": {
                    "code": "INVALID_GRANT",
                    "description": "The grant type you provided is invalid, expired or revoked."
                  }
                }
              },
              "UNSUPPORTED_GRANT_TYPE": {
                "value": {
                  "error": {
                    "code": "UNSUPPORTED_GRANT_TYPE",
                    "description": "The authenticated client is not authorized to use this authorization grant type."
                  }
                }
              },
              "BAD_CLIENT_ID_OR_SECRET": {
                "value": {
                  "error": {
                    "code": "BAD_CLIENT_ID_OR_SECRET",
                    "description": "Invalid combination of client_id and client_secret."
                  }
                }
              },
              "UNAUTHORIZED_CLIENT": {
                "value": {
                  "error": {
                    "code": "UNAUTHORIZED_CLIENT",
                    "description": "Specified client is not authorized."
                  }
                }
              }
            },
            "schema": {
              "type": "object",
              "properties": {
                "error": {
                  "type": "object",
                  "required": [
                    "code",
                    "description"
                  ],
                  "properties": {
                    "code": {
                      "type": "string",
                      "description": "The error code."
                    },
                    "description": {
                      "type": "string",
                      "description": "The description of the error."
                    }
                  }
                }
              }
            }
          }
        }
      }
    }
  },
  "paths": {
    "/token": {
      "post": {
        "tags": [
          "OAuth Authorization v2"
        ],
        "summary": "Get Access Token v2",
        "description": "Either:\n  1) Exchanges an authorization_code for an access_token, or\n  2) Exchanges a refresh_token for an access_token.\nSee [Refresh Tokens](https://docs.developer.yelp.com/docs/refresh-tokens) for how this works\n",
        "operationId": "oauth2_token",
        "requestBody": {
          "required": true,
          "content": {
            "application/x-www-form-urlencoded": {
              "schema": {
                "oneOf": [
                  {
                    "$ref": "#/components/schemas/TokenAuthorizationCodeRequest"
                  },
                  {
                    "$ref": "#/components/schemas/TokenRefreshTokenRequest"
                  }
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Token issued",
            "content": {
              "application/json": {
                "schema": {
                  "oneOf": [
                    {
                      "$ref": "#/components/schemas/TokenAuthorizationCodeResponse"
                    },
                    {
                      "$ref": "#/components/schemas/TokenRefreshTokenResponse"
                    }
                  ]
                },
                "examples": {
                  "Authorization Code Example": {
                    "$ref": "#/components/examples/TokenAuthorizationCodeResponse"
                  },
                  "Refresh Token Example": {
                    "$ref": "#/components/examples/TokenRefreshTokenResponse"
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/schemas/Error400"
          },
          "429": {
            "description": "You have either exceeded your daily quota, or have exceeded the queries-per-second limit for this endpoint. Try reducing the rate at which you make queries.",
            "content": {
              "application/json": {
                "examples": {
                  "Rate limited": {
                    "value": {
                      "error": {
                        "code": "TOO_MANY_REQUESTS_PER_SECOND",
                        "description": "You have exceeded the queries-per-second limit for this endpoint. Try reducing the rate at which you make queries."
                      }
                    }
                  }
                },
                "schema": {
                  "$ref": "#/components/schemas/Error400/content/application~1json/schema"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": {
                "examples": {
                  "Internal Server Error": {
                    "value": {
                      "error": {
                        "code": "INTERNAL_ERROR",
                        "description": "Something went wrong internally, please try again later."
                      }
                    }
                  }
                },
                "schema": {
                  "$ref": "#/components/schemas/Error400/content/application~1json/schema"
                }
              }
            }
          }
        },
        "deprecated": false
      }
    },
    "/revoke": {
      "post": {
        "tags": [
          "OAuth Authorization v2"
        ],
        "summary": "Revoke Access Token",
        "description": "Revoke a given token.",
        "operationId": "oauth2_revoke",
        "requestBody": {
          "required": true,
          "content": {
            "application/x-www-form-urlencoded": {
              "schema": {
                "type": "object",
                "properties": {
                  "client_id": {
                    "$ref": "#/components/schemas/client_id"
                  },
                  "client_secret": {
                    "$ref": "#/components/schemas/client_secret"
                  },
                  "token": {
                    "$ref": "#/components/schemas/token",
                    "description": "The access token to revoke."
                  },
                  "token_type_hint": {
                    "description": "Token type identifier, optional.",
                    "enum": [
                      "access_token",
                      "refresh_token"
                    ],
                    "type": "string"
                  }
                },
                "required": [
                  "client_id",
                  "client_secret",
                  "token"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "A successful request doesn't return anything",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/schemas/Error400"
          },
          "429": {
            "$ref": "#/paths/~1token/post/responses/429"
          },
          "500": {
            "$ref": "#/paths/~1token/post/responses/500"
          }
        },
        "deprecated": false
      }
    }
  },
  "x-readme": {
    "headers": [],
    "explorer-enabled": true,
    "proxy-enabled": false,
    "samples-enabled": true
  },
  "_id": {
    "buffer": {
      "0": 99,
      "1": 99,
      "2": 204,
      "3": 161,
      "4": 63,
      "5": 102,
      "6": 197,
      "7": 2,
      "8": 143,
      "9": 171,
      "10": 31,
      "11": 103
    }
  }
}
```