Skip to main content

rtm.connect method

Welcome to the new home of Slack developer docs!

We're still building and not all features are available quite yet. Enjoy this peek into the future!

Not ready for the future? Return to the past at api.slack.com.

Usage info

This method begins a Real Time Messaging API session and reserves your application a specific URL with which to connect via websocket.

Unlike rtm.start, this method is focused only on connecting to the RTM API.

Use this method in conjunction with other Web API methods like conversations.list, users.list, and team.info to build a full picture of the team or workspace you're connecting on behalf of.

Please consult the RTM API documentation for full details on using the RTM API.

New Slack apps may not use any Real Time Messaging API method.

For most applications, Socket Mode is a better way to communicate with Slack anyway.

Response

This method returns a WebSocket Message Server URL and limited information about the team: The url property contains a WebSocket Message Server URL. Connecting to this URL will initiate a Real Time Messaging session. These URLs are only valid for 30 seconds, so connect quickly!

The self property contains a small amount of information concerning the connecting user — an id and their name.

The team attribute also houses brief information about the team, including its id, name, domain, and if it's part of an Enterprise Grid, the corresponding enterprise_id.