> ## 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 Aanmaken

> Maakt een monitor aan vanuit een natuurlijke-taal query. Voorziet een shadow agent, genereert een workflow specificatie, plaatst DAG planning in de wachtrij, en plant terugkerende runs in. Configureer levering met notification.channels en/of webhook. Geeft 202 terug met status provisioning, of stream voortgang met ?stream=1.



## OpenAPI

````yaml nl/openapi/monitors.json POST /v1/monitors
openapi: 3.0.3
info:
  title: Monitors API
  version: 1.0.0
servers:
  - url: https://api.olostep.com
security: []
paths:
  /v1/monitors:
    post:
      summary: Maak Monitor
      description: >-
        Maakt een monitor van een natuurlijke-taal `query`, voorziet een interne
        agent en schema, genereert een workflow-spec en plaatst DAG-planning in
        de wachtrij. Geeft HTTP `202` terug met `status: provisioning` wanneer
        het verzoek voltooit zonder streaming. Geef `?stream=1` of `Accept:
        text/event-stream` door om Server-Sent Events te ontvangen voor
        provisioning-fasen en spec-redeneringstokens. De monitor wordt `active`
        nadat de planning de getraceerde doelen oplost.
      parameters:
        - name: stream
          in: query
          required: false
          schema:
            type: string
            enum:
              - '1'
              - 'true'
          description: >-
            Wanneer ingesteld, is de reactie `text/event-stream` met `phase`,
            `reasoning_token`, `complete`, en `error` gebeurtenissen.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - query
              properties:
                query:
                  type: string
                  description: Wat te monitoren, in natuurlijke taal.
                source_policy:
                  $ref: '#/components/schemas/MonitorSourcePolicy'
                frequency:
                  type: string
                  maxLength: 50
                  default: every hour
                  description: >-
                    Natuurlijke-taal schema (bijvoorbeeld `elke dag om 9 uur`).
                    Minimale interval is elke 10 minuten. Schema's gebruiken
                    UTC.
                notification:
                  $ref: '#/components/schemas/MonitorNotification'
                webhook:
                  $ref: '#/components/schemas/MonitorWebhook'
                metadata:
                  type: object
                  additionalProperties: true
                output_schema:
                  type: object
                  additionalProperties: true
                  description: JSON Schema voor gestructureerde extractie-output.
      responses:
        '200':
          description: >-
            Provisioning stream (`text/event-stream`) wanneer `stream=1`.
            Eindigt met een `complete` gebeurtenis die het monitorobject bevat.
          content:
            text/event-stream:
              schema:
                type: string
        '202':
          description: Monitor geaccepteerd; provisioning gestart (niet-streaming).
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Monitor'
        '400':
          description: >-
            Ongeldige aanvraag (query, frequency, source_policy, notification,
            webhook, metadata, of output_schema).
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '401':
          description: Ongeldige API-sleutel.
        '500':
          description: Interne serverfout bij het aanmaken van monitor.
        '503':
          description: FDA master agent niet beschikbaar tijdens provisioning.
      security:
        - Authorization: []
components:
  schemas:
    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
    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.
    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.

````