# How do I create a Proactive Chat through the Platform API

**URL:** <https://community.sendbird.com/t/how-do-i-create-a-proactive-chat-through-the-platform-api/2823>\
**Category:** JavaScript\
**Tags:** desk, platform\
**Created:** [August 10, 2021, 4:11pm UTC](https://community.sendbird.com/t/how-do-i-create-a-proactive-chat-through-the-platform-api/2823 "2021-08-10T16:11:35Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![simonb](https://avatars.discourse-cdn.com/v4/letter/s/e19b73/32.png) [@simonb](https://community.sendbird.com/u/simonb)\
**Post date:** [August 10, 2021, 4:11pm UTC](https://community.sendbird.com/t/how-do-i-create-a-proactive-chat-through-the-platform-api/2823/1 "2021-08-10T16:11:36Z")

</div>

Hi,

How do we create a Proactive Chat through the Platform API? We often need to reach out to customers before they write to us. They currently contact us by creating a Ticket.

Thanks  
/Simon

---

<div class="post-metadata">

**Author:** ![simonb](https://avatars.discourse-cdn.com/v4/letter/s/e19b73/32.png) [@simonb](https://community.sendbird.com/u/simonb)\
**Post date:** [August 12, 2021, 9:34am UTC](https://community.sendbird.com/t/how-do-i-create-a-proactive-chat-through-the-platform-api/2823/2 "2021-08-12T09:34:12Z")

</div>

Hi,

@Tyler can you help me with this one?  
I’m also trying to use the Desk API to write a message to a ticket channel, but this seems not possible?  
I cannot assign a ticket to a user through the API either???

Hope someone can help here.

Best,  
/Simon

---

<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:** [August 12, 2021, 12:18pm UTC](https://community.sendbird.com/t/how-do-i-create-a-proactive-chat-through-the-platform-api/2823/3 "2021-08-12T12:18:17Z")

</div>

Hello @simonb,

Currently the Desk Platform API does not support creating proactive chats. It can only be done via the Dashboard.

Additionally, to send a message to the ticket, you’d use the Chat API, as Desk Tickets are really just chat channels with a special custom\_type. So you can grab the channel\_url of the ticket, and use the Chat Platform API to send a message.

---

<div class="post-metadata">

**Author:** ![simonb](https://avatars.discourse-cdn.com/v4/letter/s/e19b73/32.png) [@simonb](https://community.sendbird.com/u/simonb)\
**Post date:** [August 12, 2021, 7:55pm UTC](https://community.sendbird.com/t/how-do-i-create-a-proactive-chat-through-the-platform-api/2823/4 "2021-08-12T19:55:34Z")

</div>

Thanks @Tyler,  
I have tried to do this but when ever I try to send a message in a channel from a agent I get a 400 back.  
I am able to send a message from a User (using users sendbird id) but from an Agent (using the Agents’s Sendbird id)? My assumption was the Agent was not allowed to write because he was not assigned to the ticket and therefore not added to the channel!

/Simon

---

<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:** [August 16, 2021, 12:30pm UTC](https://community.sendbird.com/t/how-do-i-create-a-proactive-chat-through-the-platform-api/2823/5 "2021-08-16T12:30:45Z")

</div>

Hi @simonb,

When you are sending a message as the agent, how are you doing so? What is the 400 error that you get back? You should be able to send via an agent using the agent’s Sendbird ID which typically looks like `sendbird_desk_agent_id_92b970dd-8974-4f6b-bf23-f8803799000d` .
