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

# Change a monitor

> Change a monitor: its name, schedule, targets, webhook, retention, or pause and resume it. Send one request and get JSON back.

## Price

Free.

See [Pricing](https://docs.stophy.dev/account/pricing.md).

```bash cURL theme={null}
curl -X PATCH https://api.stophy.dev/v1/monitor/mon_gYdxFOZnpRdWHJUN \
  -H "Authorization: Bearer $STOPHY_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"name":"Docs example, renamed"}'
```

```typescript TypeScript theme={null}
const response = await fetch("https://api.stophy.dev/v1/monitor/mon_gYdxFOZnpRdWHJUN", {
  method: "PATCH",
  headers: {
    Authorization: `Bearer ${process.env.STOPHY_API_KEY}`,
    "Content-Type": "application/json",
  },
  body: JSON.stringify({ name: "Docs example, renamed" }),
});
console.log(await response.json());
```

```python Python theme={null}
import os

import requests

response = requests.patch(
    "https://api.stophy.dev/v1/monitor/mon_gYdxFOZnpRdWHJUN",
    headers={"Authorization": f"Bearer {os.environ['STOPHY_API_KEY']}"},
    json={"name": "Docs example, renamed"},
)
print(response.json())
```

```json 200 theme={null}
{
  "success": true,
  "data": {
    "id": "mon_gYdxFOZnpRdWHJUN",
    "name": "Docs example, renamed",
    "status": "active",
    "schedule": {
      "cron": "0 0 * * *",
      "timezone": "UTC",
      "everySeconds": null
    },
    "nextRunAt": "2026-11-17T17:53:00.141Z",
    "lastRunAt": null,
    "currentCheckId": null,
    "targets": [
      {
        "id": "68493bf9-027b-4ae0-ab28-af34706dec07",
        "type": "scrape",
        "urls": [
          "https://bun.com/docs/runtime/bunfig"
        ]
      }
    ],
    "goal": null,
    "judgeEnabled": false,
    "retentionDays": 30,
    "estimatedCreditsPerMonth": 30,
    "estimatedCostUsdPerMonth": 0.06,
    "notification": {
      "email": {
        "enabled": false,
        "recipients": [],
        "includeDiffs": false,
        "recipientStates": []
      }
    },
    "emailRecipientSubscriptions": [],
    "webhook": null,
    "createdAt": "2026-11-17T17:53:00.141Z",
    "updatedAt": "2026-11-17T17:53:11.038Z",
    "urls": [
      "https://bun.com/docs/runtime/bunfig"
    ],
    "interval": null,
    "formats": [
      "markdown"
    ],
    "changeTracking": {
      "modes": [
        "diff"
      ]
    },
    "nextCheckAt": "2026-11-17T17:53:00.141Z",
    "lastCheckAt": null,
    "checks": 0,
    "creditsUsed": 0,
    "costUsd": 0
  },
  "costUsd": 0,
  "creditsUsed": 0,
  "requestId": "5a040253-db9e-4534-b664-d0c658c03138"
}
```


## OpenAPI

````yaml api-reference/openapi.json PATCH /v1/monitor/{id}
openapi: 3.1.0
info:
  title: Stophy API
  version: '1'
  description: >-
    Each operation shows its method and its input: a JSON object body, path and
    query parameters, or a file upload.


    Responses leave out empty values: null, empty strings, empty objects and
    empty nested lists are not sent.


    Text comes back whole. To get shorter responses, add
    ?maxTextLength=<characters> to the URL. Every text value longer than that is
    cut and ends with …. A screenshot is never cut, and a page whose text was
    cut has isTruncated set to true.


    x-cost-usd is what one call costs, in dollars. Every call costs the same,
    whatever it returns, unless an operation's description says it costs per 10
    results, or per hour of audio. Then x-cost-usd is the lowest price and
    x-cost-usd-max the most one call can cost. Where an operation takes limit,
    send it to return fewer results and pay for fewer.


    When a response has a cursor, send it back unchanged with the same input to
    get the next page. When it has a page, send the next page number.
servers:
  - url: https://api.stophy.dev
security:
  - apiKey: []
paths:
  /v1/monitor/{id}:
    patch:
      summary: >-
        Change a monitor: its name, schedule, targets, webhook, retention, or
        pause and resume it.
      operationId: monitorUpdate
      parameters:
        - name: id
          in: path
          required: true
          schema:
            type: string
          description: The monitor id.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                origin:
                  description: Set by client libraries. Ignored.
                  type: string
                  maxLength: 200
                integration:
                  description: Set by client libraries. Ignored.
                  type: string
                  maxLength: 200
                name:
                  description: A name for the monitor.
                  type: string
                  minLength: 1
                  maxLength: 256
                schedule:
                  type: object
                  properties:
                    cron:
                      description: >-
                        Five-field cron expression. The minimum interval is 5
                        minutes.
                      type: string
                    text:
                      description: >-
                        Plain-words schedule: every 30 minutes, every 15 minutes
                        starting at :07, hourly, every 2 hours, daily, daily at
                        9:00, daily at 9am, daily at 5:30 PM, weekly.
                      type: string
                    timezone:
                      default: UTC
                      description: IANA timezone for the schedule.
                      type: string
                targets:
                  minItems: 1
                  maxItems: 50
                  type: array
                  items:
                    oneOf:
                      - type: object
                        properties:
                          id:
                            description: >-
                              A stable id for this target. Made for you when
                              left out.
                            type: string
                            minLength: 1
                            maxLength: 64
                          type:
                            type: string
                            const: scrape
                          urls:
                            minItems: 1
                            maxItems: 100
                            type: array
                            items:
                              type: string
                            description: The pages to read on every check.
                          scrapeOptions:
                            type: object
                            propertyNames:
                              type: string
                            additionalProperties:
                              $ref: '#/components/schemas/monitorUpdate.28.schema0'
                            description: >-
                              The same options as POST /v1/scrape, except url.
                              formats says what to compare: the first of
                              markdown, html, rawHtml or links is compared
                              (markdown by default); add changeTracking with
                              modes git-diff and json, or a json format with a
                              schema or prompt, to compare fields.
                        required:
                          - type
                          - urls
                        additionalProperties: false
                      - type: object
                        properties:
                          id:
                            type: string
                            minLength: 1
                            maxLength: 64
                          type:
                            type: string
                            const: crawl
                          url:
                            description: >-
                              The page to start from. Every check finds the
                              pages under it again and reads each one.
                            type: string
                          crawlOptions:
                            type: object
                            properties:
                              limit:
                                default: 100
                                description: >-
                                  The most pages to read on each check, up to
                                  500. 100 by default.
                                type: integer
                                minimum: 1
                                maximum: 500
                              maxDepth:
                                description: >-
                                  How many path levels below the start page to
                                  go, up to 10.
                                type: integer
                                minimum: 0
                                maximum: 10
                              maxDiscoveryDepth:
                                description: The same as maxDepth.
                                type: integer
                                minimum: 0
                                maximum: 10
                              includePaths:
                                default: []
                                maxItems: 100
                                type: array
                                items:
                                  type: string
                                  minLength: 1
                                  maxLength: 200
                              excludePaths:
                                default: []
                                maxItems: 100
                                type: array
                                items:
                                  type: string
                                  minLength: 1
                                  maxLength: 200
                              regexOnFullURL:
                                type: boolean
                                default: false
                              crawlEntireDomain:
                                type: boolean
                                default: false
                              allowSubdomains:
                                type: boolean
                                default: false
                              ignoreQueryParameters:
                                default: true
                                type: boolean
                              sitemap:
                                default: include
                                type: string
                                enum:
                                  - skip
                                  - include
                                  - only
                            additionalProperties: false
                          scrapeOptions:
                            type: object
                            propertyNames:
                              type: string
                            additionalProperties:
                              $ref: '#/components/schemas/monitorUpdate.28.schema0'
                            description: >-
                              The same options as POST /v1/scrape, except url.
                              formats says what to compare: the first of
                              markdown, html, rawHtml or links is compared
                              (markdown by default); add changeTracking with
                              modes git-diff and json, or a json format with a
                              schema or prompt, to compare fields.
                        required:
                          - type
                          - url
                        additionalProperties: false
                      - type: object
                        properties:
                          id:
                            type: string
                            minLength: 1
                            maxLength: 64
                          type:
                            type: string
                            const: search
                          queries:
                            minItems: 1
                            maxItems: 12
                            type: array
                            items:
                              type: string
                              minLength: 1
                              maxLength: 256
                            description: Search queries to run on each check, 1 to 12.
                          searchWindow:
                            default: 24h
                            description: >-
                              Only results published within this window. The
                              search engine's own steps are a day and a week, so
                              the smaller windows use a day.
                            type: string
                            enum:
                              - 5m
                              - 15m
                              - 1h
                              - 6h
                              - 24h
                              - 7d
                          maxResults:
                            default: 10
                            description: >-
                              Results to look at on each check, merged and
                              deduplicated across the queries.
                            type: integer
                            minimum: 1
                            maximum: 50
                          includeDomains:
                            default: []
                            maxItems: 50
                            type: array
                            items:
                              type: string
                              pattern: ^[a-z0-9.-]+\.[a-z]{2,}$
                          excludeDomains:
                            default: []
                            maxItems: 50
                            type: array
                            items:
                              type: string
                              pattern: ^[a-z0-9.-]+\.[a-z]{2,}$
                        required:
                          - type
                          - queries
                        additionalProperties: false
                retentionDays:
                  type: integer
                  minimum: 1
                  maximum: 365
                  description: >-
                    How many days checks, diffs and snapshots are kept. 30 by
                    default.
                webhook:
                  anyOf:
                    - type: object
                      properties:
                        url:
                          type: string
                        headers:
                          type: object
                          propertyNames:
                            type: string
                            pattern: ^[A-Za-z0-9-]{1,64}$
                          additionalProperties:
                            type: string
                            maxLength: 1000
                        metadata:
                          type: object
                          propertyNames:
                            type: string
                          additionalProperties:
                            $ref: '#/components/schemas/monitorUpdate.28.schema0'
                        events:
                          description: >-
                            Which events to send: monitor.page (a page changed,
                            appeared or went away), monitor.check.completed (a
                            check finished), and the older monitor.changed and
                            monitor.failed. A monitor made with url or interval
                            sends the older two by default, any other the first
                            two.
                          minItems: 1
                          type: array
                          items:
                            type: string
                            enum:
                              - monitor.page
                              - monitor.check.completed
                              - monitor.changed
                              - monitor.failed
                      required:
                        - url
                      additionalProperties: false
                    - type: 'null'
                notification:
                  anyOf:
                    - type: object
                      properties:
                        email:
                          type: object
                          properties:
                            enabled:
                              default: false
                              description: >-
                                Send an email when a check finds a change. Off
                                by default.
                              type: boolean
                            recipients:
                              description: >-
                                Who gets the email, up to 25. Your own account
                                address gets mail at once. Any other address is
                                sent a confirmation link first and gets nothing
                                else until it is clicked.
                              maxItems: 25
                              type: array
                              items:
                                type: string
                                maxLength: 254
                                format: email
                                pattern: >-
                                  ^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$
                            includeDiffs:
                              default: false
                              description: >-
                                Put the changed text of each changed page in the
                                email.
                              type: boolean
                          additionalProperties: false
                      additionalProperties: false
                    - type: 'null'
                goal:
                  description: >-
                    What matters to you, in plain words. With a goal, every
                    changed page is judged against it ($1 per 1,000 pages more
                    for each changed page) and the page says whether the change
                    is meaningful. judgeEnabled false turns the judge off.
                  anyOf:
                    - type: string
                      maxLength: 2000
                    - type: 'null'
                judgeEnabled:
                  type: boolean
                status:
                  description: paused stops the checks; active starts them again.
                  type: string
                  enum:
                    - active
                    - paused
              additionalProperties: false
      responses:
        '200':
          description: The monitor as it is now.
          headers:
            X-Request-ID:
              $ref: '#/components/headers/RequestId'
          content:
            application/json:
              schema:
                type: object
                required:
                  - success
                  - costUsd
                  - creditsUsed
                  - requestId
                properties:
                  success:
                    const: true
                  id:
                    type: string
                  data:
                    type: object
                    properties:
                      id:
                        type: string
                      name:
                        type: string
                      status:
                        type: string
                        enum:
                          - active
                          - paused
                      pausedReason:
                        type: string
                      schedule:
                        type: object
                        properties:
                          cron:
                            type:
                              - string
                              - 'null'
                          timezone:
                            type: string
                          everySeconds:
                            type:
                              - integer
                              - 'null'
                      nextRunAt:
                        type:
                          - string
                          - 'null'
                        format: date-time
                      lastRunAt:
                        type:
                          - string
                          - 'null'
                        format: date-time
                      currentCheckId:
                        type:
                          - string
                          - 'null'
                      targets:
                        type: array
                        items:
                          type: object
                      retentionDays:
                        type: integer
                      estimatedCreditsPerMonth:
                        type: integer
                        description: >-
                          Older field: pages watched times checks in 30 days, in
                          $0.002 steps.
                      estimatedCostUsdPerMonth:
                        type: number
                        description: >-
                          Pages watched times checks in 30 days, at $1 per 1,000
                          pages, in dollars.
                      webhook:
                        type:
                          - object
                          - 'null'
                      createdAt:
                        type: string
                        format: date-time
                      urls:
                        type: array
                        items:
                          type: string
                        description: 'Older field: every page watched.'
                      interval:
                        type:
                          - integer
                          - 'null'
                        description: 'Older field: seconds between checks.'
                      checks:
                        type: integer
                      creditsUsed:
                        type: integer
                      costUsd:
                        type: number
                        description: What this call cost, in dollars.
                  next:
                    type:
                      - string
                      - 'null'
                  creditsUsed:
                    type: integer
                  costUsd:
                    type: number
                    description: What this call cost, in dollars.
                  requestId:
                    type: string
        4XX:
          $ref: '#/components/responses/Error'
        5XX:
          $ref: '#/components/responses/Error'
components:
  schemas:
    monitorUpdate.28.schema0:
      anyOf:
        - type: string
        - type: number
        - type: boolean
        - type: 'null'
        - type: array
          items:
            $ref: '#/components/schemas/monitorUpdate.28.schema0'
        - type: object
          propertyNames:
            type: string
          additionalProperties:
            $ref: '#/components/schemas/monitorUpdate.28.schema0'
    Error:
      type: object
      required:
        - success
        - error
        - code
      properties:
        success:
          const: false
        error:
          type: string
          description: What went wrong and what to do next.
        code:
          type: string
          enum:
            - apiKeyRequired
            - busy
            - checkRunning
            - cliSessionCompleted
            - cliSessionExists
            - cliSessionNotFound
            - forbidden
            - freeLimit
            - insufficientCredits
            - internalError
            - inviteClaimed
            - inviteDisabled
            - inviteExpired
            - inviteUsedUp
            - invalidCliSession
            - invalidCliVerifier
            - invalidRequest
            - jobFinished
            - methodNotAllowed
            - notFound
            - payloadTooLarge
            - profileBusy
            - profileTooLarge
            - prohibitedPermission
            - promptInjectionDetected
            - rateLimited
            - sourceChanged
            - sourceRefused
            - siteNotRead
            - sourceTimeout
            - sourceUnavailable
            - unauthorized
            - unsupportedMediaType
        retryable:
          type: boolean
          description: true when trying again can help.
        retryAfterSeconds:
          type: integer
        requestId:
          type: string
        requiredCredits:
          type: number
          description: >-
            Older field: the most the call can cost, in $0.002 steps. Sent when
            the balance is too low.
        availableCredits:
          type: number
          description: 'Older field: the balance in $0.002 steps. Sent with requiredCredits.'
        requiredUsd:
          type: number
          description: >-
            The most the call can cost, in dollars. Sent when the balance is too
            low.
        availableUsd:
          type: number
          description: What is left on the account, in dollars. Sent with requiredUsd.
        billingUrl:
          type: string
          description: Where to add money. Sent with requiredUsd.
        signupUrl:
          type: string
          const: https://stophy.dev/signup
          description: >-
            Where a person gets a key. Sent with apiKeyRequired, freeLimit and
            an invalid key.
        signup:
          type: string
          const: POST https://api.stophy.dev/v1/signup
          description: >-
            The call that gets an agent a key with no human. Sent next to
            signupUrl.
  headers:
    RequestId:
      description: The request id. Quote it when you report a problem.
      schema:
        type: string
    RetryAfter:
      description: Seconds to wait before retrying.
      schema:
        type: integer
  responses:
    Error:
      description: The request failed. Retry-After says when trying again can help.
      headers:
        X-Request-ID:
          $ref: '#/components/headers/RequestId'
        Retry-After:
          $ref: '#/components/headers/RetryAfter'
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
  securitySchemes:
    apiKey:
      type: http
      scheme: bearer

````

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