---
title: "Create or update the Slack integration"
method: PUT
path: "/api/v4/projects/{id}/integrations/slack"
tags: ["integrations"]
---

# Create or update the Slack integration

`PUT /api/v4/projects/{id}/integrations/slack`

## Request

- Base URL: `https://gitlab.com`
- URL: `https://gitlab.com/api/v4/projects/{id}/integrations/slack`
- Auth: none declared

Creates or updates the Slack integration.

## Path parameters

- `id` integer, required

## Request body

- PutApiV4ProjectsIdIntegrationsSlack: Create or update the Slack integration
  - `webhook` string, required: Slack notifications webhook (for example, `https://hooks.slack.com/services/...`).
  - `username` string: Slack notifications username.
  - `channel` string: Default channel to use if no other channel is configured.
  - `notify_only_broken_pipelines` boolean: Send notifications for broken pipelines.
  - `notify_only_when_pipeline_status_changes` boolean: Send notifications only when the pipeline status changes.
  - `branches_to_be_notified` string: Branches to send notifications for. Valid options are `all`, `default`, `protected`, and `default_and_protected`. The default value is `default`.
  - `labels_to_be_notified` string: Labels to send notifications for. Leave blank to receive notifications for all events.
  - `labels_to_be_notified_behavior` string: Labels to be notified for. Valid options are `match_any` and `match_all`. The default value is `match_any`.
  - `push_channel` string: The name of the channel to receive push_events notifications
  - `issue_channel` string: The name of the channel to receive issues_events notifications
  - `incident_channel` string: The name of the channel to receive incident_events notifications
  - `alert_channel` string: The name of the channel to receive alert_events notifications
  - `confidential_issue_channel` string: The name of the channel to receive confidential_issues_events notifications
  - `merge_request_channel` string: The name of the channel to receive merge_requests_events notifications
  - `note_channel` string: The name of the channel to receive note_events notifications
  - `confidential_note_channel` string: The name of the channel to receive confidential_note_events notifications
  - `tag_push_channel` string: The name of the channel to receive tag_push_events notifications
  - `deployment_channel` string: The name of the channel to receive deployment_events notifications
  - `pipeline_channel` string: The name of the channel to receive pipeline_events notifications
  - `wiki_page_channel` string: The name of the channel to receive wiki_page_events notifications
  - `vulnerability_channel` string: The name of the channel to receive vulnerability_events notifications
  - `push_events` boolean: Trigger event for pushes to the repository.
  - `issues_events` boolean: Trigger event when a work item is created, updated, or closed.
  - `confidential_issues_events` boolean: Trigger event when a confidential work item is created, updated, or closed.
  - `merge_requests_events` boolean: Trigger event when a merge request is created, updated, or merged.
  - `note_events` boolean: Trigger event for new comments.
  - `confidential_note_events` boolean: Trigger event for new comments on confidential work items.
  - `tag_push_events` boolean: Trigger event for new tags pushed to the repository.
  - `pipeline_events` boolean: Trigger event when a pipeline status changes.
  - `wiki_page_events` boolean: Trigger event when a wiki page is created or updated.
  - `deployment_events` boolean: Trigger event when a deployment starts or finishes.
  - `incident_events` boolean: Trigger event when an incident is created.
  - `work_item_events` boolean
  - `confidential_work_item_events` boolean
  - `vulnerability_events` boolean
  - `alert_events` boolean: Trigger event when a new, unique alert is recorded.
  - `use_inherited_settings` boolean: Indicates whether to inherit the default settings. Defaults to `false`.

## Response `200`

Create or update the Slack integration

- APIEntitiesIntegrationBasic: API_Entities_IntegrationBasic model
  - `id` integer, required
  - `title` string, required
  - `slug` string, required
  - `created_at` string, date-time, required
  - `updated_at` string, date-time, required
  - `active` boolean, required
  - `commit_events` boolean, required
  - `push_events` boolean, required
  - `issues_events` boolean, required
  - `incident_events` boolean, required
  - `alert_events` boolean, required
  - `confidential_issues_events` boolean, required
  - `merge_requests_events` boolean, required
  - `tag_push_events` boolean, required
  - `deployment_events` boolean, required
  - `note_events` boolean, required
  - `confidential_note_events` boolean, required
  - `pipeline_events` boolean, required
  - `wiki_page_events` boolean, required
  - `job_events` boolean, required
  - `comment_on_event_enabled` boolean, required
  - `inherited` boolean, required
  - `vulnerability_events` boolean, required

## Other responses

- `400`: Bad request
- `401`: Unauthorized
- `404`: Not found
- `422`: Unprocessable entity

---

[API](https://skmtc.dev/gitlab/apis/gitlab-api.md) - [All operations](https://skmtc.dev/gitlab/apis/gitlab-api/llms.txt) - [OpenAPI document](https://skmtc.dev/gitlab/apis/gitlab-api/revisions/b234947ef3f2?raw)
