Skip to content
HALOWERK

Codewerk

status badge

Builds a shields-style SVG badge with text widths measured from the font metrics of Liberation Sans and fixed with textLength, an accessible title and unique element IDs so several badges can be inlined in one page. Colors are hex values or the shields.io palette names (CC0). With value and thresholds the color follows the state (for example uptime 99.95 % above 99.9 green, above 99 yellow, else red; or latency where lower is better). Text color switches to dark on light backgrounds for.

POST https://code.halowerk.com/v1/status-badge

Inputs

Fields of the published input schema
FieldTypeRequiredDescription
labelstringYes
messagestringNo
valuenumberNo
unitstringNo
decimalsintegerNo
thresholdsobjectNo
colorstringNo
label_colorstringNo
stylestringNo
Show full input schema
{
  "type": "object",
  "additionalProperties": false,
  "required": [
    "label"
  ],
  "properties": {
    "label": {
      "type": "string",
      "minLength": 1,
      "maxLength": 60
    },
    "message": {
      "type": "string",
      "minLength": 1,
      "maxLength": 60
    },
    "value": {
      "type": "number"
    },
    "unit": {
      "type": "string",
      "maxLength": 10
    },
    "decimals": {
      "type": "integer",
      "minimum": 0,
      "maximum": 6
    },
    "thresholds": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "ok",
        "warn"
      ],
      "properties": {
        "ok": {
          "type": "number"
        },
        "warn": {
          "type": "number"
        },
        "higher_is_better": {
          "type": "boolean",
          "default": true
        }
      }
    },
    "color": {
      "type": "string",
      "maxLength": 20
    },
    "label_color": {
      "type": "string",
      "maxLength": 20
    },
    "style": {
      "type": "string",
      "enum": [
        "flat",
        "flat-square",
        "for-the-badge"
      ],
      "default": "flat"
    }
  }
}

Open original schema

Published input example

{
  "label": "uptime",
  "value": 99.95,
  "unit": "%",
  "thresholds": {
    "ok": 99.9,
    "warn": 99,
    "higher_is_better": true
  }
}

Result & documentation

Machine-readable documentation of this hub

Source of this page: the published HALOWERK catalog. Updated: 2026-11-17 UTC.

More endpoints in this hub

All endpoints in this hub โ†’