Slack Custom Emoji private API /api/emoji.add

Tadashi Shigeoka ·  Sat, May 18, 2019

I investigated whether Slack has an API endpoint for adding Custom Emoji and found /api/emoji.add, but it appears not to be publicly available.

slack

Background

You can set Custom Emoji permissions from https://your.slack.com/admin/settings#customization, but it wasn’t possible to grant permission to Guests as well, so I thought “Can’t we add Custom Emoji via the Slack API?” and decided to investigate.

Custom Emoji Permission | Slack

Slack API /api/emoji.add

/api/emoji.add is not a publicly available API

There was an open GitHub issue requesting permission to use the API /api/emoji.add with xoxb tokens.

Types of tokens | Slack

You can use /api/emoji.add API with xoxs token

Although /api/emoji.add is not a publicly available API, there were examples like slack-emojinator that scrape and use xoxs tokens.

upload.py#L21 · smashwilson/slack-emojinator

The xoxs token scraping was handled by the _fetch_api_token method implemented in the following location:

upload.py#L81-L94 · smashwilson/slack-emojinator

That’s all from the Gemba, where we want to add Custom Emoji via the Slack API.