# Programmatically retrieve master token

**URL:** <https://community.sendbird.com/t/programmatically-retrieve-master-token/10784>\
**Category:** API\
**Tags:** platform, master-api-token\
**Created:** [March 12, 2025, 7:16pm UTC](https://community.sendbird.com/t/programmatically-retrieve-master-token/10784 "2025-03-12T19:16:49Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![duyvo\_essos](https://sea2.discourse-cdn.com/flex020/user_avatar/community.sendbird.com/duyvo_essos/32/5783_2.png) [@duyvo\_essos](https://community.sendbird.com/u/duyvo_essos)\
**Post date:** [March 12, 2025, 7:16pm UTC](https://community.sendbird.com/t/programmatically-retrieve-master-token/10784/1 "2025-03-12T19:16:49Z")

</div>

**[Problem/Question]**  
Our workflow is that everytime a health clinic signs up on our platform, we create a Sendbird application for them. We then allow patients to chat with the clinics.

1. In order to create a channel, we need to supply an API token.
2. I want to use a secondary token to generate the channel.
3. In order for me to programmatically generate a secondary token, I need the primary token.
4. How do I programmatically retrieve the primary token so that I can generate the secondary token?

* * *

// If problem, please fill out the below. If question, please delete.  
**[SDK Version]**  
// What version of the SDK are you using?

**[Reproduction Steps]**  
// Please provide reproduction steps and, if possible, code snippets.

**[Frequency]**  
// How frequently is this issue occurring?

**[Current impact]**  
// How is this currently impacting your implementation?

---

<div class="post-metadata">

**Author:** ![Tyler](https://sea2.discourse-cdn.com/flex020/user_avatar/community.sendbird.com/tyler/32/810_2.png) [@Tyler](https://community.sendbird.com/u/Tyler)\
**Post date:** [March 13, 2025, 12:28am UTC](https://community.sendbird.com/t/programmatically-retrieve-master-token/10784/2 "2025-03-13T00:28:57Z")

</div>

Hello @duyvo_essos,

Welcome to the Sendbird Community!

When you create the application via the Organization API, you will receive the master token in the response: [https://sendbird.com/docs/chat/platform-api/v3/organization/managing-application/create-an-application](https://sendbird.com/docs/chat/platform-api/v3/organization/managing-application/create-an-application)
