Appearance
Slack Notifications
Scripts send Slack messages via the injected $notifications object, using named webhooks you configure in Admin Settings. The webhookName you pass must match the name of a saved webhook.
1. Create a Slack Incoming Webhook
- Go to api.slack.com/apps and click Create New App
- Choose From scratch, give it a name (e.g. "ApiMeld"), and select your workspace
- In the left sidebar, click Incoming Webhooks
- Toggle Activate Incoming Webhooks to On
- Click Add New Webhook to Workspace
- Select the channel you want ApiMeld to post to
- Copy the webhook URL — it looks like:
https://hooks.slack.com/services/T00000000/B00000000/XXXXXXXXXXXXXXXXXXXXXXXX
Channel per environment
Consider separate webhooks for different channels — e.g. #apimeld-prod for failures and #apimeld-dev for dev runs. Each gets its own name in ApiMeld.
2. Add the webhook to ApiMeld
- Go to Admin → Settings → Notifications
- Under Slack Webhooks, click Add
- Enter a name (e.g.
"Ops Channel") and paste the webhook URL - Click Save
The name you enter here is what you pass as webhookName in your scripts.
Sending from a script
| Language | One-liner |
|---|---|
| PowerShell | $notifications.SendSlack('Ops Channel', 'Task complete') |
| JavaScript / TypeScript | notifications.sendSlack('Ops Channel', 'Task complete') |
| Python | notifications.send_slack('Ops Channel', 'Task complete') |
| Bash | notify_slack "Ops Channel" "Task complete" |
| C# | Notifications.SendSlack("Ops Channel", "Task complete"); |
Larger example (PowerShell)
powershell
try {
$result = Invoke-RestMethod -Uri $datasources.OrdersApi.GetOrders.Url -Headers $AuthHeaders
$count = $result.Count
$notifications.SendSlack('Ops Channel', "Nightly sync complete — $count orders processed.")
} catch {
$notifications.SendSlack('Ops Channel', "Nightly sync FAILED: $_")
}Parameters
| Parameter | Description |
|---|---|
webhookName | The name of the webhook as saved in Admin → Settings → Notifications |
message | Plain text message to post |
Testing the webhook
After saving, click Test next to the webhook in Admin → Settings → Notifications to send a test message to the channel.