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

# Update a monitor



## OpenAPI

````yaml /openapi.json put /monitors/{id}
openapi: 3.0.0
info:
  title: Uptime Monitor API
  description: >-
    API documentation for the Uptime Monitor application. This API allows users
    to create and manage website monitors, perform checks, and view statistics.
  version: '1.0'
  contact: {}
servers:
  - url: https://api.justanotheruptime.com
security: []
tags:
  - name: auth
    description: Authentication endpoints
  - name: projects
    description: Project management endpoints
  - name: monitors
    description: Monitor management endpoints
  - name: checks
    description: Check-related endpoints
  - name: statistics
    description: Monitor statistics endpoints
paths:
  /monitors/{id}:
    put:
      tags:
        - Monitors
      summary: Update a monitor
      operationId: MonitorController_update
      parameters:
        - name: id
          required: true
          in: path
          schema:
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpdateMonitorDto'
      responses:
        '200':
          description: The monitor has been successfully updated.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Monitor'
        '404':
          description: Monitor not found.
      security:
        - bearer: []
components:
  schemas:
    UpdateMonitorDto:
      type: object
      properties:
        name:
          type: string
          description: The name of the monitor
        url:
          type: string
          description: The URL to monitor
        interval:
          type: number
          description: The interval between checks in seconds
          minimum: 60
          maximum: 86400
        isActive:
          type: boolean
          description: Whether the monitor is active
          default: true
        projectId:
          type: string
          description: The project ID this monitor belongs to
        settings:
          $ref: '#/components/schemas/MonitorSettings'
        notifications:
          $ref: '#/components/schemas/MonitorNotifications'
        regions:
          description: Selected monitoring regions
          type: array
          items:
            type: string
      required:
        - isActive
        - projectId
        - settings
        - notifications
        - regions
    Monitor:
      type: object
      properties: {}
    MonitorSettings:
      type: object
      properties:
        timeout:
          type: number
          description: Request timeout in seconds
          minimum: 1
          maximum: 30
        retries:
          type: number
          description: Number of retries before marking as failed
          minimum: 0
        alertThreshold:
          type: number
          description: Alert threshold for consecutive failures
          minimum: 1
        expectedStatusCode:
          type: number
          description: Expected HTTP status code
        expectedResponse:
          type: string
          description: Expected response content
        method:
          type: string
          description: HTTP method
          default: GET
        headers:
          type: object
          description: Custom request headers
        body:
          type: string
          description: Request body
      required:
        - timeout
        - retries
        - alertThreshold
        - expectedStatusCode
        - expectedResponse
        - method
        - headers
        - body
    MonitorNotifications:
      type: object
      properties:
        enabled:
          type: boolean
          description: Enable notifications
          default: true
        email:
          type: boolean
          description: Enable email notifications
          default: true
        slack:
          type: boolean
          description: Enable Slack notifications
          default: false
        discord:
          type: boolean
          description: Enable Discord notifications
          default: false
        teams:
          type: boolean
          description: Enable Teams notifications
          default: false
        webhook:
          type: boolean
          description: Enable webhook notifications
          default: false
        threshold:
          type: number
          description: Notification threshold
          minimum: 1
        recipients:
          description: Notification recipients
          type: array
          items:
            type: string
      required:
        - enabled
        - email
        - slack
        - discord
        - teams
        - webhook
        - threshold
        - recipients
  securitySchemes:
    bearer:
      scheme: bearer
      bearerFormat: JWT
      type: http

````