Chat API tutorial: Generating an OAuth token (integrated Chat accounts)

Return to top


  • Lev

    hi, i followed the steps in the article and got an access token with no errors :D 

    but I seems cannot use this token to access the Conversation APi, i got invalid scope error, 

    I added a screen shot here for the error of scope 

    also this is how i get the access token 

    when i did this cURL call, I tried with scope = chat / scope= read write, i could get token no problem, but I always end up with same invalid scope error when I try to access the conversation API, 

    Any suggestion is appreciated

    thank you!

  • Remi
    Zendesk Customer Care

    Hi Lev,

    Thank you for your post, hope you are doing well today!

    According to the requests / calls you want to make through the conversation API you will need more than the Chat scope and have to set the scope of the token to readwrite, and chat.

    Please refer to the section Authentication in Chat Conversations API for a better understanding.

    For instance, retrieve the Token with :

    I would also encourage you to have a look at the following documentation : Getting started with the Chat Conversations API, that should point you in the right direction.

    Hope this helps!

    Have a great rest of your day.

    Best regards,

  • Matt Schembri

    I've got an access token generated through "Implicit grant flow" detailed at

    How can my Zendesk support app use this token?

    Is there a clear cut way to get chat data into a zendesk support app?

  • John Espina
    Zendesk Customer Care

    Hi Matt,

    In regards to your concern, you can use OAuth 2 to authenticate all your application's API requests to Zendesk. OAuth provides a secure way for your application to access Zendesk data without having to store and use the passwords of Zendesk users, which is sensitive information.

    Please check this article:

    John Espina | Customer Advocate

  • Petre

    Hi! I've managed to get the access token, using the scopes: read write chat, but I can't start agent session. I get "UNAUTHORIZED" error every time:

    {\"errors\":[{\"UUID\":\"ccd32285-5895-45c4-bec5-6bd27b15f4a2\",\"message\":\"<html>\\r\\n<head><title>500 Internal Server Error</title></head>\\r\\n<body>\\r\\n<center><h1>500 Internal Server Error</h1></center>\\r\\n<hr><center>nginx</center>\\r\\n</body>\\r\\n</html>\\r\\n\",\"name\":\"UNAUTHORIZED\"}],\"data\":null}",


    Can you help me, what am I missing?

  • Chien Dong

    I have the same error

    My access_token used the "read", "write" and "chat" scopes

  • Bom Proapp

    I also get the same error.

  • Cheeny Aban
    Zendesk Customer Care
    Hi Chien and Pakpoom, 

    If you were able to confirm that all the steps have been properly followed and you keep on receiving an error. I would suggest that you initiate a conversation with us and provide the actual replication steps
  • Nicholas Walsh

    Why is the query string returned to my callback URL with a hash (#) instead of a question mark? Everything after # in the URL will be ignored by the server, so redirecting to a backend script means the query string cannot be parsed.

  • Scotty Loewen

    It's worth noting that the request will 400 if you use your full subdomain (, in this instance it's looking just for the "company" part of that. If this article could be edited to make that clearer in the beginning (first reference of subdomain) that would have saved me twenty minutes of troubleshooting today :)

  • Jinen Abdelhak

    Hello whats the expiration period of the bearer token, please  


  • Dane
    Zendesk Engineering
    An access token doesn't expire but it can be revoked.
  • Mateusz Gamroth

    Niall Colfer You're the best! I tried to follow the documentation and it is chaotic and a huge mess. 

    Thanks to your approach I was able to get the token, was trying this for daaaayz!

    Unfortunately could only find this in the Forum, maybe it could be linked to in this documentation?

    Would be a huge help for everyone. Good job on putting this together ♥


Please sign in to leave a comment.

Powered by Zendesk