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

# Create a monitor

> Create a scheduled website change monitor with best-effort fast baseline capture.



## OpenAPI

````yaml /api-reference/openapi.yaml post /v1/monitors
openapi: 3.1.0
info:
  title: Gainflow API
  version: 1.1.0
  description: >
    Hard-to-get web data delivered to builders and AI agents. All public REST
    endpoints use snake_case JSON, RFC 9457 application/problem+json errors,
    opaque cursor pagination, and IETF RateLimit headers. Remote MCP server
    endpoint: https://mcp.gainflow.ai/mcp (OAuth 2.1 via WorkOS AuthKit or
    Bearer gf_live_*).
servers:
  - url: https://api.gainflow.ai
    description: Production
security:
  - bearerAuth: []
tags:
  - name: Scraping
    description: Fetch pages and PDFs, and discover URLs on a site.
  - name: Monitors
    description: Scheduled website change monitoring and diff history.
  - name: Webhooks
    description: Signed HMAC-SHA256 outbound webhook endpoints and delivery logs.
  - name: Batches
    description: Asynchronous bulk URL scraping jobs.
  - name: Crawls
    description: Asynchronous multi-page website crawls.
  - name: Account
    description: Credit balance, plan and the credit ledger.
  - name: API keys
    description: Create, list and revoke gf_live_* keys. Needs a signed-in OAuth session.
  - name: Billing
    description: Stripe Checkout and Customer Portal. Needs a signed-in OAuth session.
paths:
  /v1/monitors:
    post:
      tags:
        - Monitors
      summary: Create a monitor
      description: >-
        Create a scheduled website change monitor with best-effort fast baseline
        capture.
      operationId: createMonitor
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateMonitorRequest'
      responses:
        '201':
          description: Created monitor (baseline_status is ready or pending async capture)
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Monitor'
        '400':
          $ref: '#/components/responses/ProblemResponse'
        '401':
          $ref: '#/components/responses/ProblemResponse'
        '404':
          $ref: '#/components/responses/ProblemResponse'
        '429':
          $ref: '#/components/responses/ProblemResponse'
components:
  schemas:
    CreateMonitorRequest:
      type: object
      additionalProperties: false
      required:
        - url
      properties:
        url:
          type: string
          format: uri
          maxLength: 2048
        interval_sec:
          type: integer
          minimum: 300
          maximum: 604800
          default: 3600
        diff_mode:
          type: string
          enum:
            - text
            - json
          default: text
        parse:
          type: object
          additionalProperties:
            type: string
            minLength: 1
            maxLength: 256
        country:
          type: string
          pattern: ^[A-Z]{2}$
          default: US
        webhook_id:
          type: string
          format: uuid
    Monitor:
      type: object
      required:
        - id
        - url
        - interval_sec
        - diff_mode
        - country
        - webhook_id
        - status
        - baseline_status
        - last_checked_at
        - next_run_at
        - created_at
      properties:
        id:
          type: string
          format: uuid
        url:
          type: string
          format: uri
        interval_sec:
          type: integer
        diff_mode:
          type: string
          enum:
            - text
            - json
        country:
          type: string
        webhook_id:
          type:
            - string
            - 'null'
          format: uuid
        status:
          type: string
          enum:
            - active
            - paused
        baseline_status:
          type: string
          enum:
            - pending
            - ready
            - failed
        last_checked_at:
          type:
            - string
            - 'null'
          format: date-time
        next_run_at:
          type: string
          format: date-time
        created_at:
          type: string
          format: date-time
    ProblemDetails:
      type: object
      required:
        - type
        - title
        - status
        - code
        - request_id
      properties:
        type:
          type: string
          format: uri
        title:
          type: string
        status:
          type: integer
        detail:
          type: string
        code:
          type: string
          enum:
            - UNAUTHORIZED
            - FORBIDDEN
            - INSUFFICIENT_CREDITS
            - RATE_LIMITED
            - VALIDATION_ERROR
            - NOT_FOUND
            - CONFLICT
            - UPSTREAM_FAILED
            - INTERNAL_ERROR
        request_id:
          type: string
  responses:
    ProblemResponse:
      description: RFC 9457 Problem Details error
      content:
        application/problem+json:
          schema:
            $ref: '#/components/schemas/ProblemDetails'
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: Either a Gainflow API key (gf_live_*) or a WorkOS AuthKit OAuth 2.1 JWT.

````

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