# Slack Integration

Sorry-cypress integrates with [Slack Webhooks API](https://api.slack.com/messaging/webhooks). Use the web dashboard Project Settings to add or edit Slack Integration. Also you can filter messages by event type, by test suite result and by branch.

![](https://1197668970-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MS6gDAYECuzpKjjzrdc%2Fuploads%2Fgit-blob-bf7cd3fb22a5f36a0aa625495f99d660cd08fc9b%2FScreenshot%202021-04-15%20at%2012.02.29.png?alt=media)

Here's an example of Slack message posted by sorry-cypress:

![](https://1197668970-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MS6gDAYECuzpKjjzrdc%2Fuploads%2Fgit-blob-9977971bb97d9b45760a4c8841949d5075bcd097%2FScreenshot%202021-04-15%20at%2012.32.28.png?alt=media)

If you are using the in-memory director and do not have a dashboard you can add hooks to your project via a HTTP `POST` to the `/hooks` route of your director.. Ensure your "projectId" matches that in your cypress.json or cypress.config.js that you wish to add hooks to. Note this will replace all the hooks for the given projectId.

```
//Example POST body to localhost:1234/hooks

{
  "projectId": "test",
  "hooks": [
    {
      "hookId": "1",
      "url": "http://localhost:3005",
      "username": "user",
      "hookEvents": [
        "INSTANCE_FINISH",
        "RUN_FINISH"
      ],
      "hookType": "SLACK_HOOK",
      "slackResultFilter": "ONLY_FAILED"
      "slackBranchFilter": ["main"]
    }
  ]
}

```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.sorry-cypress.dev/integrations/slack-integration.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
