5

The only emoji command I can find is https://api.slack.com/methods/emoji.list

Is there a way to programatically create custom emoji? Or is the only way via manual process - https://get.slack.help/hc/en-us/articles/206870177-Creating-custom-emoji

2
  • 2
    I know this is an old question but I was wondering if you found a way to do this? Thanks!
    – Carl
    Nov 4, 2016 at 14:27
  • 2
    @Carl have not found a way to do it yet. Looks to be manual still. Nov 9, 2016 at 20:33

3 Answers 3

1

If you are on enterprise grid, you can use the recently added admin.emoji.add https://api.slack.com/methods/admin.emoji.add

9

There's an undocumented API endpoint for this: emoji.add (and its little buddy emoji.remove).

emoji.add POST parameters

  • token (either in POST body or Authorization: Bearer header) (There's an open GitHub issue that claims you can't use xoxb tokens, only xoxs ones.)
  • mode (data)
  • name (what you want as the custom emoji's name, e.g. my-party-parrot)
  • image (the file)

emoji.remove POST parameters

  • token (either in POST body or Authorization: Bearer header)
  • name (which custom emoji you want to remove, e.g. my-party-parrot)

Here's what it looks like in Postman:

Postman - Slack API - emoji.add

In CURL, the call would look like this:

curl -X POST \
  https://slack.com/api/emoji.add \
  -H 'Authorization: Bearer [REDACTED] \
  -H 'content-type: multipart/form-data; boundary=----WebKitFormBoundary7MA4YWxkTrZu0gW' \
  -H 'user-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/71.0.3578.98 Safari/537.36' \
  -F mode=data \
  -F name=my-party-parrot \
  -F image=@/home/curtis/Downloads/some-file.jpg

Everything that I know about this comes from from Jack Ellenberger's ":slack_on_fire:" article and his emojme library.

1
  • This approach can not be used with normal tokens (user, bot, legacy) and only works with internal xoxs tokens, which you have to grab manually from the browser. Its also unclear how long they live. So this is a hack and I personally would not use this with any production app for Slack. Sep 8, 2019 at 11:34
1

Slack's official web API does not support the programmatic creation of emojis.

2

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.