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

# Update a monitor

> Pause or resume a monitor, or replace its notification channels

export const MonitorsExperimental = () => <Warning>
    <strong>Monitors is experimental.</strong> Request and payload shapes can change without a deprecation window. Monitors isn't recommended for production workflows.
  </Warning>;

<MonitorsExperimental />

## Notes

* To authenticate, you'll need a [Tako API key](https://tako.com/console/api-keys). It's best practice to store it as an environment variable to avoid hardcoding sensitive credentials in your code.
* Send `status`, `channel_ids`, or both. No other field changes after you create a monitor. To change a monitor's type, parameters, or window, [delete it](/api-reference/monitors-delete) and create a new one.
* `channel_ids` replaces the monitor's channels with the list you send. An empty list keeps the monitor recording firings, and delivers them to no channel. Every id must be a channel you own.
* If the monitor's `active_until` has already passed, resuming returns `400`, because the monitor is expired rather than paused. Create a new monitor with a new window.
* Resuming sets `last_evaluation_outcome` back to `null`, because the pause makes the earlier outcome meaningless.
* If resuming would put you over your active monitor limit, this endpoint returns `400` with `error_type: LIMIT_REACHED` and a `limit` giving your cap. Pause or delete another monitor first. A monitor's own paused slot never blocks its resume.
* Pausing keeps the monitor and its firings. When you want to keep the history, pause the monitor instead of [deleting it](/api-reference/monitors-delete).


## OpenAPI

````yaml PATCH /v1/monitors/{id}
openapi: 3.1.0
info:
  title: Knowledge Search API
  version: 1.0.0
servers:
  - url: https://tako.com/api/
    description: Tako Production API Server
security: []
paths:
  /v1/monitors/{id}:
    parameters:
      - description: Resource id
        required: true
        schema:
          type: string
          format: uuid
        name: id
        in: path
    patch:
      tags:
        - monitors
      summary: Update a monitor's status, channels, or actions
      description: >-
        Set status to paused to stop evaluating the monitor, or to active to
        resume it. Set channel_ids to replace the monitor's destinations; an
        empty list keeps the monitor recording firings with no destination. Set
        actions to replace what the monitor does after it fires; an empty list
        removes every action. Send any combination of the three. If the
        monitor's active_until has already passed, resuming returns 400. No
        other field changes after you create a monitor.


        **Experimental.** Request and payload shapes can change without a
        deprecation window. Monitors isn't recommended for production workflows.
      operationId: patchMonitor
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/MonitorPatch'
        required: true
      responses:
        '200':
          description: One monitor
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/MonitorResponse'
        '400':
          description: >-
            Invalid request, or resuming the monitor would put you over your
            active monitor limit. The error_type is LIMIT_REACHED, and limit is
            the cap.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/MonitorCreateRejected'
        '401':
          description: Missing or invalid API key.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BaseAPIError'
        '404':
          description: You don't own a resource with this id.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BaseAPIError'
      security:
        - apiKey: []
components:
  schemas:
    MonitorPatch:
      properties:
        status:
          anyOf:
            - $ref: '#/components/schemas/MonitorStatus'
            - type: 'null'
          description: Set paused to stop evaluating, or active to resume.
        channel_ids:
          anyOf:
            - items:
                type: string
                format: uuid
              type: array
              maxItems: 20
            - type: 'null'
          title: Channel Ids
          description: >-
            Replace the monitor's destinations with this set. Empty means the
            monitor keeps recording firings and delivers to none.
        actions:
          anyOf:
            - items:
                additionalProperties: true
                type: object
              type: array
              maxItems: 5
            - type: 'null'
          title: Actions
          description: >-
            Replace the monitor's actions with this list. An empty list removes
            every action. Each entry is an object with kind, that kind's
            parameters, and optionally channel_ids. channel_ids sets where the
            action's output goes: leave it out to use the monitor's channels,
            list channels you own to use those, or send an empty list to keep
            the output in Tako. Actions aren't available yet, so a non-empty
            list returns 400.
      type: object
      title: MonitorPatch
    MonitorResponse:
      properties:
        id:
          type: string
          format: uuid
          title: Id
        name:
          type: string
          title: Name
        type:
          type: string
          title: Type
        parameters:
          additionalProperties: true
          type: object
          title: Parameters
          description: >-
            The parameters in the form createMonitor accepts, as this type's
            parameters_schema describes them. The ids Tako resolved them to
            never appear here. The names come back as Tako resolved them rather
            than as you typed them, so a stock monitor created with ticker aapl
            reads back ticker AAPL and the exchange MIC that resolution picked.
            A type whose input accepts more than one name for a subject can
            return a different one than you sent: a crypto monitor names the
            asset by coinmarketcap_id whichever name you created it with. A
            monitor Tako can no longer render against its type's current schema
            returns a reduced form; subject still names what it watches.
        subject:
          additionalProperties:
            $ref: '#/components/schemas/Scalar'
          type: object
          title: Subject
          description: >-
            The subject the type resolved from your parameters, such as the
            listing that a ticker matched, in the shape listMonitorTypes returns
            as subject_schema. Check it before you rely on the monitor. Tako
            resolves it once, when you create the monitor, and never re-resolves
            it, so it names what the monitor watches rather than what that
            subject is called today. Empty for a type that resolves no subject.
        fire_once:
          type: boolean
          title: Fire Once
        status:
          $ref: '#/components/schemas/MonitorStatus'
        status_reason:
          anyOf:
            - $ref: '#/components/schemas/StatusReason'
            - type: 'null'
          description: >-
            Why Tako paused the monitor. Null while the monitor is active, and
            null when you paused it yourself.
        active_from:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Active From
        active_until:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Active Until
        last_evaluated_at:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Last Evaluated At
          description: >-
            When Tako last evaluated this monitor. Null until the first
            evaluation.
        last_evaluation_outcome:
          anyOf:
            - $ref: '#/components/schemas/EvaluationOutcome'
            - type: 'null'
          description: >-
            How that evaluation ended. Null until the first evaluation, and null
            again after you resume a paused monitor, because the pause makes the
            earlier outcome meaningless. On an active monitor with no firings, a
            recent predates_monitor or before_window means the monitor is
            running and waiting for an occurrence that happens after you created
            it. no_occurrence means the type found no occurrence, which includes
            finding no usable data to compare.
        channel_ids:
          items:
            type: string
            format: uuid
          type: array
          title: Channel Ids
        actions:
          items:
            additionalProperties: true
            type: object
          type: array
          title: Actions
          description: >-
            The monitor's actions as Tako stored them: the fields you set on
            each action, and channel_ids only on an action where you set it. A
            field you left out takes the kind's default when the action runs.
            Empty for a monitor with no actions.
        created_at:
          type: string
          format: date-time
          title: Created At
        updated_at:
          type: string
          format: date-time
          title: Updated At
      type: object
      required:
        - id
        - name
        - type
        - parameters
        - subject
        - fire_once
        - status
        - status_reason
        - active_from
        - active_until
        - last_evaluated_at
        - last_evaluation_outcome
        - channel_ids
        - actions
        - created_at
        - updated_at
      title: MonitorResponse
    MonitorCreateRejected:
      properties:
        error_message:
          type: string
          title: Error Message
        error_type:
          $ref: '#/components/schemas/MonitorCreateErrorType'
        candidates:
          items:
            additionalProperties:
              $ref: '#/components/schemas/Scalar'
            type: object
          type: array
          title: Candidates
          default: []
        limit:
          anyOf:
            - type: integer
            - type: 'null'
          title: Limit
      type: object
      required:
        - error_message
        - error_type
      title: MonitorCreateRejected
      description: >-
        The 400 response from createMonitor, createNotificationChannel, and
        patchMonitor. When

        error_type is AMBIGUOUS_SUBJECT, candidates lists every subject the
        parameters could have

        matched, best first, so you can narrow them and retry. When error_type
        is LIMIT_REACHED,

        limit is how many active monitors or notification channels you may hold.
        Tako counts that

        limit per user rather than pooling it across an account, and the message
        says how to free

        one, or where to ask for an enterprise limit. For any other error_type,
        candidates is empty

        and limit is null.
    BaseAPIError:
      properties:
        error_message:
          type: string
          title: Error Message
        error_type:
          $ref: '#/components/schemas/APIErrorType'
      type: object
      required:
        - error_message
        - error_type
      title: BaseAPIError
    MonitorStatus:
      type: string
      enum:
        - active
        - paused
      title: MonitorStatus
    Scalar:
      anyOf:
        - type: string
        - type: integer
        - type: number
        - type: boolean
        - type: 'null'
    StatusReason:
      type: string
      enum:
        - fired_once
        - unloadable
        - expired
        - completed
      title: StatusReason
    EvaluationOutcome:
      type: string
      enum:
        - fired
        - already_fired
        - no_occurrence
        - predates_monitor
        - outside_lookback
        - unloadable
        - completed
        - unknown_type
        - inactive
        - deleted
        - expired
        - before_window
        - crashed
      title: EvaluationOutcome
      description: >-
        How one evaluation of a monitor ended. `fired` recorded a firing, and
        `already_fired` found that occurrence already recorded. `no_occurrence`
        found the condition unmet, which includes finding no usable data to
        compare. `predates_monitor` and `before_window` found an occurrence from
        before the monitor or its `active_from`, and `outside_lookback` found
        one too old to report. `expired`, `unloadable`, and `unknown_type` say
        why the evaluation stopped before it read any data. `completed` means
        the subject reached an end state, so the condition can never be met
        again, and `crashed` means the type failed while reading the data.
        `deleted` and `inactive` never appear on a monitor.
    MonitorCreateErrorType:
      type: string
      enum:
        - BAD_REQUEST
        - AMBIGUOUS_SUBJECT
        - LIMIT_REACHED
      title: MonitorCreateErrorType
      description: Why a monitors operation refused the request.
    APIErrorType:
      type: string
      enum:
        - BAD_REQUEST
        - AUTHENTICATION_ERROR
        - INTERNAL_SERVER_ERROR
        - RELEVANT_RESULTS_NOT_FOUND
        - RATE_LIMIT_EXCEEDED
        - PAYMENT_REQUIRED
        - REQUEST_TIMEOUT
        - FORBIDDEN
        - NOT_FOUND
        - SERVICE_UNAVAILABLE
        - SERVICE_OVERLOADED
        - UNSUPPORTED_CONTENT_FORMAT
        - PLACEHOLDER_CARD
        - VARIABLE_COST_NOT_REQUESTED
      title: APIErrorType
  securitySchemes:
    apiKey:
      type: apiKey
      name: X-API-Key
      in: header

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.