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

# Monitor Bijwerken

> Werk frequentie, metadata, notificatie en/of webhook bij. Frequentiewijzigingen maken het schema opnieuw aan. Geeft 409 terug terwijl de status aan het inrichten is.

<Tip>
  **Merge-semantiek:** Metadata-updates volgen de aanpak van Stripe — nieuwe sleutels worden toegevoegd, bestaande sleutels worden bijgewerkt, en sleutels die zijn ingesteld op een lege string `""` worden verwijderd.
</Tip>


## OpenAPI

````yaml nl/openapi/monitors.json POST /v1/monitors/{monitor_id}
openapi: 3.0.3
info:
  title: Monitors API
  version: 1.0.0
servers:
  - url: https://api.olostep.com
security: []
paths:
  /v1/monitors/{monitor_id}:
    post:
      summary: Update Monitor
      description: >-
        Update `frequency`, `metadata`, `notification`, en/of `webhook`.
        Frequentiewijzigingen verwijderen en maken het onderliggende schema
        opnieuw aan. Stel `webhook` in op `null` om het te verwijderen. Geeft
        `409` terug terwijl `status` `provisioning` is.
      parameters:
        - name: monitor_id
          in: path
          required: true
          schema:
            type: string
            pattern: ^monitor_
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                frequency:
                  type: string
                  description: >-
                    Natuurlijke-taal schema tekst. Maakt het interne schema
                    opnieuw aan.
                metadata:
                  type: object
                  additionalProperties: true
                  description: >-
                    Samengevoegd met bestaande metadata; lege tekenreekswaarden
                    verwijderen sleutels.
                notification:
                  $ref: '#/components/schemas/MonitorNotification'
                webhook:
                  allOf:
                    - $ref: '#/components/schemas/MonitorWebhook'
                  nullable: true
                  description: Geef `null` door om de webhook te verwijderen.
      responses:
        '200':
          description: Monitor bijgewerkt.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Monitor'
        '400':
          description: Ongeldige aanvraag of monitor verwijderd.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '401':
          description: Ongeldige API-sleutel.
        '404':
          description: Monitor niet gevonden.
        '409':
          description: Monitor is nog steeds aan het inrichten.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '500':
          description: Interne serverfout.
      security:
        - Authorization: []
components:
  schemas:
    MonitorNotification:
      type: object
      properties:
        events:
          type: array
          items:
            type: string
            enum:
              - changed
              - first_snapshot
          description: >-
            Wanneer te informeren. `changed` — lever wanneer een verandering
            wordt gedetecteerd ten opzichte van de vorige snapshot.
            `first_snapshot` — lever wanneer de eerste basislijnsnapshot wordt
            genomen. Standaard beide wanneer `channels` niet leeg is en `events`
            leeg is.
        channels:
          type: array
          items:
            $ref: '#/components/schemas/NotificationChannel'
          description: >-
            E-mail, Slack, of SMS leveringsdoelen. Opgelost tijdens runtime door
            de monitorpipeline.
    MonitorWebhook:
      type: object
      required:
        - url
      properties:
        url:
          type: string
          format: uri
          description: >-
            HTTP/HTTPS URL die monitorpayloads ontvangt (afzonderlijk van
            `notification.channels`).
    Monitor:
      type: object
      properties:
        id:
          type: string
          description: Unieke monitoridentificatie (`monitor_…`).
        object:
          type: string
          example: monitor
        query:
          type: string
          description: Monitoring intentie in natuurlijke taal.
        tracked:
          $ref: '#/components/schemas/MonitorTracked'
        source_policy:
          $ref: '#/components/schemas/MonitorSourcePolicy'
        schedule:
          $ref: '#/components/schemas/MonitorSchedule'
        notification:
          $ref: '#/components/schemas/MonitorNotification'
        webhook:
          allOf:
            - $ref: '#/components/schemas/MonitorWebhook'
          nullable: true
        output_schema:
          type: object
          additionalProperties: true
          nullable: true
          description: Optioneel JSON Schema voor gestructureerde extractie-output.
        status:
          type: string
          enum:
            - provisioning
            - active
            - paused
            - failed
            - deleted
          description: Monitor levenscyclusstatus.
        error_message:
          type: string
          nullable: true
          description: Aanwezig wanneer `status` `failed` is.
        last_run:
          allOf:
            - $ref: '#/components/schemas/MonitorLastRun'
          nullable: true
          description: >-
            Laatste snapshot samenvatting. Inbegrepen bij `GET
            /v1/monitors/{monitor_id}`.
        agent:
          $ref: '#/components/schemas/MonitorAgent'
        metadata:
          type: object
          additionalProperties: true
        created:
          type: integer
          description: Unix-timestamp (seconden).
        updated:
          type: integer
          description: Unix-timestamp (seconden).
        total_count:
          type: integer
          description: >-
            Totaal aantal snapshots. Inbegrepen bij `GET
            /v1/monitors/{monitor_id}` tenzij `include_total_count=false`.
        mermaid_diagram:
          type: string
          description: >-
            Mermaid-stroomdiagram van de monitor DAG. Inbegrepen wanneer
            `include-diagram=true` bij ophalen.
    ErrorResponse:
      type: object
      properties:
        error:
          type: string
        monitor_id:
          type: string
          description: Aanwezig bij sommige foutreacties bij aanmaken/bijwerken.
    NotificationChannel:
      type: object
      required:
        - type
        - target
      properties:
        type:
          type: string
          enum:
            - email
            - slack
            - sms
          description: Type leveringskanaal.
        target:
          type: string
          description: E-mailadres, Slack webhook URL, of E.164 telefoonnummer (voor SMS).
        events:
          type: array
          items:
            type: string
            enum:
              - changed
              - first_snapshot
          description: >-
            Optionele per-kanaal gebeurtenisfilter. Wanneer weggelaten, volgt
            kanaallevering de bovenliggende `notification.events` (of
            standaardinstellingen wanneer kanalen zijn ingesteld).
    MonitorTracked:
      type: object
      description: Opgeloste doelen die de monitor volgt nadat de planning is voltooid.
      properties:
        type:
          type: string
          nullable: true
          description: Getraceerd oppervlaktype (bijvoorbeeld `url` of `web_query`).
        urls:
          type: array
          items:
            type: string
            format: uri
          description: Concrete URLs die worden gemonitord.
        web_query:
          type: string
          nullable: true
          description: >-
            Webzoekopdracht gebruikt wanneer de monitor een dynamische
            resultaatset volgt.
    MonitorSourcePolicy:
      type: object
      description: >-
        Optionele URL/domein toestaan- en weigerenlijsten toegepast tijdens
        planning en uitvoering.
      properties:
        include_urls:
          type: array
          items:
            type: string
            format: uri
        exclude_urls:
          type: array
          items:
            type: string
            format: uri
        include_domains:
          type: array
          items:
            type: string
        exclude_domains:
          type: array
          items:
            type: string
    MonitorSchedule:
      type: object
      properties:
        frequency:
          type: string
          nullable: true
          description: Natuurlijk-taal schema tekst (bijvoorbeeld `elke uur`).
        cron:
          type: string
          nullable: true
          description: Cron-expressie afgeleid van `frequency`.
        timezone:
          type: string
          example: UTC
          description: Schema tijdzone. Momenteel `UTC` voor monitorschema's.
        next_run_at:
          type: string
          format: date-time
          nullable: true
          description: >-
            Volgende geplande uitvoering (ISO 8601). `null` wanneer de monitor
            niet `active` is.
    MonitorLastRun:
      type: object
      properties:
        id:
          type: string
          nullable: true
          description: Run ID van de laatste snapshot (`run_…`).
        status:
          type: string
          example: completed
        change_detected:
          type: boolean
          nullable: true
        ran_at:
          type: string
          format: date-time
          nullable: true
    MonitorAgent:
      type: object
      properties:
        id:
          type: string
          nullable: true
          description: Interne shadow agent ID gebruikt om de monitor DAG uit te voeren.
  securitySchemes:
    Authorization:
      type: http
      scheme: bearer
      description: >-
        Bearer authenticatie header in de vorm Bearer <token>, waar <token> jouw
        auth token is.

````