Applies to:
- Plan -
- Deployment -
Summary
Slack alerts can be created programmatically with the Project automation API. Create aproject_automation where config.event_type is "logs" and config.action.type is "slack", then set workspace_id and channel to the Slack workspace and channel IDs. Ensure the Slack integration is enabled and the API key can create project automations.
What is happening
The UI exposes Slack alert setup but the same behavior can be reproduced via the project_automation API. When youPOST to /v1/project_automation with an action of type "slack", the platform sends alerts to the specified Slack workspace and channel. If the workspace app is not installed or the bot lacks channel write permissions, messages will not arrive.
Fix or suggestion
Option 1: Create Slack alerts via the API (recommended)
- Ensure the Slack integration/app is installed in the target workspace and the bot can post to the channel.
- Use an API key with permission to create project automations.
POSTaproject_automationwith aconfigthat includesevent_type,btql_filter,interval_seconds, and anactionof type"slack". Example minimal payload:
- Use Slack workspace and channel IDs, such as
T...andC.... Thechannelfield is the Slack channel ID, not the channel name. - Ensure the Slack app has the scopes required to post messages to the target channel.
Option 2: Configure Slack alerts via the UI
- Go to Settings > Alerts.
- Click New alert and select Slack as the destination.
- Select the workspace and channel from the dropdowns.
How to confirm it worked
- Verify the automation appears in the project’s automations list in the UI.
- Trigger a test event matching your filter and confirm a message appears in the specified Slack channel.
Notes
- For UI setup, see Alerts. For the API schema, see Create project automation.
POST /v1/project_automationreturns an existing automation unchanged when another automation with the same name already exists. UsePUT /v1/project_automationif you need create-or-replace behavior.- For self-hosted deployments, alerts require data plane v0.0.72 or later, and Slack alerts require data plane v1.1.29 or later.