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

# Update a Monitor



## OpenAPI

````yaml PUT /monitor/{id}
openapi: 3.1.0
info:
  title: Lumos API
  version: 1.0.0
  description: Lumos RESTful API
  x-logo:
    url: >-
      https://zorp.zeetco.com/static/media/mark-white.8c3b78e3c878db1859b6319c98dc38b6.svg
    altText: Zeet Logo
  contact:
    email: support@zeet.co
servers:
  - url: https://api.alerty.ai
security: []
paths:
  /monitor/{id}:
    put:
      summary: Update a Monitor
      operationId: updateMonitor
      parameters:
        - name: id
          in: path
          required: true
          schema:
            $ref: '#/components/schemas/UUID'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/Monitor'
      responses:
        '200':
          description: successful updated monitor
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Monitor'
        '400':
          $ref: '#/components/responses/BadRequest'
        '404':
          $ref: '#/components/responses/NotFound'
        '500':
          $ref: '#/components/responses/ServerError'
      security:
        - bearerAuth: []
        - cookieAuth: []
components:
  schemas:
    UUID:
      description: Unique identifier for the entity
      type: string
      format: uuid
      example: 5df33a85-2b9c-40e3-8854-760ee3b8efc7
      x-go-name: ID
    Monitor:
      allOf:
        - $ref: '#/components/schemas/BaseEntity'
        - $ref: '#/components/schemas/MonitorIntervalConfiguration'
        - type: object
          description: resource monitor
          properties:
            name:
              type: string
              description: the monitor name
            description:
              type: string
              description: the monitor description
            type:
              type: string
              description: the monitor type
              enum:
                - UP_TIME
                - LATENCY
                - LOAD_TIME
                - WEBSITE_TYPO
                - STRIPE
                - DOMAIN_EXPIRATION
                - CERT_EXPIRATION
                - CDN_CONFIGURATION
                - CLOUDFLARE_REQUESTS
                - CLOUDFRONT_REQUESTS
                - STATUS_PAGE
                - DATABASE_STORAGE_LIMIT
                - DATABASE_CPU_USAGE
                - DATABASE_MEMORY_USAGE
              x-enumNames:
                - UpTimeMonitorType
                - LatencyMonitorType
                - LoadTimeMonitorType
                - WebsiteTypoMonitorType
                - StripeMonitorType
                - DomainExpirationMonitorType
                - CertExpirationMonitorType
                - CDNConfigurationMonitorType
                - CloudflareRequestsMonitorType
                - CloudFrontRequestsMonitorType
                - StatusPageMonitorType
                - DatabaseStorageLimitType
                - DatabaseCPUUsageType
                - DatabaseMemoryUsageType
            resourceId:
              type: string
              format: uuid
              x-go-name: ResourceID
            snoozedUntil:
              type: string
              description: until when the monitor will be in snoozed mode
              format: date-time
            state:
              type: string
              description: state of the monitor during its lifecycle
              enum:
                - ACTIVE
                - PAUSED
                - SNOOZED
                - ERROR
              x-enumNames:
                - ActiveMonitorState
                - PausedMonitorState
                - SnoozedMonitorState
                - ErrorMonitorState
            status:
              type: string
              description: status of the monitor
              enum:
                - NO_DATA
                - OK
                - ALERT
                - WARN
              x-enumNames:
                - NoDataMonitorStatus
                - OKMonitorStatus
                - AlertMonitorStatus
                - WarnMonitorStatus
            priority:
              type: string
              description: monitor priority
              enum:
                - NOT_DEFINED
                - CRITICAL
                - HIGH
                - MEDIUM
                - LOW
                - INFO
              x-enumNames:
                - NoDefinedMonitorPriority
                - CriticalMonitorPriority
                - HighMonitorPriority
                - MediumMonitorPriority
                - LowMonitorPriority
                - InfoMonitorPriority
            recipients:
              type: array
              description: the monitor recipients of the incidents/alerts notifications
              items:
                $ref: '#/components/schemas/MonitorRecipient'
            query:
              type: string
              description: the monitor query
            resource:
              $ref: '#/components/schemas/Resource'
          required:
            - name
            - type
            - resourceId
            - state
            - status
            - priority
            - configuration
            - recipients
    BaseEntity:
      type: object
      properties:
        id:
          $ref: '#/components/schemas/UUID'
        createdAt:
          type: string
          format: date-time
        updatedAt:
          type: string
          format: date-time
      required:
        - id
        - createdAt
        - updatedAt
    MonitorIntervalConfiguration:
      type: object
      description: the common monitor interval configuration
      properties:
        pollDurationInterval:
          type: string
          format: duration
          description: the interval in which the monitor will be checked
          example: P3Y6M4DT12H30M5S
    MonitorRecipient:
      allOf:
        - $ref: '#/components/schemas/BaseEntity'
        - type: object
          properties:
            integration:
              $ref: '#/components/schemas/Integration'
            integrationOverride:
              $ref: '#/components/schemas/IntegrationConfiguration'
          required:
            - integration
    Resource:
      allOf:
        - $ref: '#/components/schemas/BaseEntity'
        - type: object
          properties:
            name:
              type: string
              description: the inventory resource name
            type:
              $ref: '#/components/schemas/ResourceType'
            configuration:
              $ref: '#/components/schemas/ResourceConfiguration'
          required:
            - name
            - type
            - configuration
    ApiError:
      type: object
      properties:
        code:
          type: integer
          description: a custom Lumos error code
          format: uint64
          example: 1400
        field:
          type: string
          description: the field that this error is associated with, if applicable
          example: name
        description:
          type: string
          description: a description for this error
          example: A descriptive error message
      required:
        - description
    Integration:
      allOf:
        - $ref: '#/components/schemas/BaseEntity'
        - type: object
          description: the integration information
          properties:
            type:
              $ref: '#/components/schemas/IntegrationType'
            class:
              $ref: '#/components/schemas/IntegrationClass'
            configuration:
              $ref: '#/components/schemas/IntegrationConfiguration'
          required:
            - type
            - class
            - configuration
    IntegrationConfiguration:
      oneOf:
        - $ref: '#/components/schemas/SlackIntegrationConfiguration'
        - $ref: '#/components/schemas/EmailIntegrationConfiguration'
    ResourceType:
      type: string
      description: the inventory resource type
      enum:
        - WEBSITE
        - DATABASE
        - COMPUTE
        - STRIPE
        - AWS_CLOUDFRONT
        - CLOUDFLARE
        - STATUS_PAGE
        - RDS_DATABASE
      x-enumNames:
        - WebsiteResource
        - DatabaseResource
        - ComputeResource
        - StripeResource
        - CloudFrontResource
        - CloudflareResource
        - StatusPageResource
        - RDSDatabaseResource
    ResourceConfiguration:
      oneOf:
        - $ref: '#/components/schemas/WebsiteResourceConfiguration'
        - $ref: '#/components/schemas/DatabaseResourceConfiguration'
        - $ref: '#/components/schemas/ComputeResourceConfiguration'
        - $ref: '#/components/schemas/StripeResourceConfiguration'
        - $ref: '#/components/schemas/CloudFrontResourceConfiguration'
        - $ref: '#/components/schemas/CloudflareResourceConfiguration'
        - $ref: '#/components/schemas/StatusPageResourceConfiguration'
        - $ref: '#/components/schemas/RDSDatabaseResourceConfiguration'
    IntegrationType:
      type: string
      description: the integration type
      enum:
        - SLACK
        - PAGERDUTY
        - EMAIL
      x-enumNames:
        - SlackIntegrationType
        - PagerDutyIntegrationType
        - EmailIntegrationType
    IntegrationClass:
      type: string
      description: the integration class
      enum:
        - NOTIFICATION
        - CLOUD_PROVIDER
      x-enumNames:
        - NotificationIntegrationClass
        - CloudProviderIntegrationClass
    SlackIntegrationConfiguration:
      type: object
      description: the slack integration configuration
      properties:
        teamId:
          type: string
          description: the team ID associated with the integration/app
          x-go-name: TeamID
        accessToken:
          type: string
          description: the slack access token returned from the oauth
        incomingWebhookURL:
          type: string
          description: the slack incoming webhook url returned from the oauth
        channelID:
          type: string
          description: the default slack channel
      required:
        - teamId
        - accessToken
        - incomingWebhookURL
    EmailIntegrationConfiguration:
      type: object
      description: the email integration configuration
      properties:
        emailAddress:
          type: string
          description: the address to receive emails
        verificationCompletedAt:
          type: string
          format: date-time
          nullable: true
      required:
        - emailAddress
    WebsiteResourceConfiguration:
      type: object
      properties:
        url:
          type: string
          description: the website resource URL
          x-go-name: URL
      required:
        - url
    DatabaseResourceConfiguration:
      type: object
      properties:
        engine:
          type: string
          description: the database engine
          enum:
            - MONGO_DB
            - POSTGRES
            - MYSQL
            - SUPABASE
          x-enumNames:
            - MongoDBEngine
            - PostgresEngine
            - MySQLEngine
            - SupabaseEngine
      required:
        - engine
    ComputeResourceConfiguration:
      type: object
      properties:
        provider:
          type: string
          description: the compute solution provider
          enum:
            - AWS_LAMBDA
            - GCP_CLOUD_RUN
          x-enumNames:
            - AWSLambdaProvider
            - GCPCloudRunProvider
      required:
        - provider
    StripeResourceConfiguration:
      type: object
      properties:
        accessToken:
          type: string
          description: the Stripe account access token
      required:
        - accessToken
    CloudFrontResourceConfiguration:
      type: object
      properties:
        distributionId:
          type: string
          description: the CloudFront distribution ID
        awsAccessKeyId:
          type: string
          description: the AWS access key ID
        awsSecretAccessKey:
          type: string
          description: the AWS secret access key
      required:
        - distributionId
        - awsAccessKeyId
        - awsSecretAccessKey
    CloudflareResourceConfiguration:
      type: object
      properties:
        zoneId:
          type: string
          description: the Cloudflare zone ID
        apiToken:
          type: string
          description: the Cloudflare API Token
      required:
        - zoneId
        - apiToken
    StatusPageResourceConfiguration:
      type: object
      properties:
        slug:
          type: string
          description: used to create a resource for a pre-configured status page
    RDSDatabaseResourceConfiguration:
      type: object
      properties:
        instanceId:
          type: string
          description: the rds instance identifier
          x-go-name: InstanceID
        awsAccessKeyId:
          type: string
          description: the AWS access key ID
          x-go-name: AWSAccessKeyID
        awsSecretAccessKey:
          type: string
          description: the AWS secret access key
          x-go-name: AWSSecretAccessKey
        region:
          type: string
          description: the rds instance region
      required:
        - instanceId
        - awsAccessKeyId
        - awsSecretAccessKey
  responses:
    BadRequest:
      description: The request is malformed
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ApiError'
    NotFound:
      description: The resource was not found
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ApiError'
    ServerError:
      description: Server error
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ApiError'
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
    cookieAuth:
      type: apiKey
      in: cookie
      name: __lumos_session

````