Slack

If you'd like to automatically notify your team on a Slack workspace whenever a change has occurred on your apps, this Integration will help you out. You can choose which actions should trigger messages on your Slack workspace.

Here are the steps that we are going through:

  1. Create a Slack app
  2. Create a Webhook
  3. Setup Webhook in Qovery
  4. Try it!

1. Create a Slack app

Go to the Slack page to create apps and create a new app. C

Create a slack app - step 1

Create a Slack app from scratch.

Create a slack app - step 2

all it Qovery and connect it to the workspace of your choice.

Create a slack app - step 3

Feel free to use an image from here as the app's logo.

Create a slack app - step 4

2. Create Webhook

Go to the Incoming Webhooks page for your newly-created app and toggle Activate Incoming Webhooks to turn it on.

Create a webhook integration on Slack - step 1

Then click on Add New Webhook to Workspace

Create a webhook integration on Slack - step 2

and select the channel that the notifications will be posted to:

Create a webhook integration on Slack - step 3

Copy the webhook URL

Create a webhook integration on Slack - step 4

3. Create Webhook in Qovery

To create a webhook in Qovery you need to:

  1. Install the Qovery CLI
  2. Generate an API Token
  3. Copy the following CURL command:
curl -X POST -H 'Content-type: application/json' -H 'Authorization: Token <Your API Token>' -d \
'{"description": "slack notifications", "target_url": "<Your Slack Webhook URL>", "events": ["DEPLOYMENT_STARTED", "DEPLOYMENT_CANCELLED", "DEPLOYMENT_SUCCESSFUL", "DEPLOYMENT_FAILURE"], "kind": "SLACK", "enabled": true}' \
"https://api.qovery.com/organization/{Your Organization ID}/webhook"
  1. Replace <Your API Token> with your Qovery API token
  2. Replace <Your Slack Webhook URL> with your Slack Webhook URL
  3. Replace {Your Organization ID} with your Qovery organization ID.
  4. Run the complete CURL command in your terminal.
Learn how to get your Organization ID

Your Organization ID is the first ID in your console.qovery.com URL. E.g. for https://console.qovery.com/platform/organization/70c9a78d-454b-41dc-8478-d1f95bd08fd7/projects the Organization ID is 70c9a78d-454b-41dc-8478-d1f95bd08fd7


You must receive a REST response from the API if it's all good!

You can also add the properties:

  • project_names_filter to send events for project matching the name and...
  • environment_types_filterto send events for environments matching the type.

Other examples

Here is another example to send webhook events only for production and staging environments

curl -X POST -H 'Content-type: application/json' -H 'Authorization: Token <Your API Token>' -d \
'{"description": "slack notifications", "target_url": "<Your Slack Webhook URL>", "environment_types_filter": ["PRODUCTION", "STAGING"], "events": ["DEPLOYMENT_STARTED", "DEPLOYMENT_CANCELLED", "DEPLOYMENT_SUCCESSFUL", "DEPLOYMENT_FAILURE"], "kind": "SLACK", "enabled": true}' \
"https://api.qovery.com/organization/{Your Organization ID}/webhook"

Note that environment_types_filter:

  • is a list
  • accepts PRODUCTION, DEVELOPMENT, STAGING, PREVIEW

And one more example to send webhook events only for project with names starting by product or equal to analytics

curl -X POST -H 'Content-type: application/json' -H 'Authorization: Token <Your API Token>' -d \
'{"description": "slack notifications", "target_url": "<Your Slack Webhook URL>", "project_names_filter": ["product*", "analytics"], "events": ["DEPLOYMENT_STARTED", "DEPLOYMENT_CANCELLED", "DEPLOYMENT_SUCCESSFUL", "DEPLOYMENT_FAILURE"], "kind": "SLACK", "enabled": true}' \
"https://api.qovery.com/organization/{Your Organization ID}/webhook"

Note that project_names_filter:

  • is a list
  • is not case-sensitive
  • accepts wildcard

Considerations

  • You can have multiple webhooks targeting different Slack channels
  • You can specify the events that you want to receive. E.g. if you just want to be notified when a deployment failed, then use "events": ["DEPLOYMENT_FAILURE"]. All the events and the description are available on our API doc.
  • You can turn off or delete your webhooks at any time with this API call.
  • The Qovery web interface will integrate the Webhook configuration :)

Check out this page for further details on how to use the WebHook API.

4. Try it!

Launch a deployment with Qovery, and you will see a message like the one below appearing in your Slack channel 🎉

Open a thread on our forum if you have any questions.