# Send, edit, and delete messages Chabots can send, edit, and delete chatbot messages. If you simply want to send a message to a user or channel without building a Chatbot, use [incoming webhooks](/docs/chat/send-edit-and-delete-messages/#send-messages-via-incoming-webhooks). ## Send messages To send a Chatbot message make a `POST` request to `/im/chat/messages` with your chatbot bearer token and the following request body: | Key | Necessity | Type | Value | | --------------------- | -------------------------------------------------------------------------------- | --------- | ------------------------------------------------------------------------------------------------------------------------ | | `robot_jid` | Required | `string` | Your [Bot JID](/docs/chat/create/#bot-jid) found in the app build flow -> Features -> Surface -> Zoom Chat Subscription. | | `account_id` | Required | `string` | The account ID of the account that you want to send the message to. | | `to_jid` | Required | `string` | The user JID or channel JID of the user or channel that you want to send the message to. | | `content` | Required | `object` | Your [Chatbot message card](/docs/chat/customizing-messages/). | | `visible_to_user` | [Admin-managed only](/docs/chat/create/#admin-managed-vs-user-managed), Optional | `string` | The user ID of a user if you only want that specific user to see the message in a channel. | | `user_jid` | [User-managed only](/docs/chat/create/#admin-managed-vs-user-managed), Required | `string` | The user JID of the user who has authorized the app and who you want to see the message. | | `is_markdown_support` | Optional | `boolean` | If you are using [Markdown Chatbot message card types](/docs/chat/customizing-messages/markdown/). | | `reply_to` | Optional | `string` | You can use the parent message's ID to thread the reply. | ### Example request ```plaintext POST https://api.zoom.us/v2/im/chat/messages ``` Request header: ```json { "Authorization": "Bearer " } ``` Request body: ```json { "robot_jid": "Wk9PTV9ST0JPVF9KSUQ@xmpp.zoom.us", "to_jid": "Wk9PTV9VU0VSX0lE@xmpp.zoom.us", "account_id": "Wk9PTV9BQ0NPVU5UX0lE", "content": { "head": { "text": "Hello World" } } } ``` If successful, the response body is a JSON representation of your Chatbot message: ```json { "message_id": "Wk9PTV9NRVNTQUdFX0lE", "robot_jid": "Wk9PTV9ST0JPVF9KSUQ@xmpp.zoom.us", "sent_time": "2019-06-17 17:08:55", "to_jid": "Wk9PTV9VU0VSX0lE@xmpp.zoom.us" } ``` Chatbot message ![Chatbot Message](/img/1579043762366.png) --- ## Edit messages To edit a Chatbot message make a `PUT` request to `/im/chat/messages/MESSAGE_ID` with your chatbot bearer token and the following request body: | Key | Necessity | Type | Value | | --------------------- | -------------------------------------------------------------------------------- | --------- | ------------------------------------------------------------------------------------------------------------------------ | | `robot_jid` | Required | `string` | Your [Bot JID](/docs/chat/create/#bot-jid) found in the app build flow -> Features -> Surface -> Zoom Chat Subscription. | | `account_id` | Required | `string` | The account ID of the account that you want to send the message to. | | `to_jid` | Required | `string` | The user JID or channel JID of the user or channel that you want to send the message to. | | `content` | Required | `object` | Your [Chatbot message card](/docs/chat/customizing-messages/). | | `visible_to_user` | [Admin-managed only](/docs/chat/create/#admin-managed-vs-user-managed), Optional | `string` | The user ID of a user if you only want that specific user to see the message in a channel. | | `user_jid` | [User-managed only](/docs/chat/create/#admin-managed-vs-user-managed), Required | `string` | The user JID of the user who has authorized the app and who you want to see the message. | | `is_markdown_support` | Optional | `boolean` | If you are using [Markdown Chatbot message card types](/docs/chat/customizing-messages/markdown/). | ### Example Request ```plaintext PUT https://api.zoom.us/v2/im/chat/messages/Wk9PTV9NRVNTQUdFX0lE ``` Request header: ```json { "Authorization": "Bearer " } ``` Request body: ```json { "robot_jid": "Wk9PTV9ST0JPVF9KSUQ@xmpp.zoom.us", "to_jid": "Wk9PTV9VU0VSX0lE@xmpp.zoom.us", "account_id": "Wk9PTV9BQ0NPVU5UX0lE", "content": { "head": { "text": "Aloha World" } } } ``` If successful, the response body is a JSON representation of your edited Chatbot message: ```json { "message_id": "Wk9PTV9NRVNTQUdFX0lE", "robot_jid": "Wk9PTV9ST0JPVF9KSUQ@xmpp.zoom.us", "sent_time": "2019-06-17 17:08:55", "to_jid": "Wk9PTV9VU0VSX0lE@xmpp.zoom.us" } ``` Edited Chatbot message ![Edited Chatbot Message](/img/1579043574836.png) --- ## Delete messages To delete a Chatbot message make a `DELETE` request to `/im/chat/messages/MESSAGE_ID` with your chatbot bearer token and the following query parameters: | Key | Necessity | Type | Value | | ------------ | ------------------------------------------------------------------------------- | -------- | ------------------------------------------------------------------------------------------------------------------------ | | `robot_jid` | Required | `string` | Your [Bot JID](/docs/chat/create/#bot-jid) found in the app build flow -> Features -> Surface -> Zoom Chat Subscription. | | `account_id` | Required | `string` | The account ID of the account that you want to send the message to. | | `user_jid` | [User-managed only](/docs/chat/create/#admin-managed-vs-user-managed), Required | `string` | The user JID of the user who has authorized the app and who you want to see the message. | ### Example request ```plaintext DELETE https://api.zoom.us/v2/im/chat/messages/Wk9PTV9NRVNTQUdFX0lE?robot_jid=Wk9PTV9ST0JPVF9KSUQ@xmpp.zoom.us&account_id=Wk9PTV9BQ0NPVU5UX0lE ``` Request header: ```json { "Authorization": "Bearer " } ``` If successful, the response body is a JSON representation of your deleted Chatbot message: ```json { "message_id": "Wk9PTV9NRVNTQUdFX0lE", "robot_jid": "Wk9PTV9ST0JPVF9KSUQ@xmpp.zoom.us", "sent_time": "2019-06-17 17:08:55", "to_jid": "Wk9PTV9VU0VSX0lE@xmpp.zoom.us" } ``` --- ## Send messages via incoming webhooks Zoom [incoming webhooks](https://support.zoom.com/hc/en/article?id=zm_kb&sysparm_article=KB0067640) are configured outside the Zoom developer portal using the Incoming Webhook chatbot. Zoom incoming webhooks use a static verification token that does not expire, or for more advanced security, a dynamic signature. After installing the [Incoming Webhook chatbot](https://marketplace.zoom.us/apps/eH_dLuquRd-VYcOsNGy-hQ), enter this slash command to generate a URL: `/inc connect NAME` Request URL: ```plaintext POST: https://integrations.zoom.us/chat/webhooks/incomingwebhook/Wk9PTV9JTkNPTUlOR19XRUJIT09LX0lE?format=full ``` Request header: ```json { "Authorization": "Bearer ZOOM_INCOMING_WEBHOOK_TOKEN" } ``` Request body: ```json { "content": { "head": { "text": "I am a header" }, "body": [ { "type": "message", "text": "I am a message with text" } ] } } ``` ![](/img/zoom-incoming-webhook.png) --- ## Getting `to_jid`, `account_id`, and `user_jid` values Here are some tips for getting `to_jid`, `account_id`, and `user_jid` values for easier testing. - The `to_jid`, `account_id`, and `user_jid` (if applicable) are present in the [custom welcome message](/docs/chat/installation-and-authentication/#custom-welcome-message), [slash command](/docs/chat/capabilities/#slash-commands), or [UI element](/docs/chat/capabilities/#ui-elements) webhook events. - Channel JID conventions are: `CHANNEL_ID@conference.xmpp.zoom.us`. - User JID conventions are: `USER_ID@xmpp.zoom.us`. - You can also get the `account_id`, `user_id`, and `channel_id` (if applicable) via: - Your `account_id` is shown in the [server to server app type](/docs/internal-apps/s2s-oauth/) build flow. - Your `user_id` can be found by JWT decoding the chatbot token -> body -> `uid`. - Your `user_id` can be found in the Zoom web portal when you [view a user](https://zoom.us/account/user). - Your `user_id` is returned from the [Get User/s API](/docs/api/users/#tag/users/GET/users). - A `channel_id` can be found by JWT decoding the channel URL's (copy channel URL in the Zoom Client) path -> header -> `sid` - A `channel_id` can be found in the Zoom web portal when you [view a channel](https://zoom.us/account/imchannel). - A `channel_id` is returned from the [Get Channel/s API](/docs/api/chat/#tag/chat-channels-account-level/GET/chat/channels). --- ## JSON payloads for guest users Be aware that guest users (users not signed in to Zoom or who are members of a different account) are assigned temporary IDs that are valid only for the duration of that meeting or chat channel. Data for guest users in JSON payloads is associated with these temporary IDs.