- 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 domains, 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.
Replacing domains replaces the list. What the last run recorded about the domains 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; a new entry starts with no baseline. A rename never touches a stored answer. Changing cadence neither skips a run nor starts a second one. Nothing is queued by this call; 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; the URL it already has keeps the secret, 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. |
| domains | 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/email/domain-monitors/4 \
-H "Authorization: Bearer sk_live_…" \
-H "Content-Type: application/json" \
-d '{
"domains": [
"acme.com",
"shop.acme.com"
],
"cadence": "weekly"
}'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.