Rocket.Chat

App · 23 actions

Read public channels and messages, manage channels, post replies and react to messages in Rocket.Chat.

Actions

ActionWhat it does
Archive channelArchive a channel.
Create channelCreate a public channel.
Delete channelDelete a channel.
Delete messageDelete a chat message.
Get channelGet the information about the channel.
Get channel historyGet the history of a channel.
Get messageGet a single chat message.
Get userGet information about a user, limited to the details the caller is allowed to view.
Join channelJoin a public channel.
Leave channelLeave a public channel.
List channel membersList all channel users.
List joined channelsList all the channels the authenticated user has joined.
List public channelsList all the channels in the workspace.
List thread messagesGet thread messages.
List usersGet workspace users and the information the caller is allowed to view.
Post messageSend messages to channels or users on your workspace.
React to messageReact or unreact to a chat message.
Rename channelChange the name of a channel.
Set channel announcementSet an announcement for the channel.
Set channel descriptionSet the description for a channel.
Set channel topicSet the topic for a channel.
Unarchive channelUnarchive a channel.
Update messageUpdate a specific message.

Archive channel

Archive a channel.

Inputs

Roomroom_idtextRequired
The channel ID that you want to archive.

Outputs

Result.

dataobject
The complete service response; record and list fields retain their API names.
has_moretrue/false
Whether the API reports another page.
next_cursortext
Pass to the pagination field for the next page, when Has more is true.
Example output
{
  "data": {
    "success": true
  },
  "has_more": false,
  "next_cursor": null
}

Create channel

Create a public channel.

Inputs

NamenametextRequired
The name of the channel.
Membersmemberslist
An array of the users to be added to the channel when it is created.
Read onlyread_onlytrue/false
Set if the channel is read only or not. It is `false` by default.
Exclude selfexclude_selftrue/false
If set to true, the user calling the endpoint is not automatically added as a member of the channel. The default `value` is false.
Custom fieldscustom_fieldsobject
If you have defined custom fields for your workspace, you can provide them in this object parameter. For details, see the Custom Fields document.
Extra dataextra_dataobject
Additional channel settings applied at creation. For more information, see Channels .

Outputs

Result.

dataobject
The complete service response; record and list fields retain their API names.
has_moretrue/false
Whether the API reports another page.
next_cursortext
Pass to the pagination field for the next page, when Has more is true.
Example output
{
  "data": {
    "channel": {
      "_id": "example",
      "_updatedAt": "example",
      "customFields": {},
      "default": false,
      "fname": "example",
      "msgs": 0,
      "name": "example",
      "ro": false,
      "sysMes": false,
      "t": "example",
      "ts": "example",
      "u": {
        "_id": "example",
        "name": "example",
        "username": "example"
      },
      "usersCount": 0
    },
    "success": true
  },
  "has_more": false,
  "next_cursor": null
}

Delete channel

Delete a channel.

Inputs

Roomroom_idtextRequired
Enter the room ID. This parameter is required if no `roomName` is provided.

Outputs

Result.

dataobject
The complete service response; record and list fields retain their API names.
has_moretrue/false
Whether the API reports another page.
next_cursortext
Pass to the pagination field for the next page, when Has more is true.
Example output
{
  "data": {
    "success": true
  },
  "has_more": false,
  "next_cursor": null
}

Delete message

Delete a chat message.

Inputs

Roomroom_idtextRequired
The room ID. Required when deleting by `msgId`.
Msg IDmsg_idtextRequired
The ID of the message to delete. Required together with `roomId`.
As useras_usertrue/false
Should the message be deleted as the user who sent it? It is `false` by default.

Outputs

Result.

dataobject
The complete service response; record and list fields retain their API names.
has_moretrue/false
Whether the API reports another page.
next_cursortext
Pass to the pagination field for the next page, when Has more is true.
Example output
{
  "data": {
    "_id": "example",
    "message": {
      "_id": "example",
      "rid": "example",
      "u": {
        "_id": "example",
        "name": "example",
        "username": "example"
      }
    },
    "success": true,
    "ts": "example"
  },
  "has_more": false,
  "next_cursor": null
}

Get channel

Get the information about the channel.

Inputs

Roomroom_idtextRequired
The room ID. It is required if the `roomName` is not provided.

Outputs

Result.

dataobject
The complete service response; record and list fields retain their API names.
has_moretrue/false
Whether the API reports another page.
next_cursortext
Pass to the pagination field for the next page, when Has more is true.
Example output
{
  "data": {
    "channel": {
      "_id": "example",
      "_updatedAt": "example",
      "broadcast": false,
      "customFields": {},
      "default": false,
      "encrypted": false,
      "fname": "example",
      "lastMessage": {
        "_id": "example",
        "_updatedAt": "example",
        "channels": [],
        "md": [],
        "mentions": [],
        "msg": "example",
        "rid": "example",
        "ts": "example",
        "u": {
          "_id": "example",
          "name": "example",
          "username": "example"
        },
        "urls": []
      },
      "lm": "example",
      "msgs": 0,
      "name": "example",
      "ro": false,
      "sysMes": false,
      "t": "example",
      "topic": "example",
      "ts": "example",
      "u": {
        "_id": "example",
        "username": "example"
      },
      "usersCount": 0
    },
    "success": true
  },
  "has_more": false,
  "next_cursor": null
}

Get channel history

Get the history of a channel.

Inputs

Roomroom_idtextRequired
The room ID. It is required if the `roomName` is not provided.
Sortsortobject
List of fields to order by, and in which direction. This is a JSON object, with properties listed in desired order, with values of 1 for ascending, or -1 for descending. For example, {"value": -1, "_id": 1}. Refer to the official documentation to learn more.
Countcountnumber
The number of items to return. Refer to the official documentation to learn more.At least 1.
Offsetoffsetnumber
Number of items to "skip" in the query, i.e. requests return count items, skipping the first offset items. Refer to the official documentation to learn more.
Latestlatestdate and time
The end of time range of messages to retrieve. The default value is the current date and time.
Oldestoldestdate and time
The start of the time range of messages to retrieve
Inclusiveinclusivetrue/false
Whether messages which land on the latest and oldest dates should be included. The default value is false.
Show thread messagesshow_thread_messagestrue/false
Whether thread messages should be included in the response
Unreadsunreadstrue/false
Whether the number of unread messages should be included. The default value is false.

Outputs

Result.

dataobject
The complete service response; record and list fields retain their API names.
has_moretrue/false
Whether the API reports another page.
next_cursortext
Pass to the pagination field for the next page, when Has more is true.
Example output
{
  "data": {
    "count": 0,
    "files": [],
    "offset": 0,
    "success": true,
    "total": 0
  },
  "has_more": false,
  "next_cursor": null
}

Get message

Get a single chat message.

Inputs

Msg IDmsg_idtextRequired
The message ID.

Outputs

Result.

dataobject
The complete service response; record and list fields retain their API names.
has_moretrue/false
Whether the API reports another page.
next_cursortext
Pass to the pagination field for the next page, when Has more is true.
Example output
{
  "data": {
    "message": {
      "_id": "example",
      "_updatedAt": "example",
      "alias": "example",
      "channels": [],
      "groupable": false,
      "mentions": [],
      "msg": "example",
      "reactions": {
        ":frowning2:": {
          "usernames": []
        }
      },
      "rid": "example",
      "starred": {
        "_id": "example"
      },
      "t": "example",
      "ts": "example",
      "u": {
        "_id": "example",
        "name": "example",
        "username": "example"
      }
    },
    "success": true
  },
  "has_more": false,
  "next_cursor": null
}

Get user

Get information about a user, limited to the details the caller is allowed to view.

Inputs

Target usertarget_user_idtextRequired
The `userId` of the user. Alternatively, you can use `username`, `importId`, `email`, or `freeSwitchExtension` to retrieve user information.
Include user roomsinclude_user_roomstext
Whether to include the list of rooms the user is a member of.

Outputs

Result.

dataobject
The complete service response; record and list fields retain their API names.
has_moretrue/false
Whether the API reports another page.
next_cursortext
Pass to the pagination field for the next page, when Has more is true.
Example output
{
  "data": {
    "success": true,
    "user": {
      "_id": "example",
      "active": false,
      "canViewAllInfo": false,
      "createdAt": "example",
      "emails": [],
      "freeSwitchExtension": "example",
      "lastLogin": "example",
      "name": "example",
      "requirePasswordChange": false,
      "roles": [],
      "status": "example",
      "statusConnection": "example",
      "type": "example",
      "username": "example",
      "utcOffset": 0
    }
  },
  "has_more": false,
  "next_cursor": null
}

Join channel

Join a public channel.

Inputs

Roomroom_idtextRequired
The channel ID.
Join codejoin_codetext
The join code of the room. Channels can be password-protected. In that case, users must enter the password for access. See Channel information for details. The join code isn't needed if the user has the `join-without-join-code` permission.

Outputs

Result.

dataobject
The complete service response; record and list fields retain their API names.
has_moretrue/false
Whether the API reports another page.
next_cursortext
Pass to the pagination field for the next page, when Has more is true.
Example output
{
  "data": {
    "channel": {
      "_id": "example",
      "_updatedAt": "example",
      "broadcast": false,
      "customFields": {},
      "default": false,
      "encrypted": false,
      "fname": "example",
      "lastMessage": {
        "_id": "example",
        "_updatedAt": "example",
        "channels": [],
        "md": [],
        "mentions": [],
        "msg": "example",
        "rid": "example",
        "ts": "example",
        "u": {
          "_id": "example",
          "name": "example",
          "username": "example"
        },
        "urls": []
      },
      "lm": "example",
      "msgs": 0,
      "name": "example",
      "ro": false,
      "sysMes": false,
      "t": "example",
      "topic": "example",
      "ts": "example",
      "u": {
        "_id": "example",
        "username": "example"
      },
      "usersCount": 0
    },
    "success": true
  },
  "has_more": false,
  "next_cursor": null
}

Leave channel

Leave a public channel.

Inputs

Roomroom_idtextRequired
The channel ID that you want to leave.

Outputs

Result.

dataobject
The complete service response; record and list fields retain their API names.
has_moretrue/false
Whether the API reports another page.
next_cursortext
Pass to the pagination field for the next page, when Has more is true.
Example output
{
  "data": {
    "channel": {
      "_id": "example",
      "_updatedAt": "example",
      "msgs": 0,
      "name": "example",
      "ro": false,
      "sysMes": false,
      "t": "example",
      "ts": "example",
      "u": {
        "_id": "example",
        "username": "example"
      },
      "usernames": []
    },
    "success": true
  },
  "has_more": false,
  "next_cursor": null
}

List channel members

List all channel users. Gets one page; to see more, run it again with the next page it gives.

Inputs

Roomroom_idtextRequired
The room ID. It is required if the `roomName` is not provided.
Statusstatuslist
The user's status (search filter).
Filterfiltertext
Extra search filters to be applied to the fields defined in the `Accounts_SearchFields`setting.
Sortsortobject
List of fields to order by, and in which direction. This is a JSON object, with properties listed in desired order, with values of 1 for ascending, or -1 for descending. For example, {"value": -1, "_id": 1}. Refer to the official documentation to learn more.
Countcountnumber
The number of items to return. Refer to the official documentation to learn more.At least 1.
Offsetoffsetnumber
Number of items to "skip" in the query, i.e. requests return count items, skipping the first offset items. Refer to the official documentation to learn more.

Outputs

Result.

dataobject
The complete service response; record and list fields retain their API names.
has_moretrue/false
Whether the API reports another page.
next_cursortext
Pass to the pagination field for the next page, when Has more is true.
Example output
{
  "data": {
    "count": 0,
    "members": [],
    "offset": 0,
    "success": true,
    "total": 0
  },
  "has_more": false,
  "next_cursor": null
}

List joined channels

List all the channels the authenticated user has joined. Gets one page; to see more, run it again with the next page it gives.

Inputs

Offsetoffsetnumber
Number of items to "skip" in the query, i.e. requests return count items, skipping the first offset items. Refer to the official documentation to learn more.
Countcountnumber
The number of items to return. Refer to the official documentation to learn more.At least 1.
Sortsortobject
List of fields to order by, and in which direction. This is a JSON object, with properties listed in desired order, with values of 1 for ascending, or -1 for descending. For example, {"value": -1, "_id": 1}. Refer to the official documentation to learn more.
Queryqueryobject
This parameter allows you to use MongoDB query operators to search for specific data. For example, to query users with a name that contains the letter "g": `query={ "name": { "$regex": "g" } }`. Refer to the official documentation to learn more.
Fieldsfieldsobject
This parameter accepts a JSON object with properties that have a value of 1 or 0 to include or exclude them in the response. For example, to only retrieve the usernames of users: `fields={ "username": 1 }`. Refer to the official documentation to learn more.

Outputs

Result.

dataobject
The complete service response; record and list fields retain their API names.
has_moretrue/false
Whether the API reports another page.
next_cursortext
Pass to the pagination field for the next page, when Has more is true.
Example output
{
  "data": {
    "channels": [],
    "count": 0,
    "offset": 0,
    "success": true,
    "total": 0
  },
  "has_more": false,
  "next_cursor": null
}

List public channels

List all the channels in the workspace. Gets one page; to see more, run it again with the next page it gives.

Inputs

Offsetoffsetnumber
Number of items to "skip" in the query, i.e. requests return count items, skipping the first offset items. Refer to the official documentation to learn more.
Countcountnumber
The number of items to return. Refer to the official documentation to learn more.At least 1.
Queryqueryobject
This parameter allows you to use MongoDB query operators to search for specific data. For example, to query users with a name that contains the letter "g": `query={ "name": { "$regex": "g" } }`. Refer to the official documentation to learn more.
Fieldsfieldsobject
This parameter accepts a JSON object with properties that have a value of 1 or 0 to include or exclude them in the response. For example, to only retrieve the usernames of users: `fields={ "username": 1 }`. Refer to the official documentation to learn more.
Sortsortobject
Sort the channels in ascending (`1`) or descending (`-1`) order. The value must be entered as a JSON object. The options are as follows: * `name`: Sort by the channel name. For example, `sort={"name":1}` (this is the default sorting mechanism). * `ts`: Sort by channel creation timestamp. For example, `sort={"ts":-1}` * `usersCount`: Sort by the number of users in the channel. For example, `sort={"usersCount":1}`

Outputs

Result.

dataobject
The complete service response; record and list fields retain their API names.
has_moretrue/false
Whether the API reports another page.
next_cursortext
Pass to the pagination field for the next page, when Has more is true.
Example output
{
  "data": {
    "channels": [],
    "count": 0,
    "offset": 0,
    "success": true,
    "total": 0
  },
  "has_more": false,
  "next_cursor": null
}

List thread messages

Get thread messages. Gets one page; to see more, run it again with the next page it gives.

Inputs

Offsetoffsetnumber
Number of items to "skip" in the query, i.e. requests return count items, skipping the first offset items. Refer to the official documentation to learn more.
Countcountnumber
The number of items to return. Refer to the official documentation to learn more.At least 1.
Sortsortobject
List of fields to order by, and in which direction. This is a JSON object, with properties listed in desired order, with values of 1 for ascending, or -1 for descending. For example, {"value": -1, "_id": 1}. Refer to the official documentation to learn more.
Queryqueryobject
This parameter allows you to use MongoDB query operators to search for specific data. For example, to query users with a name that contains the letter "g": `query={ "name": { "$regex": "g" } }`. Refer to the official documentation to learn more.
Fieldsfieldsobject
This parameter accepts a JSON object with properties that have a value of 1 or 0 to include or exclude them in the response. For example, to only retrieve the usernames of users: `fields={ "username": 1 }`. Refer to the official documentation to learn more.
TmidtmidtextRequired
The thread message ID.
Around IDaround_idtext
The ID of the thread's main message or one of its replies. The endpoint returns a page of replies surrounding this message. When you provide this parameter, the server calculates the page offset and ignores the requested `offset` value. The message must belong to the thread specified by `tmid`.

Outputs

Result.

dataobject
The complete service response; record and list fields retain their API names.
has_moretrue/false
Whether the API reports another page.
next_cursortext
Pass to the pagination field for the next page, when Has more is true.
Example output
{
  "data": {
    "count": 0,
    "messages": [],
    "offset": 0,
    "success": true,
    "total": 0
  },
  "has_more": false,
  "next_cursor": null
}

List users

Get workspace users and the information the caller is allowed to view. Gets one page; to see more, run it again with the next page it gives.

Inputs

Queryqueryobject
This parameter allows you to use MongoDB query operators to search for specific data. For example, to query users with a name that contains the letter "g": `query={ "name": { "$regex": "g" } }`. Refer to the official documentation to learn more.
Fieldsfieldsobject
This parameter accepts a JSON object with properties that have a value of 1 or 0 to include or exclude them in the response. For example, to only retrieve the usernames of users: `fields={ "username": 1 }`. Refer to the official documentation to learn more.
Offsetoffsetnumber
Number of items to "skip" in the query, i.e. requests return count items, skipping the first offset items. Refer to the official documentation to learn more.
Countcountnumber
The number of items to return. Refer to the official documentation to learn more.At least 1.
Sortsortobject
Sort the users in ascending (`1`) or descending (`-1`) order. The value must be entered as a JSON string. The options are as follows: * `status`: Sort by users' status. For example, `sort={"status":1}` (this maps to the `active` status). * `createdAt`: Sort by the time of user creation. For example, `sort={"createdAt":-1}` * `name`: Sort by user name. For example, `sort={"name":1}`
Emailemailtext
Filter users by email address. Minimum length: 1 character.

Outputs

Result.

dataobject
The complete service response; record and list fields retain their API names.
has_moretrue/false
Whether the API reports another page.
next_cursortext
Pass to the pagination field for the next page, when Has more is true.
Example output
{
  "data": {
    "count": 0,
    "offset": 0,
    "success": true,
    "total": 0,
    "users": []
  },
  "has_more": false,
  "next_cursor": null
}

Post message

Send messages to channels or users on your workspace.

Inputs

Aliasaliastext
This will cause the message's name to appear as the given alias, but your username will still be displayed.
Avataravatartext
If provided, the avatar will be displayed as the provided image URL.
Emojiemojitext
If provided, the avatar will be displayed as an emoji.
Roomroom_idtextRequired
The room ID or an array of room IDs where the message is to be sent. You can use channel name or username. The channel name must have the `#` prefix. `@` refers to username.
TexttexttextRequired
The message text to send, it is optional because of attachments.
Parse URLSparse_urlstrue/false
Set `parseUrls` to `false` to prevent Rocket.Chat from generating link previews when the message in `text` contains a URL.
Attachmentsattachmentslist
Attachments.
Tmidtmidtext
The message ID of the original message to reply to or to create a thread on.
Custom fieldscustom_fieldsobject
You can add custom fields for messages. For example, set priorities for messages. You must enable this option and define the validation in the workspace settings. See the Message settings for further information.

Outputs

Result.

dataobject
The complete service response; record and list fields retain their API names.
has_moretrue/false
Whether the API reports another page.
next_cursortext
Pass to the pagination field for the next page, when Has more is true.
Example output
{
  "data": {
    "channel": "example",
    "message": {
      "_id": "example",
      "_updatedAt": "example",
      "alias": "example",
      "groupable": false,
      "msg": "example",
      "parseUrls": false,
      "rid": "example",
      "ts": "example",
      "u": {
        "_id": "example",
        "username": "example"
      }
    },
    "success": true,
    "ts": 0
  },
  "has_more": false,
  "next_cursor": null
}

React to message

React or unreact to a chat message.

Inputs

Message IDmessage_idtextRequired
The message ID to react to.
EmojiemojitextRequired
The emoji to react with. It's required if you aren't using the `reaction` parameter.
Should reactshould_reacttrue/false
Boolean to specify if the reaction should be added or removed.

Outputs

Result.

dataobject
The complete service response; record and list fields retain their API names.
has_moretrue/false
Whether the API reports another page.
next_cursortext
Pass to the pagination field for the next page, when Has more is true.
Example output
{
  "data": {
    "success": true
  },
  "has_more": false,
  "next_cursor": null
}

Rename channel

Change the name of a channel.

Inputs

Roomroom_idtextRequired
The channel's ID.
NamenametextRequired
The new name of the channel. It can not be the same as the current name.

Outputs

Result.

dataobject
The complete service response; record and list fields retain their API names.
has_moretrue/false
Whether the API reports another page.
next_cursortext
Pass to the pagination field for the next page, when Has more is true.
Example output
{
  "data": {
    "channel": {
      "_id": "example",
      "_updatedAt": "example",
      "msgs": 0,
      "name": "example",
      "ro": false,
      "sysMes": false,
      "t": "example",
      "ts": "example",
      "u": {
        "_id": "example",
        "username": "example"
      },
      "usernames": []
    },
    "success": true
  },
  "has_more": false,
  "next_cursor": null
}

Set channel announcement

Set an announcement for the channel.

Inputs

Roomroom_idtextRequired
The channel's id
AnnouncementannouncementtextRequired
The announcement to set for the channel.

Outputs

Result.

dataobject
The complete service response; record and list fields retain their API names.
has_moretrue/false
Whether the API reports another page.
next_cursortext
Pass to the pagination field for the next page, when Has more is true.
Example output
{
  "data": {
    "announcement": "example",
    "success": true
  },
  "has_more": false,
  "next_cursor": null
}

Set channel description

Set the description for a channel.

Inputs

Roomroom_idtextRequired
The channel ID.
DescriptiondescriptiontextRequired
The description to set for the channel.

Outputs

Result.

dataobject
The complete service response; record and list fields retain their API names.
has_moretrue/false
Whether the API reports another page.
next_cursortext
Pass to the pagination field for the next page, when Has more is true.
Example output
{
  "data": {
    "description": "example",
    "success": true
  },
  "has_more": false,
  "next_cursor": null
}

Set channel topic

Set the topic for a channel.

Inputs

Roomroom_idtextRequired
The channel's ID.
TopictopictextRequired
The channel's topic

Outputs

Result.

dataobject
The complete service response; record and list fields retain their API names.
has_moretrue/false
Whether the API reports another page.
next_cursortext
Pass to the pagination field for the next page, when Has more is true.
Example output
{
  "data": {
    "success": true,
    "topic": "example"
  },
  "has_more": false,
  "next_cursor": null
}

Unarchive channel

Unarchive a channel.

Inputs

Roomroom_idtextRequired
The channel ID that you want to unarchive.

Outputs

Result.

dataobject
The complete service response; record and list fields retain their API names.
has_moretrue/false
Whether the API reports another page.
next_cursortext
Pass to the pagination field for the next page, when Has more is true.
Example output
{
  "data": {
    "success": true
  },
  "has_more": false,
  "next_cursor": null
}

Update message

Update a specific message.

Inputs

Roomroom_idtextRequired
The room ID where the message is.
Msg IDmsg_idtextRequired
The message ID to update.
TexttexttextRequired
Updated text for the message.
Preview URLSpreview_urlslist
An array to define which URL previews should be retrieved from each message.
Custom fieldscustom_fieldsobject
You can add custom fields for messages. For example, set priorities for messages. You must enable this option and define the validation in the workspace settings. See the Message settings for further information.

Outputs

Result.

dataobject
The complete service response; record and list fields retain their API names.
has_moretrue/false
Whether the API reports another page.
next_cursortext
Pass to the pagination field for the next page, when Has more is true.
Example output
{
  "data": {
    "message": {
      "_id": "example",
      "_updatedAt": "example",
      "channels": [],
      "editedAt": "example",
      "editedBy": {
        "_id": "example",
        "username": "example"
      },
      "md": [],
      "mentions": [],
      "msg": "example",
      "rid": "example",
      "ts": "example",
      "u": {
        "_id": "example",
        "name": "example",
        "username": "example"
      },
      "urls": []
    },
    "success": true
  },
  "has_more": false,
  "next_cursor": null
}

On this page