Create a Slack or Discord integration
Creates the Slack or Discord destination of a notification configuration. If the configuration already has a destination of that type, its URL is replaced instead and the destination keeps its id. It never sends a test message and never switches the channel on: that is slack_channel or discord_channel on “Update a notification configuration”.
A destination has no request of its own to read it: read it with “Retrieve a notification configuration” and include=integrations. The complete URL is returned on ordinary reads too. To change the URL of an existing destination use “Update a Slack or Discord integration”, and to remove it “Delete a Slack or Discord integration”.
Your role must be allowed to edit notification configurations and the organization’s plan must include the channel; otherwise the request answers 404. The body is checked before the configuration, so an invalid body answers 422 and a configuration of another organization answers 404 only when the body is valid.
Body
type(slackordiscord, required): the kind of destination.url(string, required): at most 2048 characters, a completehttps://hooks.slack.com/services/...URL forslack, or a completehttps://discord.com/api/webhooks/...(ordiscordapp.com) URL fordiscord.
Errors
- 422:
typeis notslackordiscord, orurlis empty, masked or not valid for the type.
Authentication
Personal access token created in the Modular DS dashboard; read-only tokens can only call GET endpoints.
Path parameters
Request
Response
201 - Integration created (or replaced)
