How Does Slack API Presence Work?
Quick Definition
Slack API presence refers to the set of API methods that allow applications to read and modify a user's presence status programmatically. The two primary methods are users.getPresence (to check current status) and users.setPresence (to set status to 'auto' or 'away').
Understanding Slack API Presence
Slack exposes presence management through its Web API, which any authorized application can call over HTTPS. The users.getPresence method returns a user's current presence ('active' or 'away'), their last known activity timestamp, and whether they're connected from a desktop, mobile, or web client. The users.setPresence method allows setting presence to either 'auto' (let Slack determine based on activity) or 'away' (force away status). Notably, there is no 'active' option for setPresence; the API does not allow an app to directly force active status through this single method alone. This design is intentional on Slack's part. The setPresence API was built for scenarios like marking yourself away when starting a vacation bot or going offline during an automated workflow. It was not designed to let third-party tools override Slack's activity detection indefinitely. However, developers have found that maintaining an active WebSocket connection to the Slack Real Time Messaging (RTM) API or responding to heartbeat pings on a Socket Mode connection can keep presence active, because Slack interprets an active client connection as user presence. The technical details matter for understanding how presence management tools work. A cloud-based presence scheduler typically authenticates via OAuth, establishing a user token with the users:write scope (required for setPresence) and often the users:read scope (for getPresence). The tool then maintains a persistent connection to Slack's servers during the user's scheduled work hours. This connection mimics what the Slack desktop app does: it stays connected and responds to pings, which Slack interprets as an active client. When the scheduled hours end, the tool disconnects or calls setPresence with 'auto,' letting Slack's natural idle detection take over. Rate limiting is another consideration. Slack's API enforces rate limits of roughly 20 requests per minute for most methods on user tokens. Presence management tools need to work within these limits, which usually isn't a problem for maintaining a single user's presence but becomes relevant for tools managing many users. The RTM and Socket Mode approaches are more efficient because they maintain a single persistent connection rather than making repeated API calls. Enterprise Grid workspaces may have different rate limit tiers and additional requirements around app approval that affect how third-party presence tools operate. Token management and security are critical aspects of working with the Slack API for presence. User tokens grant significant access to the user's account and should be stored securely, with encryption at rest and in transit. OAuth tokens can be revoked by the user or workspace admin at any time, which immediately terminates the app's ability to manage presence. Well-designed presence tools handle token revocation gracefully, notifying the user rather than failing silently. The token also defines the scope of access: a presence management tool that only requests users:write and users:read scopes has far less access than one that requests broader permissions like channels:read or chat:write. Reviewing the scopes an app requests before authorizing it is an important step for any user who values their account security. It is also worth noting that Slack's API behavior can change without much advance notice. Slack has historically deprecated older APIs (like the RTM API for new apps created after 2020) in favor of newer alternatives like Socket Mode and the Events API. Presence management tools must adapt to these changes, and tools that rely on deprecated endpoints risk breaking when Slack removes support. This is one reason why cloud-based presence services that actively maintain their Slack integration offer more reliability than self-hosted scripts that may not be updated when API changes occur.
Key Points
- users.getPresence reads current status; users.setPresence writes it
- setPresence only accepts 'auto' or 'away,' not 'active'
- Active WebSocket connections to Slack signal presence indirectly
- OAuth scopes users:write and users:read are typically required
- Rate limits apply: roughly 20 requests per minute per user token
- Enterprise Grid may require additional app approval steps
Examples
Vacation bot
An app calls users.setPresence with 'away' when a user starts a vacation, and resets it to 'auto' when they return. This ensures the user appears away regardless of any automated activity that might trigger their Slack client.
Presence scheduler implementation
A cloud-based tool authenticates with a user's token, opens a WebSocket connection during scheduled work hours, and keeps it alive with ping/pong messages. Slack sees the active connection and maintains the user's green dot.
Frequently Asked Questions
Can the Slack API force my status to active?
What permissions does an app need to manage presence?
Does Slack rate-limit presence API calls?
How Idle Pilot Helps
Idle Pilot uses Slack's API to maintain your presence during scheduled hours. It handles the technical details of authentication, connection management, and scheduling so you don't have to build or maintain your own solution.
Try Idle Pilot freeRelated Terms
Slack presence is the indicator (green or yellow dot) next to your name showing whether you're currently active or away in Slack. It's automatically determined by Slack based on your recent activity and connection status.
A presence scheduler is a tool that automatically maintains your Slack presence status (active/online) during specified time windows, typically matching your work hours. Unlike mouse jigglers or scripts, modern presence schedulers run from the cloud.
Related resources
Last updated: March 2026
Explore more resources