{"id":21487620,"url":"https://github.com/outofcoffee/slack-gateway","last_synced_at":"2025-07-15T15:31:28.694Z","repository":{"id":53130970,"uuid":"137123960","full_name":"outofcoffee/slack-gateway","owner":"outofcoffee","description":"An HTTP gateway for posting to Slack.","archived":false,"fork":false,"pushed_at":"2024-05-08T05:47:33.000Z","size":208,"stargazers_count":2,"open_issues_count":4,"forks_count":2,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-07-14T16:58:19.346Z","etag":null,"topics":["channel","gateway","message","post-message","slack"],"latest_commit_sha":null,"homepage":"","language":"Kotlin","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/outofcoffee.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null}},"created_at":"2018-06-12T20:26:39.000Z","updated_at":"2023-09-18T21:25:20.000Z","dependencies_parsed_at":"2024-02-13T18:09:58.978Z","dependency_job_id":"0160cdc0-1c5d-4b50-8963-a233f0ea1054","html_url":"https://github.com/outofcoffee/slack-gateway","commit_stats":null,"previous_names":[],"tags_count":13,"template":false,"template_full_name":null,"purl":"pkg:github/outofcoffee/slack-gateway","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/outofcoffee%2Fslack-gateway","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/outofcoffee%2Fslack-gateway/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/outofcoffee%2Fslack-gateway/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/outofcoffee%2Fslack-gateway/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/outofcoffee","download_url":"https://codeload.github.com/outofcoffee/slack-gateway/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/outofcoffee%2Fslack-gateway/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":265443422,"owners_count":23766407,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["channel","gateway","message","post-message","slack"],"created_at":"2024-11-23T13:29:51.243Z","updated_at":"2025-07-15T15:31:28.359Z","avatar_url":"https://github.com/outofcoffee.png","language":"Kotlin","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Slack Gateway: An HTTP gateway for posting to Slack [![CI](https://github.com/outofcoffee/slack-gateway/actions/workflows/ci.yaml/badge.svg)](https://github.com/outofcoffee/slack-gateway/actions/workflows/ci.yaml)\n\nWith a single HTTP request, you can post a message, creating the channel first if it doesn't exist and invite people and groups.\n\n## What can it do?\n\nRuns as a server, listening for an HTTP request. Upon receipt of a message, the gateway:\n\n* creates the given Slack channel if it doesn't exist\n* ensures a list of users (or user groups) are in the channel (if not - invites them)\n* posts the message to the channel\n\nThis removes the complexity of orchestrating many Slack API calls behind a simple endpoint.\n\n## Examples\n\n### Using Slack format\n\nSend a message to a channel:\n\n    curl http://localhost:8080/messages/raw \\\n        --header \"Content-Type: application/json\" \\\n        --data '{\"channel\":\"general\", text\":\"Hello World!\"}'\n        \nSend a message with attachments:\n\n    curl http://localhost:8080/messages/raw \\\n        --header \"Content-Type: application/json\" \\\n        --data '{\"channel\":\"general\", text\":\"Hello World!\",\"attachments\":[{\"text\":\"More info\",\"color\":\"#33ee33\"}]}'\n\n### Using simple key-value format\n\nIf you don't want to compose the JSON yourself, you can use a simpler, but slightly more limited, key-value format instead.\n\nSend a message to a channel:\n\n    curl http://localhost:8080/messages/text \\\n        --data 'channel=general' \\\n        --data 'text=Hello%20World!'\n---\n\n## Getting started\n\n### Overview\n\n* As a Slack admin, create a Slack app, add the required scopes (see below) and install it to your workspace\n* Set environment variables\n* Run!\n\n### Starting the server\n\nIf you'd like to run Slack Gateway yourself as a Docker container, you can do the following:\n\n    docker run -d \\\n        --env SLACK_USER_TOKEN=\"CHANGEME\" \\\n        --env SLACK_CHANNEL_MEMBERS=\"jsmith,mjones\" \\\n        --publish 8080:8080 \\\n        outofcoffee/slack-gateway\n\n\u003e Note: See the _Environment variables_ section for the available configuration settings.\n\n## Usage\n\nYou can send messages to Slack Gateway using either the Slack format, or a simpler key-value format.\n\n### Using Slack format\n\nSend a message to a channel:\n\n    curl http://localhost:8080/messages/raw \\\n        --header \"Content-Type: application/json\" \\\n        --data '{\"channel\":\"general\", text\":\"Hello World!\"}'\n        \nSend a message with attachments:\n\n    curl http://localhost:8080/messages/raw \\\n        --header \"Content-Type: application/json\" \\\n        --data '{\"channel\":\"general\", text\":\"Hello World!\",\"attachments\":[{\"text\":\"More info\",\"color\":\"#33ee33\"}]}'\n\n\u003e For more information on the Slack post message format, see https://api.slack.com/\n\n### Using simple key-value format\n\nIf you don't want to compose the JSON yourself, you can use a simpler, but slightly more limited, key-value format instead.\n\nSend a message to a channel:\n\n    curl http://localhost:8080/messages/text \\\n        --data 'channel=general' \\\n        --data 'text=Hello%20World!'\n\nSend a message as an attachment:\n\n    curl http://localhost:8080/messages/text \\\n        --data 'channel=general' \\\n        --data 'text=Hello%20World!' \\\n        --data 'title=Attachment' \\\n        --data 'attachment=true' \\\n        --data 'color=00ff00'\n\n\u003e The example above will send the text message as an attachment, with a particular colour and title.\n\nThe available options for the key-value format are:\n\n| Key                     | Required                                 | Type    | Purpose                            |\n|-------------------------|------------------------------------------|---------|------------------------------------|\n| channel                 | Yes                                      | String  | Channel name                       |\n| text                    | Yes, unless additional message keys used | String  | Literal message text               |\n| attachment              | No                                       | Boolean | Whether to send in attachment mode |\n| title                   | No                                       | String  | Attachment title                   |\n| color                   | No                                       | String  | Attachment color                   |\n| author_name             | No                                       | String  | Attachment author name             |\n| title_link              | No                                       | String  | Attachment title link URL          |\n| footer                  | No                                       | String  | Attachment footer text             |\n| footer_icon             | No                                       | String  | Attachment footer icon URL         |\n| Additional message keys | No, unless `text` is empty               | String  | See below                          |\n\n#### Additional message keys\n\nWhen using the key-value format, any additional keys are appended to the text message. For example:\n\n    curl http://localhost:8080/messages/text \\\n        --data 'channel=general' \\\n        --data 'key_one=foo' \\\n        --data 'key_two=bar' \\\n        --data 'key_three=baz'\n\nThis will result in message text such as the following:\n\n    key one: *foo* | key two: *bar* | key three: *baz*\n\n\u003e Note that underscores in key names are replaced with spaces, and the values are emboldened.\n\n### Setting the channel type\n\nYou can specify the channel type as public or private. This will be used when creating channels, or posting messages.\n\nSet the `channel_type` query parameter in the HTTP request, or use the `DEFAULT_CREATE_CHANNEL_TYPE` environment variable.\n\nValid values:\n\n* private\n* public\n\nExample using the query parameter:\n\n    curl http://localhost:8080/messages/text \\\n       --data 'channel=some-private-channel' \\\n       --data 'text=Hello%20world' \\\n       --data 'channel_type=private'\n\n## Creating a Slack app\n\nAs a Slack admin, create a Slack app: https://api.slack.com/apps/new\n\nAdd a bot user in the 'Bot Users' section:\n\n    https://api.slack.com/apps/\u003cyour app ID\u003e/bots\n\nAdd the required scopes in the 'OAuth \u0026 Permissions' section:\n\n    https://api.slack.com/apps/\u003cyour app ID\u003e/oauth\n\nThe scopes are:\n\n    chat:write:bot\n    channels:read\n    channels:write\n    groups:read\n    groups:write\n    users:read\n    usergroups:read\n\n\u003e Don't forget to save changes after adding scopes.\n\nInstall your app to your workspace. This will generate two tokens.\n\nCopy the 'OAuth Access Token' and set it as the `SLACK_USER_TOKEN`. It should look like this:\n\n    xoxp-123456789012-123456789012-123456789012-abcdef1234567890abcdef1234567890\n\nCopy the 'Bot User OAuth Access Token' and set it as the `SLACK_BOT_TOKEN`. It should look like this:\n\n    xoxb-123456789012-123456789012-abcdef1234567890abcdef1234567890\n\nDon't forget to invite your app to any existing private channels, using:\n\n    /invite @YourAppName\n\n\u003e Slack doesn't permit apps to post to channels unless they have permissions.\n\n---\n\n## Build\n\nIf instead you wish to build and run locally, you can run:\n\n    ./gradlew installDist\n    docker-compose build\n\nOnce built, set the environment variables in `docker-compose.yml`. See the _Environment variables_ section.\n\nThen run with:\n\n    docker-compose up\n\nIf you change anything, don't forget to rebuild before running again.\n\n## Environment variables\n\nConfigure the bot using the following environment variables.\n\n### Basic variables\n\n- SLACK_BOT_TOKEN - required to post to channels not containing the user who created the user token\n- SLACK_USER_TOKEN - must have the right permission scopes (see 'Creating a Slack app' in this document)\n- SLACK_CHANNEL_MEMBERS - users to invite to channels e.g. \"janesmith,bob\" (comma separated; default empty)\n- SLACK_CHANNEL_GROUPS - user groups to invite to channels e.g. \"devteam\" (comma separated; default empty)\n\n### Advanced variables\n\n- HTTP_BIND_PORT (default 8080)\n- HTTP_BIND_HOST (default 0.0.0.0)\n- SLACK_CACHE_SECONDS - period to cache Slack objects like users and user groups (default 300)\n- DEFAULT_CREATE_CHANNEL_TYPE (default 'private') - the default channel type to create if none is specified in the request\n\n## Contributing\n\n* Pull requests are welcome.\n* PRs should target the `develop` branch.\n* Please run `ktlint` against the code first ;-)\n\n## Author\n\nPete Cornish (outofcoffee@gmail.com)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Foutofcoffee%2Fslack-gateway","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Foutofcoffee%2Fslack-gateway","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Foutofcoffee%2Fslack-gateway/lists"}