> ## Documentation Index
> Fetch the complete documentation index at: https://axiom.co/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Create notifier

> Creates a new notifier configuration for sending alerts through various channels (Slack, Email, etc)



## OpenAPI

````yaml v2 post /notifiers
openapi: 3.0.0
info:
  description: A public and stable API for interacting with axiom services
  title: Axiom
  termsOfService: http://axiom.co/terms
  contact:
    name: Axiom support team
    url: https://axiom.co
    email: hello@axiom.co
  license:
    name: Apache 2.0
    url: https://www.apache.org/licenses/LICENSE-2.0.html
  version: 2.0.0
servers:
  - url: https://api.axiom.co/v2/
security:
  - bearerAuth: []
paths:
  /notifiers:
    post:
      tags:
        - Monitors
      description: >-
        Creates a new notifier configuration for sending alerts through various
        channels (Slack, Email, etc)
      operationId: createNotifier
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/Notifier'
        description: Notifier configuration details
        required: true
      responses:
        '200':
          description: Notifier
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/NotifierWithId'
      security:
        - Auth:
            - notifiers|create
components:
  schemas:
    Notifier:
      description: >
        Configuration for a notification channel. Notifiers can be configured
        for various services like:

        - Slack

        - Email

        - PagerDuty

        - OpsGenie

        - Discord

        - Microsoft Teams

        - Custom Webhooks
      type: object
      required:
        - name
        - properties
      properties:
        createdAt:
          description: Timestamp when the notifier was created
          type: string
          format: date-time
          readOnly: true
          example: '2024-01-15T10:30:00Z'
        createdBy:
          description: Email or ID of the user who created the notifier
          type: string
          readOnly: true
          example: alice@example.com
        disabledUntil:
          description: ISO timestamp until which the notifier is disabled (null if enabled)
          type: string
          example: '2024-03-20T15:00:00Z'
        name:
          description: Human-readable name for the notifier
          type: string
          example: Production Slack Alerts
        properties:
          $ref: '#/components/schemas/NotifierProperties'
    NotifierWithId:
      description: Notifier configuration with its unique identifier
      allOf:
        - $ref: '#/components/schemas/Notifier'
        - properties:
            id:
              description: Unique identifier for the notifier
              type: string
              example: notify_slack_prod
    NotifierProperties:
      description: >-
        Configuration options for different notification channels. Only one
        channel should be configured per notifier.
      properties:
        customWebhook:
          $ref: '#/components/schemas/CustomNotifierConfig'
        discord:
          $ref: '#/components/schemas/DiscordConfig'
        discordWebhook:
          $ref: '#/components/schemas/DiscordWebhookConfig'
        email:
          $ref: '#/components/schemas/EmailConfig'
        microsoftTeams:
          $ref: '#/components/schemas/MicrosoftTeamsConfig'
        opsgenie:
          $ref: '#/components/schemas/OpsGenieConfig'
        pagerduty:
          $ref: '#/components/schemas/PagerDutyConfig'
        slack:
          $ref: '#/components/schemas/SlackConfig'
        webhook:
          $ref: '#/components/schemas/WebhookConfig'
    CustomNotifierConfig:
      description: >
        Configuration for custom webhook notifications with flexible headers and
        body template.

        Supports variable substitution in the body template using {{.Variable}}
        syntax.
      type: object
      required:
        - url
        - body
      properties:
        body:
          description: Template for the webhook body, supports variable substitution
          type: string
          example: >-
            {"alert": "{{.AlertName}}", "severity": "{{.Severity}}", "message":
            "{{.Message}}"}
        headers:
          description: HTTP headers to include in the request
          type: object
          additionalProperties:
            type: string
          example:
            Content-Type: application/json
            X-API-Version: '1.0'
        secretHeaders:
          description: Sensitive HTTP headers (tokens, keys) that should be masked in logs
          type: object
          additionalProperties:
            type: string
          example:
            Authorization: Bearer {{token}}
        url:
          description: Custom webhook endpoint URL
          type: string
          example: https://api.custom-service.com/alerts
    DiscordConfig:
      description: Configuration for Discord notifications using bot token
      properties:
        discordChannel:
          description: Discord channel ID to send notifications
          type: string
          example: '123456789012345678'
        discordToken:
          description: Discord bot token for authentication
          type: string
          example: Bot 123456789012345678
    DiscordWebhookConfig:
      description: Configuration for Discord notifications using webhooks
      properties:
        discordWebhookUrl:
          description: Discord webhook URL
          type: string
          example: >-
            https://discord.com/api/webhooks/123456789012345678/XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
    EmailConfig:
      description: Configuration for email notifications
      properties:
        emails:
          description: List of email addresses to receive notifications
          type: array
          items:
            type: string
          example:
            - oncall@example.com
            - alerts@example.com
    MicrosoftTeamsConfig:
      description: Configuration for Microsoft Teams notifications
      properties:
        microsoftTeamsUrl:
          description: Microsoft Teams webhook URL
          type: string
          example: https://outlook.office.com/webhook/123456789/IncomingWebhook/...
    OpsGenieConfig:
      description: Configuration for OpsGenie integration
      properties:
        apiKey:
          description: OpsGenie API key for authentication
          type: string
          example: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
        isEU:
          description: Whether to use EU region endpoints
          type: boolean
          example: true
    PagerDutyConfig:
      description: Configuration for PagerDuty integration
      properties:
        routingKey:
          description: PagerDuty integration key for routing alerts
          type: string
          example: 1234567890abcdef1234567890abcdef
        token:
          description: PagerDuty API token for additional functionality
          type: string
          example: u+1234567890abcdef1234567890abcdef
    SlackConfig:
      description: Configuration for Slack notifications using incoming webhooks
      properties:
        slackUrl:
          description: Slack incoming webhook URL
          type: string
          example: >-
            https://hooks.slack.com/services/T00000000/B00000000/XXXXXXXXXXXXXXXXXXXXXXXX
    WebhookConfig:
      description: Configuration for simple webhook notifications
      properties:
        url:
          description: Webhook endpoint URL
          type: string
          example: https://api.example.com/webhooks/alerts
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: >-
        Authenticate using an API token or personal access token (PAT). Include
        the token as a Bearer token: `Authorization: Bearer <token>`. For more
        information, see [Tokens](/reference/tokens).
    Auth:
      description: >-
        Authenticate using an API token or personal access token (PAT). Include
        the token as a Bearer token: `Authorization: Bearer <token>`. For more
        information, see [Tokens](/reference/tokens).
      type: oauth2
      flows:
        authorizationCode:
          authorizationUrl: https://accounts.google.com/o/oauth2/v2/auth
          tokenUrl: https://www.googleapis.com/oauth2/v4/token
          scopes: {}

````