Create notifier
Creates a new notifier configuration for sending alerts through various channels (Slack, Email, etc)
Body #
Configuration for a notification channel. Notifiers can be configured for various services like: - Slack - Email - PagerDuty - OpsGenie - Discord - Microsoft Teams - Custom Webhooks
application/json| Property | Type | Description |
|---|---|---|
createdAt | string<date-time> | Timestamp when the notifier was created |
createdBy | string | Email or ID of the user who created the notifier |
disabledUntil | string | ISO timestamp until which the notifier is disabled (null if enabled) |
name | stringRequired | Human-readable name for the notifier |
properties | objectRequired | Configuration options for different notification channels. Only one channel should be configured per notifier. |
customWebhook | object | Configuration for custom webhook notifications with flexible headers and body template. Supports variable substitution in the body template using {{.Variable}} syntax. |
body | stringRequired | Template for the webhook body, supports variable substitution |
headers | object | HTTP headers to include in the request |
secretHeaders | object | Sensitive HTTP headers (tokens, keys) that should be masked in logs |
url | stringRequired | Custom webhook endpoint URL |
discord | object | Configuration for Discord notifications using bot token |
discordChannel | string | Discord channel ID to send notifications |
discordToken | string | Discord bot token for authentication |
discordWebhook | object | Configuration for Discord notifications using webhooks |
discordWebhookUrl | string | Discord webhook URL |
email | object | Configuration for email notifications |
emails | string[] | List of email addresses to receive notifications |
microsoftTeams | object | Configuration for Microsoft Teams notifications |
microsoftTeamsUrl | string | Microsoft Teams webhook URL |
opsgenie | object | Configuration for OpsGenie integration |
apiKey | string | OpsGenie API key for authentication |
isEU | boolean | Whether to use EU region endpoints |
pagerduty | object | Configuration for PagerDuty integration |
routingKey | string | PagerDuty integration key for routing alerts |
token | string | PagerDuty API token for additional functionality |
slack | object | Configuration for Slack notifications using incoming webhooks |
slackUrl | string | Slack incoming webhook URL |
webhook | object | Configuration for simple webhook notifications |
url | string | Webhook endpoint URL |
updatedAt | string<date-time> | Timestamp when the notifier was last updated |
Request #
curl -X POST 'https://api.axiom.co/v2/notifiers' \
-H 'Authorization: Bearer API_TOKEN' \
-H 'Content-Type: application/json' \
-d '{"createdAt":"2024-01-15T10:30:00Z","createdBy":"alice@example.com","disabledUntil":"2024-03-20T15:00:00Z","name":"Production Slack Alerts","properties":{"customWebhook":{"body":"{\"alert\": \"{{.AlertName}}\", \"severity\": \"{{.Severity}}\", \"message\": \"{{.Message}}\"}","headers":{"Content-Type":"application/json","X-API-Version":"1.0"},"secretHeaders":{"Authorization":"Bearer {{token}}"},"url":"https://api.custom-service.com/alerts"},"discord":{"discordChannel":"123456789012345678","discordToken":"Bot 123456789012345678"},"discordWebhook":{"discordWebhookUrl":"https://discord.com/api/webhooks/123456789012345678/XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"},"email":{"emails":["oncall@example.com","alerts@example.com"]},"microsoftTeams":{"microsoftTeamsUrl":"https://outlook.office.com/webhook/123456789/IncomingWebhook/..."},"opsgenie":{"apiKey":"xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx","isEU":true},"pagerduty":{"routingKey":"1234567890abcdef1234567890abcdef","token":"u+1234567890abcdef1234567890abcdef"},"slack":{"slackUrl":"https://hooks.slack.com/services/T00000000/B00000000/XXXXXXXXXXXXXXXXXXXXXXXX"},"webhook":{"url":"https://api.example.com/webhooks/alerts"}},"updatedAt":"2024-01-15T11:00:00Z"}'Try itRun this request against your Axiom organization
Credentials stay in this browser tab and are only sent to Axiom when you run the request.
Response #
200Notifier