slack-api-specs icon indicating copy to clipboard operation
slack-api-specs copied to clipboard

Open API specifications for platform products by Slack

slack-api-specs

This repository contains API specifications of Slack platform features and APIs.

⚠️ Not Accepting Contributions

Because our specifications are artifacts of an incredible machine, we cannot accept pull requests for this repo. Please file issues with suggestions or bugs with the spec itself. Feedback about the APIs or features the specs describe should be directed to Slack's developer support team.

Overview

You'll find OpenAPI specs for the Slack Web API and AsyncAPI specs for the Events API.

Read more about our open specification strategy in this announcement.

Specification menu

  • Web API
    • OpenAPI 2.0 spec - covers user and bot user token usage of public Web API methods
  • Events API
    • AsyncAPI 1.0 spec - a catalog of JSON schema for basic Events API structure and a handful of detailed event types
    • JSON Schema - covers only the basic event wrapper all event types delivered by Slack

We continue to refine and expand schema and example coverage throughout all of our specifications.

How the specs are made

We use a combination of internal metadata, custom scripting, and old fashioned writing-by-hand to produce these specifications. They don't always tell the whole truth and are subject to author and operator error. They are really useful though.

Recent changes

Now we'll recount the major changes found in each new release of our specifications.

  • Web API specifications changelog

Using with external tools

Postman

It's possible to use slack_web_openapi_v2.json to generate a Postman Collection, but you must first modify the spec to be technically and factually invalid unfortunately.

Add a top-level "openapi": "3.0" attribute near where "swagger": "2.0" is defined. While openapi isn't a valid attribute for OpenAPI 2.0 schemas, and if it were, the version should be 2.0. Being wrong this way instructs Postman to do continue importing as a collection.

Postman doesn't pick up the defined hostname and path https://slack.com/api that precedes all Web API methods (for example, https://slack.com/api/chat.postMessage) as the {{baseUrl}} variable for the collection.

Populate {{baseUrl}} by first hovering over your collection in the navigation bar click on the action menu that appears. Then, select "Edit". A modal will appear. Click into the rightmost section, Variables which should have a green dot next to it. In the Initial Value column next to baseUrl, enter https://slack.com/api and then click Reset All. Once you see that both the initial and current values have been set, click update and your imported collection will properly use "https://slack.com/api" as its base domain.