Monitors

Rotate a monitor webhook secret

Changed on

Generate and return a new signing secret. It takes effect immediately for all subsequent delivery attempts.

post/monitors/{monitor_id}/webhook/rotate-secret

Request

  • Base URL: https://api.context.dev/v1
  • URL: https://api.context.dev/v1/monitors/{monitor_id}/webhook/rotate-secret
  • Auth: HTTP bearer

Path parameters

monitor_idstring required

ID of the monitor.

Example:mon_123

Response

Monitor with the rotated webhook secret

mode'web' required

Always web. Optional.

idstring required
namestring required
status'active' | 'paused' | 'failed' required

Current state. Failed monitors keep running; paused monitors must be resumed with status: "active".

last_run_atstring date-time nullable
last_change_atstring date-time nullable
next_run_atstring date-time nullable

When the next scheduled run is due; null while paused.

created_atstring date-time required
updated_atstring date-time required
tagsstring[]

Labels for filtering monitors, their changes, and their usage.

request_idstring uuid required

Unique ID of this request, also in X-Request-Id. Include it when contacting support.

Example response

{
  "id": "mon_123",
  "name": "Acme pricing monitor",
  "target": {
    "url": "https://acme.com/pricing",
    "instructions": "Report pricing or plan availability changes. Ignore counters, timestamps, testimonials, and navigation.",
    "include_selectors": [
      "#attraction-details"
    ],
    "exclude_selectors": [
      ".carousel",
      "[id^=\"TA_\"]"
    ]
  },
  "schedule": {
    "frequency": 6,
    "unit": "hours"
  },
  "webhook": {
    "url": "https://example.com/webhook",
    "events": [
      "change.detected",
      "run.completed"
    ],
    "retry": {
      "delays_seconds": [
        10,
        60,
        300,
        1800,
        7200,
        21600,
        57600
      ]
    },
    "secret": "whsec_8f3a…"
  },
  "last_error": {
    "code": "fetch_failed",
    "message": "The target URL could not be fetched."
  },
  "webhook_failure": {
    "consecutive_failures": 3,
    "last_message": "Webhook endpoint returned HTTP 429."
  },
  "tags": [
    "pricing",
    "competitor"
  ],
  "baseline": {
    "text": "Acme Pricing\nStarter $9/mo…"
  },
  "request_id": "3f1c2a6e-8b4d-4c1e-9f0a-2d7b5e6c8a91"
}

Changes

    • warning

      added the new NO_PUBLISHED_MARKDOWN enum value to the response property for the response status

    • warning

      added the new NO_PUBLISHED_MARKDOWN enum value to the response property for the response status

    • warning

      added the new NO_PUBLISHED_MARKDOWN enum value to the response property for the response status

    • warning

      added the new NO_PUBLISHED_MARKDOWN enum value to the response property for the response status

    • warning

      added the new NO_PUBLISHED_MARKDOWN enum value to the response property for the response status

    • info

      added the optional property to the response with the status

    • info

      added the optional property to the response with the status

    • info

      added the optional property to the response with the status

    • info

      added the optional property to the response with the status

    • info

      added the optional property to the response with the status

    • info

      added the optional property to the response with the status