Skip to main content
API monitors send HTTP requests and evaluate the response with a JavaScript function. Use them for any HTTP or HTTPS endpoint.

Configuration fields

FieldTypeDefaultNotes
urlstringRequired
methodGET | POST | PUT | PATCH | DELETE | HEAD | OPTIONSGET
headers{ key: string; value: string }[][]Optional custom headers
bodystring""Sent for non-GET/HEAD methods
timeoutnumber10000Request timeout in milliseconds
allowSelfSignedCertbooleanfalseDisables TLS certificate verification
evalstring (JS function)built-in defaultSee eval contract below

Default eval behavior

When no custom eval is set, the monitor returns UP when:
  • the HTTP status code is 429, or
  • the status code is in the 2xx or 3xx range
All other status codes return DOWN. The built-in eval function:
async function (statusCode, responseTime, responseRaw, modules) {
    let statusCodeShort = Math.floor(statusCode / 100);
    if (statusCode == 429 || (statusCodeShort >= 2 && statusCodeShort <= 3)) {
        return {
            status: 'UP',
            latency: responseTime,
        }
    }
    return {
        status: 'DOWN',
        latency: responseTime,
    }
}

Custom eval contract

Your function receives four arguments:
ArgumentTypeDescription
statusCodenumberHTTP response status code
responseTimenumberMeasured latency in milliseconds
responseRawstringRaw response body as a string
modulesobjectAvailable libraries — currently includes cheerio
It must return an object with:
{ status: "UP" | "DEGRADED" | "DOWN" | "MAINTENANCE", latency: number }
If the eval function throws an error or returns an invalid shape, the monitor records DOWN for that run.

Examples

{
    "type": "API",
    "type_data": {
        "url": "https://api.example.com/health",
        "method": "GET",
        "timeout": 10000
    }
}
Use $VARIABLE_NAME in the URL, headers, or body to reference environment variables stored as secrets. Kener replaces them before sending the request.

Troubleshooting

  • Always DOWN: verify the URL is reachable from your Kener host, check method and headers
  • TLS errors: enable allowSelfSignedCert only for trusted self-signed endpoints
  • Eval errors: check that your function always returns a valid { status, latency } object
  • Timeout: increase timeout or investigate network latency from Kener to the target

Build docs developers (and LLMs) love