Orchestrator API v2 provides a cleaner, more consistent REST API with structured JSON responses and proper HTTP status codes.
All v2 endpoints are mounted under /api/v2 (respecting the configured URLPrefix).
A machine-readable OpenAPI 3.0 specification for the v2 API is available at
docs/api/openapi.yaml. You can use it with tools such as
Swagger UI, Redoc, or any OpenAPI-compatible client generator.
All v2 endpoints return a consistent JSON envelope:
{
"status": "ok",
"data": { ... }
}{
"status": "error",
"error": {
"code": "ERROR_CODE",
"message": "Human-readable error description"
}
}HTTP status codes are used appropriately:
200for successful requests400for invalid input (bad instance key, etc.)404for resources not found (unknown cluster, instance, etc.)500for internal server errors503for unavailable services (e.g., ProxySQL not configured)
Returns a list of all known clusters with metadata.
Response: Array of cluster info objects including cluster name, alias, master instance, count of instances, etc.
Returns detailed information about a specific cluster. The {name} parameter can be a cluster name, alias, or instance key hint.
Response: Single cluster info object.
Errors:
404if the cluster cannot be resolved.
Returns all instances belonging to a given cluster.
Response: Array of instance objects.
Errors:
404if the cluster cannot be resolved.
Returns the ASCII topology representation for a cluster.
Response:
{
"status": "ok",
"data": {
"clusterName": "my-cluster:3306",
"topology": "..."
}
}Errors:
404if the cluster cannot be resolved.
Returns detailed information about a specific MySQL instance.
Response: Single instance object with replication status, version info, etc.
Errors:
400if the instance key is invalid.404if the instance is not found.
Returns recent recovery entries.
Query Parameters:
cluster(optional): filter by cluster namealias(optional): filter by cluster aliaspage(optional): page number for pagination (default: 0)
Response: Array of recovery objects.
Returns currently active (in-progress) recoveries.
Response: Array of active recovery objects.
Returns the health status of the orchestrator node.
Response: Health status object including hostname, active node info, raft status, etc.
Errors:
500if the node is unhealthy.
Returns all servers from ProxySQL's runtime_mysql_servers table.
Response: Array of ProxySQL server entry objects.
Errors:
503if ProxySQL is not configured.500if querying ProxySQL fails.
The v2 API wraps the same underlying functions as v1 but provides:
- Consistent response envelope: All responses use the
V2APIResponsestruct withstatus,data,error, andmessagefields. - Proper HTTP status codes: v1 always returned 200 with error info in the body; v2 uses appropriate 4xx/5xx codes.
- RESTful URL structure: Resources are nested logically (e.g.,
/clusters/{name}/instancesinstead of/cluster/{clusterHint}). - Structured error codes: Machine-readable error codes (e.g.,
NOT_FOUND,CLUSTER_LIST_ERROR) alongside human-readable messages.
The v1 API remains fully functional. Both APIs can be used simultaneously.