const url = 'https://app.monitorly.cloud/api/v1/status-pages/PAGE_ID/previews';const options = { method: 'POST', headers: { cookie: '__Host-monitorly_session=<__Host-monitorly_session>', 'Content-Type': 'application/json' }, body: '{"accentColor":"example","components":[{"checkId":"CHECK_ID","group":"example","name":"example"}],"theme":{"dark":{"background":"example","border":"example","muted":"example","surface":"example","text":"example"},"font":"system","layout":"list","light":{"background":"example","border":"example","muted":"example","surface":"example","text":"example"},"links":[{"label":"example","url":"example"}],"mode":"auto","radius":"none"},"title":"example","websiteUrl":"example"}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://app.monitorly.cloud/api/v1/status-pages/PAGE_ID/previews \ --header 'Content-Type: application/json' \ --cookie __Host-monitorly_session=<__Host-monitorly_session> \ --data '{ "accentColor": "example", "components": [ { "checkId": "CHECK_ID", "group": "example", "name": "example" } ], "theme": { "dark": { "background": "example", "border": "example", "muted": "example", "surface": "example", "text": "example" }, "font": "system", "layout": "list", "light": { "background": "example", "border": "example", "muted": "example", "surface": "example", "text": "example" }, "links": [ { "label": "example", "url": "example" } ], "mode": "auto", "radius": "none" }, "title": "example", "websiteUrl": "example" }'A link to the page as it would look with unsaved edits, valid for 10 minutes. Nothing changes. The edits are checked by the same rules as saving them. Needs the editor role.
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”The status page’s id.
Example
PAGE_IDRequest Bodyrequired
Section titled “Request Bodyrequired”The page as it is being edited. A field left out is the stored one.
object
As in PATCH /status-pages/{pageId} (contrast with white text at least 4.5:1); null is the product
accent.
As in PUT /status-pages/{pageId}/components, in display order.
object
Example
CHECK_IDGroup heading, 1–100 characters; missing or blank: ungrouped.
1–200 characters. Absent, null or the check’s own name: the component follows the check’s name.
As in PATCH /status-pages/{pageId} (the whole theme); null is the product’s own look.
object
The colours of the dark scheme; the product’s own when left out.
object
Behind the page.
Lines between rows and around panels.
Secondary text and field edges: at least 3:1 on background and on surface.
Panels, cards and the header.
Text: at least 4.5:1 on background and on surface.
The colours of the light scheme; the product’s own when left out.
object
Behind the page.
Lines between rows and around panels.
Secondary text and field edges: at least 3:1 on background and on surface.
Panels, cards and the header.
Text: at least 4.5:1 on background and on surface.
Up to 5 links in the page header, in this order.
A link in the page header, between the page name and the website link.
object
1–32 characters on one line.
An absolute http or https URL with a host, at most 2048 characters.
As in PATCH /status-pages/{pageId}; null shows the page without the link.
Responses
Section titled “Responses”The preview’s address and when it expires.
object
<MONITORLY_STATUS_PUBLIC_URL>/_preview/<token>: the page as edited, for an iframe of the dashboard.
Example generated
{ "expiresAt": "example", "url": "example"}Bad Request.
request.malformed: the body or a parameter is not of the expected shapeauth.credentials_conflict: the request carries both a session cookie and a token
object
Field errors, empty for errors of the whole request.
object
object
JSON pointer into the request body.
Stable code, for example check.timeout_exceeds_interval.
Example generated
{ "detail": "example", "errors": [ { "code": "example", "params": { "additionalProperty": "example" }, "pointer": "example" } ], "status": 1, "title": "example", "type": "example"}Unauthorized.
auth.unauthenticated,auth.session_expired: no session, or it endedtoken.invalid: the token is malformed, unknown, revoked or expired, or its creator left the workspace
object
Field errors, empty for errors of the whole request.
object
object
JSON pointer into the request body.
Stable code, for example check.timeout_exceeds_interval.
Example generated
{ "detail": "example", "errors": [ { "code": "example", "params": { "additionalProperty": "example" }, "pointer": "example" } ], "status": 1, "title": "example", "type": "example"}Forbidden.
auth.forbidden: your role is too low for thistoken.not_allowed: this operation needs a signed-in session; tokens cannot call itrequest.origin_mismatch,request.header_required: a changing request with a session comes from another site or lacksX-Monitorly-Request: 1
object
Field errors, empty for errors of the whole request.
object
object
JSON pointer into the request body.
Stable code, for example check.timeout_exceeds_interval.
Example generated
{ "detail": "example", "errors": [ { "code": "example", "params": { "additionalProperty": "example" }, "pointer": "example" } ], "status": 1, "title": "example", "type": "example"}Not Found.
request.not_found: it does not exist, or you cannot see it
object
Field errors, empty for errors of the whole request.
object
object
JSON pointer into the request body.
Stable code, for example check.timeout_exceeds_interval.
Example generated
{ "detail": "example", "errors": [ { "code": "example", "params": { "additionalProperty": "example" }, "pointer": "example" } ], "status": 1, "title": "example", "type": "example"}Payload Too Large.
request.too_large: the body is larger than 256 KiB
object
Field errors, empty for errors of the whole request.
object
object
JSON pointer into the request body.
Stable code, for example check.timeout_exceeds_interval.
Example generated
{ "detail": "example", "errors": [ { "code": "example", "params": { "additionalProperty": "example" }, "pointer": "example" } ], "status": 1, "title": "example", "type": "example"}Unprocessable Entity.
field.required,field.too_long,field.invalid: a field breaks a rule;errorspoints at itstatus_page.check_not_in_project: component check is not from the page’s projectstatus_page.accent_contrast_low: contrast of white text on the accent color is less than 4.5:1 (params.ratio)
object
Field errors, empty for errors of the whole request.
object
object
JSON pointer into the request body.
Stable code, for example check.timeout_exceeds_interval.
Example generated
{ "detail": "example", "errors": [ { "code": "example", "params": { "additionalProperty": "example" }, "pointer": "example" } ], "status": 1, "title": "example", "type": "example"}Too Many Requests.
session.rate_limited: more than 5 changes a second from your sessions
object
Field errors, empty for errors of the whole request.
object
object
JSON pointer into the request body.
Stable code, for example check.timeout_exceeds_interval.
Example generated
{ "detail": "example", "errors": [ { "code": "example", "params": { "additionalProperty": "example" }, "pointer": "example" } ], "status": 1, "title": "example", "type": "example"}Headers
Section titled “Headers”Seconds to wait before trying again.
Service Unavailable.
server.unavailable: temporarily unavailable; retry later
object
Field errors, empty for errors of the whole request.
object
object
JSON pointer into the request body.
Stable code, for example check.timeout_exceeds_interval.
Example generated
{ "detail": "example", "errors": [ { "code": "example", "params": { "additionalProperty": "example" }, "pointer": "example" } ], "status": 1, "title": "example", "type": "example"}