- authentication
- Secret API key as a bearer token
- billing
- Free. The change applies to the next run.
Changes a saved monitor in place: rename it, move it to another cadence, replace the addresses, or point it at a webhook. Send only the fields you are changing; a body that names none of them answers 422 rather than quietly changing nothing, because that is the shape a misspelled field name takes.
Replacing ips replaces the list. What the last run recorded about the addresses that stayed is kept, so their next run still compares against the answer they already had; what it recorded about the ones that are gone is deleted with them; and an entry that is new starts with no baseline, so its first run only sets one. A rename never touches a stored answer — they are keyed by the entry, never by the list.
Changing cadence neither skips a run nor starts a second one: a run already scheduled sooner than the new interval still happens, and a longer interval applies from the one after it. Nothing is queued by this call — the change applies to the next run, and POST .../run is there to have it now.
Sending a webhook_url that differs from the one stored mints a new signing secret and returns it once, here; sending the URL it already has keeps the secret it is signing with, and null removes the webhook. A monitor that belongs to another account answers 404.
Parameters
| name | in | type | description |
|---|---|---|---|
| monitorIdrequired | path | integer | The monitor's id from the list endpoint. |
Request body
| field | type | description |
|---|---|---|
| name | string | At most 100 characters. |
| ips | string[] | |
| cadence | string | One of: daily, weekly, monthly. |
| webhook_url | string | null | At most 2,048 characters. |
| webhook_events | string | One of: changes, every_run. |
Example request
curl -X PATCH https://spaw.co/api/v1/ip/monitors/41 \
-H "Authorization: Bearer sk_live_…" \
-H "Content-Type: application/json" \
-d '{
"ips": [
"203.0.113.7",
"198.51.100.24"
],
"cadence": "daily"
}'This endpoint has no console on its page. It writes to your account. A documentation page can show you the request; making the change is for the dashboard or for a call you make yourself.
Responses
200The monitor as it now stands.
401The key is missing, malformed, or revoked.
{
"success": false,
"error": {
"code": "UNAUTHENTICATED",
"message": "Provide a valid API key as a bearer token.",
"request_id": "req_01m1kgdm4xngzmbmff68g94w0c"
}
}404No such record on this account.
{
"success": false,
"error": {
"code": "NOT_FOUND",
"message": "No record with that id on this account.",
"request_id": "req_01m1kgdm4xngzmbmff68g94w0c"
}
}422The request body could not be validated; `error.errors` lists the fields.
{
"success": false,
"error": {
"code": "VALIDATION_FAILED",
"message": "The email field is required.",
"errors": {
"email": [
"The email field is required."
]
},
"request_id": "req_01m1kgdm4xngzmbmff68g94w0c"
}
}429Over 5 requests per second for the key. Retry after the limit resets.
{
"success": false,
"error": {
"code": "RATE_LIMITED",
"message": "Too many requests. Retry after the limit resets.",
"request_id": "req_01m1kgdm4xngzmbmff68g94w0c"
}
}Error codes
Failures answer { success: false, error: { code, message, request_id } }. Each code has its own page.