• Example searches: “transaction”, “CreateOrder”, “/v2/locations”, “inventory”, “delete customer”

You are viewing an old version of the API
Revoke token

Revokes an access token generated with the OAuth flow.

If an account has more than one OAuth access token for your application, this endpoint revokes all of them, regardless of which token you specify. When an OAuth access token is revoked, all of the active subscriptions associated with that OAuth token are canceled immediately.

Important: The Authorization header for this endpoint must have the following format:

Authorization: Client APPLICATION_SECRET

Replace APPLICATION_SECRET with the application secret on the Credentials page in the application dashboard.


Request Body

Name Description
client_id
string

The Square issued ID for your application, available from the application dashboard.

access_token
string

The access token of the merchant whose token you want to revoke. Do not provide a value for merchant_id if you provide this parameter.

merchant_id
string

The ID of the merchant whose token you want to revoke. Do not provide a value for access_token if you provide this parameter.

revoke_only_access_token
boolean

If true, terminate the given single access token, but do not terminate the entire authorization. Default: false

Response Fields

Name Description
success
boolean

If the request is successful, this is true.

Examples

You are viewing an old version of the API
POST /oauth2/revoke
cURL
  • cURL
  • Ruby
  • Python
  • C#
  • Java
  • PHP
curl https://connect.squareup.com/oauth2/revoke \
  -X POST \
  -H 'Square-Version: 2020-06-25' \
  -H 'Authorization: Client APPLICATION_SECRET' \
  -H 'Content-Type: application/json' \
  -d '{
    "access_token": "ACCESS_TOKEN",
    "client_id": "CLIENT_ID"
  }'
Response JSON
{
  "success": true
}

Share Feedback

Thanks for visiting the Square API documentation. What's on your mind?