# How to send a server-to-server chat message

**URL:** <https://devforum.zoom.us/t/how-to-send-a-server-to-server-chat-message/82160>\
**Category:** Chat\
**Tags:** api\
**Created:** [January 26, 2023, 11:56am UTC](https://devforum.zoom.us/t/how-to-send-a-server-to-server-chat-message/82160 "2023-01-26T11:56:50Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Manfred](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/manfred/32/44886_2.png) [@Manfred](https://devforum.zoom.us/u/Manfred)\
**Post date:** [January 26, 2023, 11:56am UTC](https://devforum.zoom.us/t/how-to-send-a-server-to-server-chat-message/82160/1 "2023-01-26T11:56:50Z")

</div>

I have a server application.  
When an event occurs, I want to be able to **send** a chat message to a specific zoom channel.  
On an other event, I want to **update** that message, and finally, I need to  
**delete** that message.  
Is it correct to assume I need a server-to-server app, using OAuth2? (JWT is being depreciated in June )  
I’m running in all kinds of issues like “this API does not support client credentials for authorisation” when POSTing to [https://api.zoom.us/v2/chat/users/{usrerid}/channels](https://api.zoom.us/v2/chat/users/%7Busrerid%7D/channels)  
Your advise is very much appreciated

---

<div class="post-metadata">

**Author:** ![gianni.zoom](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/gianni.zoom/32/32523_2.png) [@gianni.zoom](https://devforum.zoom.us/u/gianni.zoom)\
**Post date:** [January 28, 2023, 12:07am UTC](https://devforum.zoom.us/t/how-to-send-a-server-to-server-chat-message/82160/2 "2023-01-28T00:07:55Z")

</div>

Hi @Manfred ,

You can use a Server-to-Server OAuth app. Check out [this article](https://dev.to/zoom/when-to-use-server-to-server-oauth-app-and-when-to-use-oauth-app--579n) from one of our Developer Advocates to be sure.

Additionally, you may be running into an error because of the endpoint URL.

> [@Manfred](#):
>
> POSTing to [https://api.zoom.us/v2/chat/users/{usrerid}/channels](https://api.zoom.us/v2/chat/users/%7Busrerid%7D/channels)

Here’s the correct one: [https://marketplace.zoom.us/docs/api-reference/chat/methods/#operation/sendaChatMessage](https://marketplace.zoom.us/docs/api-reference/chat/methods/#operation/sendaChatMessage) → `POST /chat/users/{userId}/messages`

---

<div class="post-metadata">

**Author:** ![Manfred](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/manfred/32/44886_2.png) [@Manfred](https://devforum.zoom.us/u/Manfred)\
**Post date:** [January 29, 2023, 11:29am UTC](https://devforum.zoom.us/t/how-to-send-a-server-to-server-chat-message/82160/4 "2023-01-29T11:29:45Z")

</div>

Hi Gianny, thanks for your reply.  
Somehow, the reference to the article of your Developer Advocates doesn’t show up in your post.  
May I assume that {userId} should be filled out with a channel ID if I want to post to a specific channel? How do I obtain that channel id?  
regards  
Manfred

---

<div class="post-metadata">

**Author:** ![gianni.zoom](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/gianni.zoom/32/32523_2.png) [@gianni.zoom](https://devforum.zoom.us/u/gianni.zoom)\
**Post date:** [January 30, 2023, 9:26pm UTC](https://devforum.zoom.us/t/how-to-send-a-server-to-server-chat-message/82160/5 "2023-01-30T21:26:05Z")

</div>

Hi @Manfred ,

> [@Manfred](#):
>
> Somehow, the reference to the article of your Developer Advocates doesn’t show up in your post.

Whoops, I just updated the reply with the link.

> [@Manfred](#):
>
> May I assume that {userId} should be filled out with a channel ID if I want to post to a specific channel?

Yes that is correct! For Account-Level, use [these channel endpoints](https://marketplace.zoom.us/docs/api-reference/chat/methods/#tag/Chat-Channels-(Account-level)). You can also use [this endpoint to find the channels created by a specific user](https://marketplace.zoom.us/docs/api-reference/chat/methods/#operation/getChannels) and see the channel id returned in the response.
