· 4 min read

How Slack Presence API Works: Technical Deep Dive

Technical explanation of Slack's presence system. How the API detects activity, timeout behavior, and how third-party tools maintain presence.

Technical explanation of Slack's presence system. How the API detects activity, timeout behavior, and how third-party tools maintain presence.

Quick Answer: Slack presence is managed through the users.setPresence API and activity signals from Slack clients. The API allows setting presence to “auto” (activity-based) or “away.” Most presence tools work by periodically calling users.setPresence with “auto” to reset the idle timer.

For cloud-based presence scheduling, see Idle Pilot or start free.

How Slack Presence API Works

Overview

Slack’s presence system has three components:

  1. Client activity detection: Slack apps send activity signals
  2. Server-side timeout: Slack servers track last activity and enforce timeout
  3. Presence API: Allows setting presence manually via users.setPresence

Client Activity Signals

When you interact with Slack (typing, clicking, scrolling), the client sends activity signals to Slack servers. These signals:

  • Are sent on significant interactions, not continuously
  • Reset the idle timeout timer
  • Are independent per workspace and device

The exact implementation differs between desktop, web, and mobile clients.

Server-Side Timeout

Slack servers maintain presence state:

User has activity signal within ~10 minutes → active
User has no activity signal for ~10 minutes → away
User has set presence to away → away
User is disconnected (all devices) → away

The timeout is approximately 10 minutes but isn’t precisely documented. It’s enforced server-side, so client manipulation doesn’t affect it.

The users.setPresence API

Endpoint

POST https://slack.com/api/users.setPresence

Parameters

ParameterTypeDescription
presencestringEither “auto” or “away”

Behavior

presence: "auto"

  • Sets presence to active momentarily
  • Enables normal activity-based timeout
  • Will revert to away after ~10 minutes without activity

presence: "away"

  • Manually sets status to away
  • Stays away until you set it back to auto or interact with Slack

OAuth Scopes Required

users:write

This scope allows setting your own presence. It doesn’t provide access to messages, channels, or other user data.

How Presence Tools Work

Most presence scheduling tools work like this:

1. User authorizes OAuth with users:write scope
2. Tool stores the OAuth token
3. On user's schedule (e.g., 9am-5pm weekdays):
   - Call users.setPresence with presence="auto"
   - Repeat every few minutes to prevent timeout
4. Outside schedule: stop calling, let user go naturally away

The key insight: calling users.setPresence with “auto” acts like an activity signal, resetting the idle timer.

Token Types and Permissions

User Tokens (xoxp-)

  • Act as the user
  • Can set that user’s presence
  • Generated via OAuth flow
  • Required for presence tools

Bot Tokens (xoxb-)

  • Act as a bot
  • Cannot set user presence
  • Would need workspace admin approval

Presence tools use user tokens, not bot tokens. This is why they don’t require workspace admin approval.

Rate Limits

Slack’s API has rate limits:

  • Tier 2: ~20 requests per minute for most endpoints
  • users.setPresence follows standard rate limits

Presence tools typically call the API every 3-5 minutes, well within limits.

Workspace vs Enterprise Grid

In standard workspaces, each workspace has its own presence. In Enterprise Grid:

  • Presence can span workspaces
  • Org-level tokens may affect multiple workspaces
  • Implementation is more complex

Most presence tools work at the workspace level.

What the API Can’t Do

The presence API has limitations:

  1. No history: You can’t retrieve presence history
  2. No other users: You can only set your own presence
  3. No duration lock: You can’t say “stay active for X hours”
  4. No fine-grained control: It’s just active/away, no custom states

Security Considerations

What Presence Tools Access

A properly scoped presence tool only has:

  • users:write - Set your presence
  • Possibly users:read - Read your profile info

It cannot:

  • Read your messages
  • Access your channels
  • See your files
  • Monitor your activity

Revoking Access

You can revoke access at any time:

  1. Go to Slack Settings → Apps
  2. Find the app
  3. Click “Remove”

This immediately invalidates the OAuth token.

FAQ

What Slack API controls presence?

The users.setPresence API method controls presence. It accepts two values: “auto” (let Slack manage based on activity) or “away” (manually set to away). Most presence tools repeatedly call this endpoint with “auto” to maintain active status.

How does Slack detect activity?

Slack desktop and mobile clients send activity signals to Slack servers when you interact with the application. After approximately 10 minutes without receiving activity signals, the server marks you as away. This timeout is enforced server-side.

Can Slack API set presence for other users?

No. The users.setPresence endpoint only works for the authenticated user (the owner of the OAuth token). You cannot set another user’s presence through the API.

For more on how presence scheduling works, see the presence scheduler glossary or Keep Slack Active.

  • slack
  • api
  • technical
  • development
Share:
Back to Blog

Related Posts

View All Posts »