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

# Update a Monitor

> Use this endpoint to update the name, status, and/or other details of an existing monitor.


This endpoint can update the monitor's `name`, `description`, `status` (`active` or `inactive`), `guardrail_metrics`, `web_search`, `file_search` when needed. Only fields provided in the request body will be updated.<br /><br />Setting `status` to `inactive` will stop the monitor from recording and evaluating new events.


## OpenAPI

````yaml /api-reference/openapi.yaml put /monitor/{monitor_id}
openapi: 3.0.0
info:
  title: DeepRails API
  description: >
    DeepRails is a powerful developer tool with a comprehensive set of adaptive
    & accurate guardrails to protect against LLM hallucinations - deploy our
    Monitor and Defend APIs in less than 15 minutes for the best out-of-the-box
    guardrails available.
  version: v3.0
  contact:
    name: DeepRails Support
    email: support@deeprails.ai
servers:
  - url: https://api.deeprails.com
    description: Production server
security:
  - BearerAuth: []
paths:
  /monitor/{monitor_id}:
    put:
      tags:
        - Monitor
      summary: Update a Monitor
      description: >
        Use this endpoint to update the name, status, and/or other details of an
        existing monitor.
      parameters:
        - name: monitor_id
          in: path
          description: The ID of the monitor to edit.
          required: true
          schema:
            type: string
      requestBody:
        required: false
        content:
          application/json:
            schema:
              type: object
              properties:
                name:
                  type: string
                  description: New name of the monitor.
                description:
                  type: string
                  description: New description of the monitor.
                status:
                  type: string
                  description: >-
                    Status of the monitor.  Can be `active` or `inactive`. 
                    Inactive monitors no longer record and evaluate events.
                  example: inactive
                  enum:
                    - active
                    - inactive
                guardrail_metrics:
                  type: array
                  description: >
                    An array of the new guardrail metrics that model input and
                    output pairs will be evaluated on.
                  items:
                    type: string
                    enum:
                      - correctness
                      - completeness
                      - instruction_adherence
                      - context_adherence
                      - ground_truth_adherence
                      - comprehensive_safety
                web_search:
                  type: boolean
                  description: Whether to enable web search for this monitor's evaluations.
                  default: false
                file_search:
                  type: array
                  description: >-
                    An array of file IDs to search in the monitor's evaluations.
                    Files must be uploaded via the DeepRails API first.
                  items:
                    type: string
                    description: >-
                      A file ID corresponding to a file to search in the
                      monitor's evaluations.
      responses:
        '200':
          description: Monitor updated successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/MonitorUpdateResponse'
        '400':
          description: Invalid request
        '401':
          description: Unauthorized
        '404':
          description: Monitor not found
      security:
        - BearerAuth: []
      x-codeSamples:
        - lang: python
          label: Update a Monitor
          source: |
            from deeprails import DeepRails

            DEEPRAILS_API_KEY = "YOUR_API_KEY"

            client = DeepRails(
                api_key=DEEPRAILS_API_KEY,
            )

            monitor_response = client.monitor.update(
                monitor_id="mon_xxxxxxxxxxxx",
                name="Chatbot Monitor - DEPRECATED",
                status="inactive",
                guardrail_metrics=[
                    "correctness",
                    "completeness",
                    "instruction_adherence"
                ],
                web_search=False,
                file_search=[],
                context_awareness=False,
            )
            print(monitor_response)
components:
  schemas:
    MonitorUpdateResponse:
      type: object
      properties:
        monitor_id:
          type: string
          description: A unique monitor ID.
          example: mon_xxxxxxxxxxxx
        status:
          type: string
          description: >-
            Status of the monitor.  Can be `active` or `inactive`.  Inactive
            monitors no longer record and evaluate events.
          example: active
          enum:
            - active
            - inactive
        modified_at:
          type: string
          format: date-time
          description: The time the monitor was last modified in UTC.
          example: '2025-01-15T10:30:00Z'
      required:
        - monitor_id
        - status
        - modified_at
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT

````