Skip to main content

REST API

The Kymaros API server (kymaros-api) exposes a JSON REST API consumed by the dashboard and available to external tooling. By default it listens on port 8080 inside the kymaros-system namespace.

All responses use Content-Type: application/json unless stated otherwise. Timestamps are RFC 3339 UTC strings. Durations are Go duration strings (e.g., "11m35s", "1h").

Base URL

When accessed via kubectl port-forward:

kubectl port-forward -n kymaros-system svc/kymaros-api 8080:8080

The base URL is http://localhost:8080.


Endpoints

GET /api/v1/health

Liveness probe. Returns 200 when the API server is running.

Response

{"status": "ok"}

Status codes

CodeMeaning
200API server is running.

Example

curl http://localhost:8080/api/v1/health

GET /api/v1/summary

Returns aggregate metrics across all RestoreTest resources.

Response

{
"averageScore": 87,
"totalTests": 12,
"testsLastNight": 8,
"totalFailures": 1,
"totalPartial": 2,
"averageRTO": "14m22s",
"namespacesCovered": 18
}
FieldTypeDescription
averageScoreintAverage confidence score across all tests over the last 24 hours.
totalTestsintTotal number of RestoreTest resources present.
testsLastNightintNumber of tests that completed a run in the last 24 hours.
totalFailuresintNumber of fail results across all tests in the last 24 hours.
totalPartialintNumber of partial results across all tests in the last 24 hours.
averageRTOstringMean measured RTO across all runs in the last 24 hours.
namespacesCoveredintTotal distinct source namespaces covered by at least one RestoreTest.

Status codes

CodeMeaning
200Success.

Example

curl http://localhost:8080/api/v1/summary

GET /api/v1/summary/daily

Returns a time series of daily summary metrics for trend analysis.

Query parameters

ParameterTypeDefaultDescription
daysint30Number of days of history to return.

Response

Array of DailySummary objects, one per day, ordered chronologically.

[
{
"date": "2024-03-15",
"score": 94,
"tests": 8,
"failures": 0
},
{
"date": "2024-03-16",
"score": 71,
"tests": 8,
"failures": 2
}
]
FieldTypeDescription
datestringDate in YYYY-MM-DD format.
scoreintAverage confidence score for that day.
testsintNumber of test runs completed that day.
failuresintNumber of fail results that day.

Status codes

CodeMeaning
200Success.

Example

curl "http://localhost:8080/api/v1/summary/daily?days=7"

GET /api/v1/tests

Returns all RestoreTest resources and their current status.

Response

Array of TestResponse objects.

[
{
"name": "my-app-nightly",
"namespace": "kymaros-system",
"provider": "velero",
"schedule": "0 2 * * *",
"phase": "Idle",
"lastScore": 96,
"lastResult": "pass",
"lastRunAt": "2024-03-15T02:11:47Z",
"nextRunAt": "2024-03-16T02:00:00Z",
"sourceNamespaces": ["my-app"],
"rtoTarget": "30m"
}
]
FieldTypeDescription
namestringRestoreTest resource name.
namespacestringKubernetes namespace of the resource.
providerstringBackup provider (velero, kasten, trilio).
schedulestringCron expression from spec.schedule.cron.
phasestringCurrent phase: Idle, Running, Completed, or Failed.
lastScoreintScore from the most recent run.
lastResultstringResult from the most recent run: pass, fail, or partial.
lastRunAtstringTimestamp of the most recent run completion.
nextRunAtstringScheduled time for the next run.
sourceNamespaces[]stringSource namespace names from spec.backupSource.namespaces[*].name.
rtoTargetstringValue of spec.sla.maxRTO, or empty if SLA not configured.

Status codes

CodeMeaning
200Success.

Example

curl http://localhost:8080/api/v1/tests

POST /api/v1/tests

Creates a new RestoreTest resource.

Request body (CreateTestInput)

{
"name": "my-app-nightly",
"namespace": "kymaros-system",
"provider": "velero",
"backupName": "latest",
"sourceNamespaces": ["my-app"],
"cron": "0 2 * * *",
"timezone": "UTC",
"namespacePrefix": "rp-test",
"ttl": "30m",
"networkIsolation": "strict",
"healthCheckPolicy": "my-app-health-policy",
"maxRTO": "30m",
"alertOnExceed": true,
"historyLimit": 10
}

Status codes

CodeMeaning
201Resource created successfully.
400Request body is invalid or missing required fields.
409A RestoreTest with this name already exists in the namespace.

Example

curl -X POST http://localhost:8080/api/v1/tests \
-H "Content-Type: application/json" \
-d '{
"name": "my-app-nightly",
"namespace": "kymaros-system",
"provider": "velero",
"backupName": "latest",
"sourceNamespaces": ["my-app"],
"cron": "0 2 * * *"
}'

PUT /api/v1/tests/:name

Updates an existing RestoreTest resource. The :name path parameter is the resource name.

Request body

Same schema as POST /api/v1/tests (CreateTestInput).

Status codes

CodeMeaning
200Resource updated successfully.
400Request body is invalid.
404No RestoreTest with this name exists.

Example

curl -X PUT http://localhost:8080/api/v1/tests/my-app-nightly \
-H "Content-Type: application/json" \
-d '{
"cron": "0 3 * * *",
"maxRTO": "45m"
}'

DELETE /api/v1/tests/:name

Deletes a RestoreTest resource. Associated RestoreReport objects are garbage-collected by the controller via owner references.

Status codes

CodeMeaning
204Resource deleted.
404No RestoreTest with this name exists.

Example

curl -X DELETE http://localhost:8080/api/v1/tests/my-app-nightly

POST /api/v1/tests/:name/trigger

Triggers an immediate out-of-schedule test run for the named RestoreTest. The controller begins a run regardless of the cron schedule.

Status codes

CodeMeaning
200Run triggered. The test phase transitions to Running.
404No RestoreTest with this name exists.
409A run is already in progress for this test.

Example

curl -X POST http://localhost:8080/api/v1/tests/my-app-nightly/trigger

GET /api/v1/reports

Returns RestoreReport objects, with optional filtering.

Query parameters

ParameterTypeDefaultDescription
teststringFilter by RestoreTest name.
daysint30Return reports from the last N days.
latestboolfalseWhen true, return only the most recent report per test.

Response

Array of RestoreReport objects (full CRD representation).

Status codes

CodeMeaning
200Success.
404The specified test name does not exist (only when test is provided).

Example

# All reports for a specific test from the last 7 days
curl "http://localhost:8080/api/v1/reports?test=my-app-nightly&days=7"

# Latest report for each test
curl "http://localhost:8080/api/v1/reports?latest=true"

GET /api/v1/alerts

Returns recent test failures and score regressions.

Query parameters

ParameterTypeDefaultDescription
hoursint48Look-back window in hours.

Response

Array of Alert objects ordered by timestamp descending.

[
{
"timestamp": "2024-03-16T03:18:33Z",
"testName": "orders-db-validation",
"namespace": "kymaros-system",
"score": 42,
"prevScore": 91,
"result": "fail",
"message": "postgres-pod-ready: CrashLoopBackOff — OOMKilled"
}
]
FieldTypeDescription
timestampstringTime the alert was generated.
testNamestringName of the RestoreTest that triggered the alert.
namespacestringNamespace of the RestoreTest.
scoreintScore from the current run.
prevScoreintScore from the preceding run (for regression comparison).
resultstringResult of the current run.
messagestringHuman-readable description of the failure or regression.

Status codes

CodeMeaning
200Success.

Example

curl "http://localhost:8080/api/v1/alerts?hours=24"

GET /api/v1/compliance

Returns a compliance evidence summary for a specific framework and reporting period.

Query parameters

ParameterTypeDefaultDescription
frameworkstringCompliance framework identifier. Supported values: soc2, iso27001, hipaa.
periodintReporting period in days (e.g., 90 for a quarterly period).

Response (ComplianceResponse)

{
"framework": "soc2",
"period": 90,
"generatedAt": "2024-03-16T10:00:00Z",
"totalTests": 720,
"passRate": 0.96,
"avgScore": 91,
"slaCompliance": 0.94,
"namespacesCovered": 18,
"controls": [
{
"id": "CC9.1",
"title": "Recovery procedures are tested",
"status": "satisfied",
"evidence": "720 restore validation runs over 90 days with 96% pass rate"
}
]
}

Status codes

CodeMeaning
200Success.
400Unknown framework or missing parameters.

Example

curl "http://localhost:8080/api/v1/compliance?framework=soc2&period=90"

GET /api/v1/compliance/pdf

Generates and returns a PDF compliance report. Requires an Enterprise license tier.

Query parameters

Same as GET /api/v1/compliance: framework and period.

Response

Binary PDF blob with Content-Type: application/pdf and Content-Disposition: attachment; filename=kymaros-compliance-<framework>-<period>d.pdf.

Status codes

CodeMeaning
200PDF generated and returned.
400Unknown framework or missing parameters.
402Active license does not include PDF export (Enterprise feature).

Example

curl "http://localhost:8080/api/v1/compliance/pdf?framework=soc2&period=90" \
--output kymaros-compliance-soc2-90d.pdf

GET /api/v1/upcoming

Returns the next scheduled run for each RestoreTest.

Response

Array of UpcomingTest objects ordered by nextRunAt ascending.

[
{
"name": "my-app-nightly",
"namespace": "kymaros-system",
"nextRunAt": "2024-03-16T02:00:00Z",
"lastScore": 96
}
]
FieldTypeDescription
namestringRestoreTest name.
namespacestringNamespace of the resource.
nextRunAtstringScheduled time for the next run.
lastScoreintScore from the most recent completed run.

Status codes

CodeMeaning
200Success.

Example

curl http://localhost:8080/api/v1/upcoming

GET /api/v1/schedules

Returns Velero Schedule objects discovered in the cluster. This endpoint is specific to the Velero provider and lists available backup schedules that can be referenced in a RestoreTest.

Response

Array of ScheduleInfo objects.

[
{
"name": "orders-daily",
"cron": "0 22 * * *",
"namespaces": ["orders", "orders-jobs"],
"lastBackup": "2024-03-15T22:00:04Z"
}
]
FieldTypeDescription
namestringVelero Schedule resource name.
cronstringCron expression configured on the Velero schedule.
namespaces[]stringNamespaces included in this Velero schedule.
lastBackupstringTimestamp of the most recent successful backup created by this schedule.

Status codes

CodeMeaning
200Success.
503Velero is not reachable or not installed.

Example

curl http://localhost:8080/api/v1/schedules

GET /api/v1/license

Returns the current license state.

Response (LicenseResponse)

{
"tier": "pro",
"expiresAt": "2025-01-01T00:00:00Z",
"trialEndsAt": null,
"isExpired": false,
"isTrialing": false,
"trialDaysLeft": 0,
"features": ["compliance-export", "multi-namespace", "pagerduty"]
}
FieldTypeDescription
tierstringLicense tier: community, pro, or enterprise.
expiresAtstringLicense expiry date, or null for perpetual.
trialEndsAtstringTrial expiry date, or null if not trialing.
isExpiredbooltrue if the license has expired.
isTrialingbooltrue if running on a trial license.
trialDaysLeftintDays remaining in the trial, or 0 if not trialing.
features[]stringFeature flags enabled by the current license.

Status codes

CodeMeaning
200Success.

Example

curl http://localhost:8080/api/v1/license