Slack's API is primarily an HTTP RPC-style API. It is not a traditional REST, GraphQL, or SOAP API. The API methods have URLs in the form https://slack.com/api/METHOD_FAMILY.method
.
Key features of Slack's API:
Yes, the official Slack API does have webhooks, and you can subscribe to various types of events.
Slack provides incoming webhooks, which allow you to post messages from external sources into Slack. To use incoming webhooks, you need to create a Slack app, enable incoming webhooks for your app, create an incoming webhook URL, and use the webhook URL to post messages to Slack. Incoming webhooks are primarily used for sending messages to Slack, not for receiving events.
Slack also offers an Events API, which allows you to subscribe to various events that occur within Slack. This is a more comprehensive way to receive notifications about activities in Slack. To use the Events API, you need to create a Slack app, enable event subscriptions, set up a request URL to receive events, and subscribe to specific event types.
You can subscribe to a wide variety of events through the Events API, including:
The specific events you can subscribe to depend on the OAuth scopes your app has been granted.
In summary, while Slack does offer incoming webhooks for sending messages to Slack, the Events API is the primary method for subscribing to and receiving notifications about events occurring within Slack workspaces.
Here are the key points about Slack API rate limits:
Slack uses a tiered rate limiting system for the Web API, with different tiers allowing different numbers of requests per minute:
Rate limits are applied on a "per API method per app per workspace" basis
For posting messages, the general limit is 1 message per second per channel, with some burst behavior allowed
Events API: 30,000 event deliveries per hour per workspace
Incoming webhooks: 1 per second (short bursts allowed)
Workflow triggers:
When rate limited, Slack returns a HTTP 429 error with a Retry-After header indicating how long to wait before retrying
The Node SDK handles rate limiting automatically by default
For custom implementations, you can:
Caching data that doesn't change frequently can help reduce API calls
Monitor your API usage and implement pauses between calls to avoid hitting limits
Consider implementing caching (e.g. LRU caching) to reduce API calls
Design your app to stay well under the limits where possible
For high-volume messaging needs, consider using external logging/archiving services instead
By following these guidelines and implementing proper rate limit handling, you can optimize your Slack app to work within the API rate limits.
The most recent version of the Slack API tools is 2.27.1, released on July 11, 2024.
Key points to consider:
The Slack API and developer tools are regularly updated, with new versions released frequently.
The latest version (2.27.1) was released on July 11, 2024.
Prior to that, version 2.26.0 was released on June 13, 2024.
Slack maintains a detailed changelog documenting updates and changes to their API and developer tools.
Some important upcoming changes include:
files.upload
API method, which will be retired on March 11, 2025.files.upload
.Best practices:
It's important to stay informed about these updates to ensure your Slack integrations remain functional and take advantage of the latest features.
To get a Slack developer account and API keys:
Join the Slack Developer Program:
Create a Slack App:
Obtain an API Token:
Use the API Token:
Best Practices:
Authorization
HTTP header to send your token in outbound requestsBased on the search results provided, here are the key data models you can interact with using the Slack API:
For each of these data models, the Slack API provides various methods to interact with them, such as creating, reading, updating, and deleting. The specific operations available depend on the scopes and permissions granted to your Slack app. It's important to note that access to different conversation types (public channels, private channels, DMs) is governed by corresponding permission scopes.