StatusDashboard
DashboardsCustom Code

Update dashboard custom code

Replace the custom code configuration for a dashboard.

View Markdown

PUT /app/dashboards/{id}/custom-code

Replaces the custom CSS, JavaScript, header HTML, and footer HTML for a dashboard. This is a full replacement. Requires the Custom Code feature entitlement.

Pass empty strings to clear individual fields. When all fields are empty strings, the customCode attribute is removed from the dashboard.


Path parameters

ParameterDescription
idThe UUID of the dashboard.

Request

See API Basics for required headers.

Request body

FieldTypeDescription
cssstringRaw CSS injected into a <style> tag on the status dashboard. Maximum 50,000 characters. Pass an empty string to clear.
jsstringRaw JavaScript executed on the status dashboard. Maximum 50,000 characters. Pass an empty string to clear.
headerHtmlstringRaw HTML injected above the status banner. Maximum 50,000 characters. Pass an empty string to clear.
footerHtmlstringRaw HTML injected below the event history section. Maximum 50,000 characters. Pass an empty string to clear.

Sample request

curl -X PUT https://api.statusdashboard.com/app/dashboards/a1b2c3d4-e5f6-7890-abcd-ef1234567890/custom-code \
  -H "Authorization: Bearer bcf847abf5c6:def456" \
  -H "Content-Type: application/json" \
  -d '{
    "css": "body { font-family: Inter, sans-serif; }",
    "js": "console.log('\''Status dashboard loaded'\'');",
    "headerHtml": "",
    "footerHtml": ""
  }'

Sample response

Status: 200 OK

{
  "css": "body { font-family: Inter, sans-serif; }",
  "js": "console.log('Status dashboard loaded');",
  "headerHtml": "",
  "footerHtml": ""
}

Error responses

StatusWhen
400Validation failure — field exceeds maximum length.
403Insufficient permissions, or the Custom Code feature is not enabled.
404Dashboard not found or does not belong to the caller's organization.

On this page

We use cookies

We use essential cookies to keep the site working, and optional analytics cookies to understand how it's used. Read our Privacy Policy.