oauth

Revoke an access token or a refresh token.

If you revoke a refresh token, be aware that:

  • The refresh token's lineage is also revoked. This means that access tokens created from that refresh token are also revoked.
  • The user's consent for your app is also revoked. This means that the user must go through the OAuth process again to use your app.

Requests to this endpoint require authentication with your client ID and client secret, using one of the following methods:

  • Basic access authentication (Recommended): For basic access authentication, the {credentials} string must be a Base64 encoded value of {client id}:{client secret}.
  • Body parameters: Provide your app's credentials using the client_id and client_secret body parameters.

This endpoint can't be called from a user's web-browser client because it uses client authentication with client secrets. Requests must come from your app's backend, otherwise they'll be blocked by Canva's Cross-Origin Resource Sharing (CORS) policy.

post/v1/oauth/revoke

Request

  • Base URL: https://api.canva.com/auth
  • URL: https://api.canva.com/auth/v1/oauth/revoke
  • Auth: one of:
    • none
    • HTTP basic

Request body application/x-www-form-urlencoded

tokenstring required

The token to revoke.

client_idstring

Your app's unique ID, for authenticating the request.

NOTE: We recommend that you use basic access authentication instead of specifying client_id and client_secret as body parameters.

client_secretstring

Your app's client secret, for authenticating the request. Begins with cnvca.

NOTE: We recommend that you use basic access authentication instead of specifying client_id and client_secret as body parameters.

Example request

{
  "token": "agALLazU0i2ld9WW4zTO4kaG0lkvP8Y5sSO206ZwxNF4E1y3xKJKF7TzN17BXTfaNOeY0P88AeRCE6cRF7SJzvf3Sx97rA80sGHtFplFo",
  "client_id": "OC-FAB12-AbCdEf",
  "client_secret": "cnvcaAbcdefg12345_hijklm6789"
}

Response

OK

RevokeTokensResponse required

The response on a successful token revocation.

Changes

    • warning

      added the new user_linked_to_another_idp enum value to the response property for the response status

    • warning

      added the new user_linked_to_another_idp enum value to the response property for the response status

    • warning

      added the new user_linked_to_another_idp enum value to the response property for the response status

    • warning

      added the new asset_not_ready enum value to the response property for the response status

    • warning

      added the new asset_not_ready enum value to the response property for the response status

    • warning

      added the new asset_not_ready enum value to the response property for the response status