Create notifier

POST/v2/notifiers

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
PropertyTypeDescription
createdAtstring<date-time>Timestamp when the notifier was created
createdBystringEmail or ID of the user who created the notifier
disabledUntilstringISO timestamp until which the notifier is disabled (null if enabled)
namestringRequiredHuman-readable name for the notifier
propertiesobjectRequiredConfiguration options for different notification channels. Only one channel should be configured per notifier.
customWebhookobjectConfiguration for custom webhook notifications with flexible headers and body template. Supports variable substitution in the body template using {{.Variable}} syntax.
bodystringRequiredTemplate for the webhook body, supports variable substitution
headersobjectHTTP headers to include in the request
secretHeadersobjectSensitive HTTP headers (tokens, keys) that should be masked in logs
urlstringRequiredCustom webhook endpoint URL
discordobjectConfiguration for Discord notifications using bot token
discordChannelstringDiscord channel ID to send notifications
discordTokenstringDiscord bot token for authentication
discordWebhookobjectConfiguration for Discord notifications using webhooks
discordWebhookUrlstringDiscord webhook URL
emailobjectConfiguration for email notifications
emailsstring[]List of email addresses to receive notifications
microsoftTeamsobjectConfiguration for Microsoft Teams notifications
microsoftTeamsUrlstringMicrosoft Teams webhook URL
opsgenieobjectConfiguration for OpsGenie integration
apiKeystringOpsGenie API key for authentication
isEUbooleanWhether to use EU region endpoints
pagerdutyobjectConfiguration for PagerDuty integration
routingKeystringPagerDuty integration key for routing alerts
tokenstringPagerDuty API token for additional functionality
slackobjectConfiguration for Slack notifications using incoming webhooks
slackUrlstringSlack incoming webhook URL
webhookobjectConfiguration for simple webhook notifications
urlstringWebhook endpoint URL
updatedAtstring<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
application/json