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

# Create webhook

> Create a new webhook for receiving event notifications.

By default, an organization is limited to have 5 webhooks per group.<br />If you need more webhooks, feel free to contact us and explain your needs, and we'll update your limits accordingly


## OpenAPI

````yaml https://api.dnsradar.dev/openapi.json post /webhooks
openapi: 3.0.3
info:
  title: DNSRadar API
  description: DNSRadar API - Monitor your DNS records and get notified when they change.
  version: 1.0.0
  contact:
    name: DNSRadar Support
    email: support@dnsradar.dev
    url: https://dnsradar.dev
servers:
  - url: https://api.dnsradar.dev
    description: Production server
security:
  - ApiKeyAuth: []
tags:
  - name: Agents
    description: Team member management and invitations
  - name: Organization
    description: Organization settings, billing, and subscription management
  - name: Monitors
    description: DNS monitoring configuration and management
  - name: Events
    description: DNS change events and history
  - name: Groups
    description: Monitor grouping and organization
  - name: Webhooks
    description: Webhook configuration for event notifications
paths:
  /webhooks:
    post:
      tags:
        - Webhooks
      summary: Create webhook
      description: Create a new webhook for receiving event notifications.
      operationId: createWebhook
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - url
                - method
              properties:
                url:
                  type: string
                  format: uri
                  maxLength: 2000
                  description: >-
                    Webhook endpoint URL (must not resolve to private/loopback
                    IPs)
                method:
                  type: string
                  enum:
                    - POST
                    - PUT
                    - DELETE
                    - PATCH
                  default: POST
                headers:
                  type: object
                  description: Custom HTTP headers
                  additionalProperties:
                    type: string
                secret:
                  type: string
                  description: Secret key for HMAC-SHA256 signing of webhook requests
                  example: Ultra Secure P@ssw0rd!
                groups:
                  type: array
                  items:
                    type: string
                  description: >-
                    Array of group identifiers (slug or UUID). Accepts either
                    group slugs or UUIDs (with 'grp_' prefix). If a slug is
                    provided and doesn't exist, a new group will be
                    automatically created with that slug.
                  example:
                    - production-servers
                    - grp_abc123...
      responses:
        '200':
          description: Webhook created
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Webhook'
        '400':
          $ref: '#/components/responses/ValidationError'
        '401':
          $ref: '#/components/responses/UnauthorizedError'
      security:
        - ApiKeyAuth: []
components:
  schemas:
    Webhook:
      type: object
      description: Webhook configuration for event notifications
      properties:
        id:
          type: string
          description: Webhook identifier with 'whk_' prefix
          example: whk_abc123...
        created:
          type: string
          format: date-time
          description: Webhook creation datetime in ISO 8601 format
        url:
          type: string
          format: uri
          description: Webhook endpoint URL
          example: https://api.server.com/webhook/dnsradar
        method:
          type: string
          enum:
            - POST
            - PUT
            - DELETE
            - PATCH
          default: POST
          description: HTTP method to use for the webhook
        headers:
          type: object
          nullable: true
          description: Custom HTTP headers as key-value pairs
          additionalProperties:
            type: string
          example:
            Authorization: Bearer abc123token
            X-Custom-Header: value
        secret:
          type: string
          nullable: true
          description: >-
            Secret key used for HMAC-SHA256 signing of webhook requests. The
            signature is sent in the X-Webhook-Signature header.
          example: Ultra Secure P@ssw0rd!
        is_active:
          type: boolean
          description: Whether webhook is active
        last_error:
          type: string
          nullable: true
          description: Last error message if any
          example: Timeout connecting to endpoint
        last_executed:
          type: string
          format: date-time
          nullable: true
          description: Datetime of last execution in ISO 8601 format
        groups:
          type: array
          description: List of group UUIDs associated with this webhook
          items:
            type: string
            description: Group UUID with 'grp_' prefix
          example:
            - grp_abc123...
            - grp_def456...
    Error:
      type: object
      description: Error response
      properties:
        code:
          type: integer
          description: HTTP status code
        error:
          oneOf:
            - type: string
              description: Error message
            - type: object
              description: Validation errors by field
              additionalProperties:
                type: string
        errors:
          type: object
          description: Field-specific validation errors
          additionalProperties:
            type: string
  responses:
    ValidationError:
      description: Validation error
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            code: 400
            errors:
              email: Invalid email format
    UnauthorizedError:
      description: Authentication is missing or invalid
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            code: 401
            error: Unauthorized
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: X-Api-Key
      description: >-
        API key used to authenticate yourself on DNSRadar. Obtain your API key
        from your DNSRadar dashboard.

````