Integrations
Integrations endpoints for the Mergify API.
Get the Slack integration configuration #
/integrations/{owner}/configuration/slack
List the Slack channels connected to the organization, with the notification configurations of every product. A channel is connected from the Mergify dashboard; this API cannot connect one.
owner
string
required
The owner of the repository
min length: 1 · max length: 40 · pattern: ^[a-zA-Z0-9\-]+$
200 Successful Response
The outcomes each Merge Queue event can have, which a notification can narrow it to.
Example Response
{
"channels": [
{
"id": "efb5681e-7906-4ee9-843b-42e956052987",
"slack_team_name": "My Slack Team",
"slack_channel": "#notification",
"disabled_at": "2024-01-15T10:30:00Z",
"disabled_reason": "webhook_gone",
"merge_queue_configs": [
{
"id": "cc363671-e816-44a5-ba68-b92391fcdaec",
"repositories": [
{
"id": 123,
"name": "my-repo",
"owner": {
"id": 234,
"login": "me",
"type": "User"
},
"full_name": "me/my-repo"
}
],
"events": [
{
"type": "scheduled_freeze.create",
"outcomes": []
}
]
}
],
"ci_insights_configs": [],
"test_quarantine_configs": []
}
],
"merge_queue_event_possible_outcomes": {
"action.queue.leave": [
"success",
"failure",
"neutral"
],
"scheduled_freeze.create": [
"neutral"
]
}
}
403 Forbidden
404 Not found
409 Conflict
422 Unprocessable entity
Example Request
curl -X GET "https://api.mergify.com/v1/integrations/:owner/configuration/slack" \
-H "Authorization: Bearer <token>"
Disconnect a Slack channel #
/integrations/{owner}/configuration/slack/{channel_configuration_id}
Disconnect a Slack channel from the organization, with every notification configuration it holds
channel_configuration_id
string <uuid>
required
The ID of the Slack channel configuration
owner
string
required
The owner of the repository
min length: 1 · max length: 40 · pattern: ^[a-zA-Z0-9\-]+$
204 No Content
403 Forbidden
404 Not found
409 Conflict
422 Unprocessable entity
Example Request
curl -X DELETE "https://api.mergify.com/v1/integrations/:owner/configuration/slack/:channel_configuration_id" \
-H "Authorization: Bearer <token>"
Create a Slack notification configuration #
/integrations/{owner}/configuration/slack/{channel_configuration_id}/{product}
Create a notification configuration for a product on a connected Slack channel. The request body and the response follow the schema of `product`.
channel_configuration_id
string <uuid>
required
The ID of the Slack channel configuration
owner
string
required
The owner of the repository
min length: 1 · max length: 40 · pattern: ^[a-zA-Z0-9\-]+$
product
"merge_queue_notification" | "test_quarantine_notification" | "ci_insights_notification"
required
The product the notification configuration is for
The names of the organization's repositories to notify about. Empty means every repository of the organization.
The names of the organization's repositories to notify about. Empty means every repository of the organization.
The branches whose CI jobs are reported. Empty means every branch.
The CI pipelines whose jobs are reported. Empty means every pipeline.
The CI jobs that are reported. Empty means every job.
The job conclusions that are reported. Empty means every conclusion.
The names of the organization's repositories to notify about. Empty means every repository of the organization.
The test events posted to the channel. Empty means every event except `test.health.changed`, which is posted only when listed.
201 Created
The ID of the notification configuration
The ID of the notification configuration
The branches whose CI jobs are reported. Empty means every branch.
The CI pipelines whose jobs are reported. Empty means every pipeline.
The CI jobs that are reported. Empty means every job.
The job conclusions that are reported. Empty means every conclusion.
The ID of the notification configuration
The test events posted to the channel. Empty means every event except `test.health.changed`, which is posted only when listed.
Example Response
{
"id": "cc363671-e816-44a5-ba68-b92391fcdaec",
"repositories": [
{
"id": 123,
"name": "my-repo",
"owner": {
"id": 234,
"login": "me",
"type": "User"
},
"full_name": "me/my-repo"
}
],
"events": [
{
"type": "scheduled_freeze.create",
"outcomes": []
}
]
}
403 Forbidden
404 Not Found
409 Conflict
422 Unprocessable entity
Example Request
curl -X POST "https://api.mergify.com/v1/integrations/:owner/configuration/slack/:channel_configuration_id/:product" \
-H "Authorization: Bearer <token>" \
-H "Content-Type: application/json" \
-d '{
"repositories": [
"string"
],
"events": [
{
"type": "action.assign",
"outcomes": null
}
]
}'
Update a Slack notification configuration #
/integrations/{owner}/configuration/slack/{channel_configuration_id}/{product}/{notification_configuration_id}
Replace a notification configuration of a connected Slack channel. The request body follows the schema of `product`, and a field left out is reset to empty.
channel_configuration_id
string <uuid>
required
The ID of the Slack channel configuration
notification_configuration_id
string <uuid>
required
The ID of the Slack notification configuration
owner
string
required
The owner of the repository
min length: 1 · max length: 40 · pattern: ^[a-zA-Z0-9\-]+$
product
"merge_queue_notification" | "test_quarantine_notification" | "ci_insights_notification"
required
The product the notification configuration is for
The names of the organization's repositories to notify about. Empty means every repository of the organization.
The names of the organization's repositories to notify about. Empty means every repository of the organization.
The branches whose CI jobs are reported. Empty means every branch.
The CI pipelines whose jobs are reported. Empty means every pipeline.
The CI jobs that are reported. Empty means every job.
The job conclusions that are reported. Empty means every conclusion.
The names of the organization's repositories to notify about. Empty means every repository of the organization.
The test events posted to the channel. Empty means every event except `test.health.changed`, which is posted only when listed.
204 No Content
403 Forbidden
404 Not Found
409 Conflict
422 Unprocessable entity
Example Request
curl -X PUT "https://api.mergify.com/v1/integrations/:owner/configuration/slack/:channel_configuration_id/:product/:notification_configuration_id" \
-H "Authorization: Bearer <token>" \
-H "Content-Type: application/json" \
-d '{
"repositories": [
"string"
],
"events": [
{
"type": "action.assign",
"outcomes": null
}
]
}'
Delete a Slack notification configuration #
/integrations/{owner}/configuration/slack/{channel_configuration_id}/{product}/{notification_configuration_id}
Delete a notification configuration from a connected Slack channel
channel_configuration_id
string <uuid>
required
The ID of the Slack channel configuration
notification_configuration_id
string <uuid>
required
The ID of the Slack notification configuration
product
"merge_queue_notification" | "test_quarantine_notification" | "ci_insights_notification"
required
The product the notification configuration is for
owner
string
required
The owner of the repository
min length: 1 · max length: 40 · pattern: ^[a-zA-Z0-9\-]+$
204 No Content
403 Forbidden
404 Not Found
409 Conflict
422 Unprocessable entity
Example Request
curl -X DELETE "https://api.mergify.com/v1/integrations/:owner/configuration/slack/:channel_configuration_id/:product/:notification_configuration_id" \
-H "Authorization: Bearer <token>"
Send a test Slack notification #
/integrations/{owner}/configuration/slack/{channel_configuration_id}/{product}/{notification_configuration_id}/test
Post a clearly-labeled test message to the configured Slack channel to validate delivery
channel_configuration_id
string <uuid>
required
The ID of the Slack channel configuration
notification_configuration_id
string <uuid>
required
The ID of the Slack notification configuration
product
"merge_queue_notification" | "test_quarantine_notification" | "ci_insights_notification"
required
The product the notification configuration is for
owner
string
required
The owner of the repository
min length: 1 · max length: 40 · pattern: ^[a-zA-Z0-9\-]+$
204 No Content
402 The organization's plan does not include the Slack integration
403 Forbidden
404 Not Found
409 Conflict
422 Unprocessable entity
502 Slack delivery failed
Example Request
curl -X POST "https://api.mergify.com/v1/integrations/:owner/configuration/slack/:channel_configuration_id/:product/:notification_configuration_id/test" \
-H "Authorization: Bearer <token>"
Was this page helpful?
Thanks for your feedback!