Sample - Slack Web API
GET/rtm.connect

Start a Real Time Messaging session

Triggers a Real Time Messaging session for the authenticated user. Supply the token with the rtm:stream scope and optionally configure presence delivery with batch_presence_aware and presence_sub. The response provides the session URL, team details, and authenticated user's identity.

  • RetriesRetries up to 2×, 500ms backoff, 30s timeout.

3 parameters
tokenstringrequired
Authentication token with the `rtm:stream` scope.
batch_presence_awarebooleanoptional
Enable batched presence deliveries through subscriptions; this changes the shape of `presence_change` events.
presence_subbooleanoptional
Deliver presence events only when requested through a presence subscription.

2 status codes
200Returns the Real Time Messaging session URL, the connected team, and the authenticated user's identifier and name.
okbooleanrequired
Allowed:true
selfobjectrequired
teamobjectrequired
urlstringrequired
defaultTypical error response
callstackstringoptional
Note: PHP callstack is only visible in dev/qa
errorstringrequired
Allowed:not_authedinvalid_authaccount_inactivetoken_revokedno_permissioninvalid_arg_nameinvalid_array_arginvalid_charsetinvalid_form_datainvalid_post_typemissing_post_typeteam_added_to_org
okbooleanrequired
Allowed:false

Error handling

The token must grant the rtm:stream scope. If batch_presence_aware is enabled, presence-change events use the batched format; presence_sub limits presence events to requested subscriptions.