Authenticated HTTP/1.1 surface across SpydQL execution, prepared statements, BM25 search, OpenTelemetry ingestion, alerting/SLOs, Multi-Raft clustering, WAL streaming replication, and online backups. All routes require Bearer auth except GET /v1/health and auth discovery.
curl -sS --cacert tls/ca.crt -X GET "https://localhost:8080/v1/health"const res = await fetch("https://localhost:8080/v1/health", {
method: "GET",
headers: {
},
});
const data = await res.json();import os, httpx
with httpx.Client(verify="tls/ca.crt") as client:
res = client.request(
"GET",
"https://localhost:8080/v1/health",
)
print(res.json())req, _ := http.NewRequest("GET", "https://localhost:8080/v1/health", nil)
resp, err := httpClient.Do(req)HttpRequest req = HttpRequest.newBuilder()
.uri(URI.create("https://localhost:8080/v1/health"))
.method("GET", HttpRequest.BodyPublishers.noBody())
.build();
HttpResponse<String> res = client.send(req, HttpResponse.BodyHandlers.ofString());let res = reqwest_client
.request(reqwest::Method::GET, "https://localhost:8080/v1/health")
.send().await?;
println!("{}", res.text().await?);{
"_schemaName": "Health",
"type": "object",
"required": [
"status",
"draining",
"storage",
"version"
],
"properties": {
"status": {
"type": "string",
"enum": [
"ok",
"draining",
"failed"
]
},
"draining": {
"type": "boolean"
},
"storage": {
"type": "string",
"enum": [
"ok",
"failed"
]
},
"version": {
"type": "string"
}
}
}{
"_schemaName": "Health",
"type": "object",
"required": [
"status",
"draining",
"storage",
"version"
],
"properties": {
"status": {
"type": "string",
"enum": [
"ok",
"draining",
"failed"
]
},
"draining": {
"type": "boolean"
},
"storage": {
"type": "string",
"enum": [
"ok",
"failed"
]
},
"version": {
"type": "string"
}
}
}curl -sS --cacert tls/ca.crt -X POST "https://localhost:8080/v1/query" \
-H "Authorization: Bearer $SPYD_TOKEN" \
-H "Content-Type: application/json" \
-d '{"sql":"orders | where total >= $1 | pick id, customer, total | take 10","parameters":[{"U64":100}]}'const res = await fetch("https://localhost:8080/v1/query", {
method: "POST",
headers: {
Authorization: `Bearer ${process.env.SPYD_TOKEN}`,
"Content-Type": "application/json",
},
body: JSON.stringify({
"sql": "orders | where total >= $1 | pick id, customer, total | take 10",
"parameters": [
{
"U64": 100
}
]
}),
});
const data = await res.json();import os, httpx
with httpx.Client(verify="tls/ca.crt") as client:
res = client.request(
"POST",
"https://localhost:8080/v1/query",
headers={"Authorization": f"Bearer {os.environ['SPYD_TOKEN']}"},
json={"sql":"orders | where total >= $1 | pick id, customer, total | take 10","parameters":[{"U64":100}]},
)
print(res.json())req, _ := http.NewRequest("POST", "https://localhost:8080/v1/query", strings.NewReader("{\"sql\":\"orders | where total >= $1 | pick id, customer, total | take 10\",\"parameters\":[{\"U64\":100}]}"))
req.Header.Set("Authorization", "Bearer " + os.Getenv("SPYD_TOKEN"))
req.Header.Set("Content-Type", "application/json")
resp, err := httpClient.Do(req)HttpRequest req = HttpRequest.newBuilder()
.uri(URI.create("https://localhost:8080/v1/query"))
.header("Authorization", "Bearer " + System.getenv("SPYD_TOKEN"))
.header("Content-Type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\"sql\":\"orders | where total >= $1 | pick id, customer, total | take 10\",\"parameters\":[{\"U64\":100}]}"))
.build();
HttpResponse<String> res = client.send(req, HttpResponse.BodyHandlers.ofString());let res = reqwest_client
.request(reqwest::Method::POST, "https://localhost:8080/v1/query")
.bearer_auth(std::env::var("SPYD_TOKEN")?)
.json(&serde_json::json!({"sql":"orders | where total >= $1 | pick id, customer, total | take 10","parameters":[{"U64":100}]}))
.send().await?;
println!("{}", res.text().await?);{
"_schemaName": "QueryRequest",
"type": "object",
"additionalProperties": false,
"required": [
"sql"
],
"properties": {
"sql": {
"type": "string",
"description": "One SpydQL statement.",
"maxLength": 1048576
},
"parameters": {
"type": "array",
"description": "Positional values for `$1`, `$2`, and so on.",
"items": {
"_schemaName": "Value",
"description": "A tagged value. The tag is the variant name; a null is the string\n\"Null\" and every other variant is an object with one member.\n",
"oneOf": [
{
"const": "Null"
},
{
"type": "object",
"required": [
"Bool"
],
"properties": {
"Bool": {
"type": "boolean"
}
}
},
{
"type": "object",
"required": [
"U8"
],
"properties": {
"U8": {
"type": "integer",
"minimum": 0,
"maximum": 255
}
}
},
{
"type": "object",
"required": [
"U16"
],
"properties": {
"U16": {
"type": "integer",
"minimum": 0,
"maximum": 65535
}
}
},
{
"type": "object",
"required": [
"U32"
],
"properties": {
"U32": {
"type": "integer",
"minimum": 0,
"maximum": 4294967295
}
}
},
{
"type": "object",
"required": [
"U64"
],
"properties": {
"U64": {
"type": "integer",
"minimum": 0
}
}
},
{
"type": "object",
"required": [
"I8"
],
"properties": {
"I8": {
"type": "integer",
"minimum": -128,
"maximum": 127
}
}
},
{
"type": "object",
"required": [
"I16"
],
"properties": {
"I16": {
"type": "integer",
"minimum": -32768,
"maximum": 32767
}
}
},
{
"type": "object",
"required": [
"I32"
],
"properties": {
"I32": {
"type": "integer"
}
}
},
{
"type": "object",
"required": [
"I64"
],
"properties": {
"I64": {
"type": "integer"
}
}
},
{
"type": "object",
"required": [
"F32"
],
"properties": {
"F32": {
"type": "number"
}
}
},
{
"type": "object",
"required": [
"F64"
],
"properties": {
"F64": {
"type": "number"
}
}
},
{
"type": "object",
"required": [
"Decimal"
],
"properties": {
"Decimal": {
"type": "object",
"required": [
"mantissa",
"scale"
],
"properties": {
"mantissa": {
"type": "integer"
},
"scale": {
"type": "integer",
"minimum": 0,
"maximum": 255
}
}
}
}
},
{
"type": "object",
"required": [
"String"
],
"properties": {
"String": {
"type": "string"
}
}
},
{
"type": "object",
"required": [
"Text"
],
"properties": {
"Text": {
"type": "string"
}
}
},
{
"type": "object",
"required": [
"Bytes"
],
"properties": {
"Bytes": {
"type": "array",
"items": {
"type": "integer",
"minimum": 0,
"maximum": 255
}
}
}
},
{
"type": "object",
"required": [
"Timestamp"
],
"properties": {
"Timestamp": {
"type": "integer",
"description": "Microseconds since the Unix epoch."
}
}
},
{
"type": "object",
"required": [
"Date"
],
"properties": {
"Date": {
"type": "integer",
"description": "Days since the Unix epoch."
}
}
},
{
"type": "object",
"required": [
"Json"
],
"properties": {
"Json": {}
}
},
{
"type": "object",
"required": [
"Vector"
],
"properties": {
"Vector": {
"type": "array",
"items": {
"type": "number"
}
}
}
},
{
"type": "object",
"required": [
"GeoPoint"
],
"properties": {
"GeoPoint": {
"type": "object",
"required": [
"lat",
"lng"
],
"properties": {
"lat": {
"type": "number"
},
"lng": {
"type": "number"
}
}
}
}
},
{
"type": "object",
"required": [
"Enum"
],
"properties": {
"Enum": {
"type": "integer",
"minimum": 0
}
}
}
]
}
},
"query_id": {
"type": "integer",
"format": "uint64",
"minimum": 1,
"description": "A client-chosen identifier, usable with the cancel route while the\nstatement runs. The server assigns one when it is absent.\n"
}
}
}{
"_schemaName": "QueryResponse",
"type": "object",
"required": [
"query_id",
"columns",
"rows",
"affected",
"message",
"elapsed_ms"
],
"properties": {
"query_id": {
"type": "integer",
"format": "uint64"
},
"columns": {
"type": "array",
"items": {
"_schemaName": "Column",
"type": "object",
"required": [
"name",
"data_type"
],
"properties": {
"name": {
"type": "string"
},
"data_type": {
"type": "string",
"description": "Rust `Debug` rendering of the column type.",
"examples": [
"U64",
"String { max_len: Some(40) }"
]
}
}
}
},
"rows": {
"type": "array",
"items": {
"type": "array",
"items": {
"$ref": "#/components/schemas/Value"
}
}
},
"affected": {
"type": "integer",
"format": "uint64"
},
"message": {
"type": [
"string",
"null"
]
},
"elapsed_ms": {
"type": "integer",
"format": "uint64"
}
}
}{
"_schemaName": "ErrorEnvelope",
"type": "object",
"required": [
"error"
],
"properties": {
"error": {
"type": "object",
"required": [
"code",
"message"
],
"properties": {
"code": {
"type": "string",
"examples": [
"permission_denied",
"invalid_json",
"resource_limited"
]
},
"message": {
"type": "string"
}
}
},
"request_id": {
"type": "string"
},
"query_id": {
"type": "integer",
"format": "uint64"
}
}
}{
"_schemaName": "ErrorEnvelope",
"type": "object",
"required": [
"error"
],
"properties": {
"error": {
"type": "object",
"required": [
"code",
"message"
],
"properties": {
"code": {
"type": "string",
"examples": [
"permission_denied",
"invalid_json",
"resource_limited"
]
},
"message": {
"type": "string"
}
}
},
"request_id": {
"type": "string"
},
"query_id": {
"type": "integer",
"format": "uint64"
}
}
}curl -sS --cacert tls/ca.crt -X POST "https://localhost:8080/v1/prepare" \
-H "Authorization: Bearer $SPYD_TOKEN" \
-H "Content-Type: application/json" \
-d '{"sql":"orders | where status == $1 | pick id, total | take 10"}'const res = await fetch("https://localhost:8080/v1/prepare", {
method: "POST",
headers: {
Authorization: `Bearer ${process.env.SPYD_TOKEN}`,
"Content-Type": "application/json",
},
body: JSON.stringify({
"sql": "orders | where status == $1 | pick id, total | take 10"
}),
});
const data = await res.json();import os, httpx
with httpx.Client(verify="tls/ca.crt") as client:
res = client.request(
"POST",
"https://localhost:8080/v1/prepare",
headers={"Authorization": f"Bearer {os.environ['SPYD_TOKEN']}"},
json={"sql":"orders | where status == $1 | pick id, total | take 10"},
)
print(res.json())req, _ := http.NewRequest("POST", "https://localhost:8080/v1/prepare", strings.NewReader("{\"sql\":\"orders | where status == $1 | pick id, total | take 10\"}"))
req.Header.Set("Authorization", "Bearer " + os.Getenv("SPYD_TOKEN"))
req.Header.Set("Content-Type", "application/json")
resp, err := httpClient.Do(req)HttpRequest req = HttpRequest.newBuilder()
.uri(URI.create("https://localhost:8080/v1/prepare"))
.header("Authorization", "Bearer " + System.getenv("SPYD_TOKEN"))
.header("Content-Type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\"sql\":\"orders | where status == $1 | pick id, total | take 10\"}"))
.build();
HttpResponse<String> res = client.send(req, HttpResponse.BodyHandlers.ofString());let res = reqwest_client
.request(reqwest::Method::POST, "https://localhost:8080/v1/prepare")
.bearer_auth(std::env::var("SPYD_TOKEN")?)
.json(&serde_json::json!({"sql":"orders | where status == $1 | pick id, total | take 10"}))
.send().await?;
println!("{}", res.text().await?);{
"_schemaName": "PrepareRequest",
"type": "object",
"additionalProperties": false,
"required": [
"sql"
],
"properties": {
"sql": {
"type": "string",
"description": "One SpydQL statement.",
"maxLength": 1048576
}
}
}{
"_schemaName": "PrepareResponse",
"type": "object",
"required": [
"statement_id",
"read_only",
"parameters",
"columns"
],
"properties": {
"statement_id": {
"type": "integer",
"format": "int64",
"minimum": 1,
"description": "Positive 63-bit identifier for the execute and close routes."
},
"read_only": {
"type": "boolean",
"description": "Whether the analyzed plan is cached and reused."
},
"parameters": {
"type": "object",
"required": [
"positional",
"named",
"types"
],
"properties": {
"positional": {
"type": "integer",
"minimum": 0
},
"named": {
"type": "array",
"items": {
"type": "string"
}
},
"types": {
"type": "array",
"items": {
"type": [
"string",
"null"
]
}
}
}
},
"columns": {
"type": "array",
"items": {
"_schemaName": "Column",
"type": "object",
"required": [
"name",
"data_type"
],
"properties": {
"name": {
"type": "string"
},
"data_type": {
"type": "string",
"description": "Rust `Debug` rendering of the column type.",
"examples": [
"U64",
"String { max_len: Some(40) }"
]
}
}
}
}
}
}{
"_schemaName": "ErrorEnvelope",
"type": "object",
"required": [
"error"
],
"properties": {
"error": {
"type": "object",
"required": [
"code",
"message"
],
"properties": {
"code": {
"type": "string",
"examples": [
"permission_denied",
"invalid_json",
"resource_limited"
]
},
"message": {
"type": "string"
}
}
},
"request_id": {
"type": "string"
},
"query_id": {
"type": "integer",
"format": "uint64"
}
}
}{
"_schemaName": "ErrorEnvelope",
"type": "object",
"required": [
"error"
],
"properties": {
"error": {
"type": "object",
"required": [
"code",
"message"
],
"properties": {
"code": {
"type": "string",
"examples": [
"permission_denied",
"invalid_json",
"resource_limited"
]
},
"message": {
"type": "string"
}
}
},
"request_id": {
"type": "string"
},
"query_id": {
"type": "integer",
"format": "uint64"
}
}
}curl -sS --cacert tls/ca.crt -X POST "https://localhost:8080/v1/execute" \
-H "Authorization: Bearer $SPYD_TOKEN" \
-H "Content-Type: application/json" \
-d '{"statement_id":7823465193028471000,"parameters":[{"String":"paid"}]}'const res = await fetch("https://localhost:8080/v1/execute", {
method: "POST",
headers: {
Authorization: `Bearer ${process.env.SPYD_TOKEN}`,
"Content-Type": "application/json",
},
body: JSON.stringify({
"statement_id": 7823465193028471000,
"parameters": [
{
"String": "paid"
}
]
}),
});
const data = await res.json();import os, httpx
with httpx.Client(verify="tls/ca.crt") as client:
res = client.request(
"POST",
"https://localhost:8080/v1/execute",
headers={"Authorization": f"Bearer {os.environ['SPYD_TOKEN']}"},
json={"statement_id":7823465193028471000,"parameters":[{"String":"paid"}]},
)
print(res.json())req, _ := http.NewRequest("POST", "https://localhost:8080/v1/execute", strings.NewReader("{\"statement_id\":7823465193028471000,\"parameters\":[{\"String\":\"paid\"}]}"))
req.Header.Set("Authorization", "Bearer " + os.Getenv("SPYD_TOKEN"))
req.Header.Set("Content-Type", "application/json")
resp, err := httpClient.Do(req)HttpRequest req = HttpRequest.newBuilder()
.uri(URI.create("https://localhost:8080/v1/execute"))
.header("Authorization", "Bearer " + System.getenv("SPYD_TOKEN"))
.header("Content-Type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\"statement_id\":7823465193028471000,\"parameters\":[{\"String\":\"paid\"}]}"))
.build();
HttpResponse<String> res = client.send(req, HttpResponse.BodyHandlers.ofString());let res = reqwest_client
.request(reqwest::Method::POST, "https://localhost:8080/v1/execute")
.bearer_auth(std::env::var("SPYD_TOKEN")?)
.json(&serde_json::json!({"statement_id":7823465193028471000,"parameters":[{"String":"paid"}]}))
.send().await?;
println!("{}", res.text().await?);{
"_schemaName": "ExecuteRequest",
"type": "object",
"additionalProperties": false,
"required": [
"statement_id"
],
"properties": {
"statement_id": {
"type": "integer",
"format": "int64",
"minimum": 1
},
"parameters": {
"type": "array",
"description": "Positional values for `$1`, `$2`, and so on.",
"items": {
"_schemaName": "Value",
"description": "A tagged value. The tag is the variant name; a null is the string\n\"Null\" and every other variant is an object with one member.\n",
"oneOf": [
{
"const": "Null"
},
{
"type": "object",
"required": [
"Bool"
],
"properties": {
"Bool": {
"type": "boolean"
}
}
},
{
"type": "object",
"required": [
"U8"
],
"properties": {
"U8": {
"type": "integer",
"minimum": 0,
"maximum": 255
}
}
},
{
"type": "object",
"required": [
"U16"
],
"properties": {
"U16": {
"type": "integer",
"minimum": 0,
"maximum": 65535
}
}
},
{
"type": "object",
"required": [
"U32"
],
"properties": {
"U32": {
"type": "integer",
"minimum": 0,
"maximum": 4294967295
}
}
},
{
"type": "object",
"required": [
"U64"
],
"properties": {
"U64": {
"type": "integer",
"minimum": 0
}
}
},
{
"type": "object",
"required": [
"I8"
],
"properties": {
"I8": {
"type": "integer",
"minimum": -128,
"maximum": 127
}
}
},
{
"type": "object",
"required": [
"I16"
],
"properties": {
"I16": {
"type": "integer",
"minimum": -32768,
"maximum": 32767
}
}
},
{
"type": "object",
"required": [
"I32"
],
"properties": {
"I32": {
"type": "integer"
}
}
},
{
"type": "object",
"required": [
"I64"
],
"properties": {
"I64": {
"type": "integer"
}
}
},
{
"type": "object",
"required": [
"F32"
],
"properties": {
"F32": {
"type": "number"
}
}
},
{
"type": "object",
"required": [
"F64"
],
"properties": {
"F64": {
"type": "number"
}
}
},
{
"type": "object",
"required": [
"Decimal"
],
"properties": {
"Decimal": {
"type": "object",
"required": [
"mantissa",
"scale"
],
"properties": {
"mantissa": {
"type": "integer"
},
"scale": {
"type": "integer",
"minimum": 0,
"maximum": 255
}
}
}
}
},
{
"type": "object",
"required": [
"String"
],
"properties": {
"String": {
"type": "string"
}
}
},
{
"type": "object",
"required": [
"Text"
],
"properties": {
"Text": {
"type": "string"
}
}
},
{
"type": "object",
"required": [
"Bytes"
],
"properties": {
"Bytes": {
"type": "array",
"items": {
"type": "integer",
"minimum": 0,
"maximum": 255
}
}
}
},
{
"type": "object",
"required": [
"Timestamp"
],
"properties": {
"Timestamp": {
"type": "integer",
"description": "Microseconds since the Unix epoch."
}
}
},
{
"type": "object",
"required": [
"Date"
],
"properties": {
"Date": {
"type": "integer",
"description": "Days since the Unix epoch."
}
}
},
{
"type": "object",
"required": [
"Json"
],
"properties": {
"Json": {}
}
},
{
"type": "object",
"required": [
"Vector"
],
"properties": {
"Vector": {
"type": "array",
"items": {
"type": "number"
}
}
}
},
{
"type": "object",
"required": [
"GeoPoint"
],
"properties": {
"GeoPoint": {
"type": "object",
"required": [
"lat",
"lng"
],
"properties": {
"lat": {
"type": "number"
},
"lng": {
"type": "number"
}
}
}
}
},
{
"type": "object",
"required": [
"Enum"
],
"properties": {
"Enum": {
"type": "integer",
"minimum": 0
}
}
}
]
}
},
"query_id": {
"type": "integer",
"format": "uint64",
"minimum": 1,
"description": "A client-chosen identifier, usable with the cancel route while the\nstatement runs.\n"
}
}
}{
"_schemaName": "QueryResponse",
"type": "object",
"required": [
"query_id",
"columns",
"rows",
"affected",
"message",
"elapsed_ms"
],
"properties": {
"query_id": {
"type": "integer",
"format": "uint64"
},
"columns": {
"type": "array",
"items": {
"_schemaName": "Column",
"type": "object",
"required": [
"name",
"data_type"
],
"properties": {
"name": {
"type": "string"
},
"data_type": {
"type": "string",
"description": "Rust `Debug` rendering of the column type.",
"examples": [
"U64",
"String { max_len: Some(40) }"
]
}
}
}
},
"rows": {
"type": "array",
"items": {
"type": "array",
"items": {
"$ref": "#/components/schemas/Value"
}
}
},
"affected": {
"type": "integer",
"format": "uint64"
},
"message": {
"type": [
"string",
"null"
]
},
"elapsed_ms": {
"type": "integer",
"format": "uint64"
}
}
}{
"_schemaName": "ErrorEnvelope",
"type": "object",
"required": [
"error"
],
"properties": {
"error": {
"type": "object",
"required": [
"code",
"message"
],
"properties": {
"code": {
"type": "string",
"examples": [
"permission_denied",
"invalid_json",
"resource_limited"
]
},
"message": {
"type": "string"
}
}
},
"request_id": {
"type": "string"
},
"query_id": {
"type": "integer",
"format": "uint64"
}
}
}{
"_schemaName": "ErrorEnvelope",
"type": "object",
"required": [
"error"
],
"properties": {
"error": {
"type": "object",
"required": [
"code",
"message"
],
"properties": {
"code": {
"type": "string",
"examples": [
"permission_denied",
"invalid_json",
"resource_limited"
]
},
"message": {
"type": "string"
}
}
},
"request_id": {
"type": "string"
},
"query_id": {
"type": "integer",
"format": "uint64"
}
}
}{
"_schemaName": "ErrorEnvelope",
"type": "object",
"required": [
"error"
],
"properties": {
"error": {
"type": "object",
"required": [
"code",
"message"
],
"properties": {
"code": {
"type": "string",
"examples": [
"permission_denied",
"invalid_json",
"resource_limited"
]
},
"message": {
"type": "string"
}
}
},
"request_id": {
"type": "string"
},
"query_id": {
"type": "integer",
"format": "uint64"
}
}
}{
"_schemaName": "ErrorEnvelope",
"type": "object",
"required": [
"error"
],
"properties": {
"error": {
"type": "object",
"required": [
"code",
"message"
],
"properties": {
"code": {
"type": "string",
"examples": [
"permission_denied",
"invalid_json",
"resource_limited"
]
},
"message": {
"type": "string"
}
}
},
"request_id": {
"type": "string"
},
"query_id": {
"type": "integer",
"format": "uint64"
}
}
}curl -sS --cacert tls/ca.crt -X DELETE "https://localhost:8080/v1/prepared/<statement_id>" \
-H "Authorization: Bearer $SPYD_TOKEN"const res = await fetch("https://localhost:8080/v1/prepared/<statement_id>", {
method: "DELETE",
headers: {
Authorization: `Bearer ${process.env.SPYD_TOKEN}`,
},
});
const data = await res.json();import os, httpx
with httpx.Client(verify="tls/ca.crt") as client:
res = client.request(
"DELETE",
"https://localhost:8080/v1/prepared/<statement_id>",
headers={"Authorization": f"Bearer {os.environ['SPYD_TOKEN']}"},
)
print(res.json())req, _ := http.NewRequest("DELETE", "https://localhost:8080/v1/prepared/<statement_id>", nil)
req.Header.Set("Authorization", "Bearer " + os.Getenv("SPYD_TOKEN"))
resp, err := httpClient.Do(req)HttpRequest req = HttpRequest.newBuilder()
.uri(URI.create("https://localhost:8080/v1/prepared/<statement_id>"))
.header("Authorization", "Bearer " + System.getenv("SPYD_TOKEN"))
.method("DELETE", HttpRequest.BodyPublishers.noBody())
.build();
HttpResponse<String> res = client.send(req, HttpResponse.BodyHandlers.ofString());let res = reqwest_client
.request(reqwest::Method::DELETE, "https://localhost:8080/v1/prepared/<statement_id>")
.bearer_auth(std::env::var("SPYD_TOKEN")?)
.send().await?;
println!("{}", res.text().await?);| Name | In | Required | Schema |
|---|---|---|---|
| statement_id | path | Yes | {"type":"integer","format":"int64","minimum":1} |
{
"type": "object",
"required": [
"closed"
],
"properties": {
"closed": {
"type": "boolean"
}
}
}{
"_schemaName": "ErrorEnvelope",
"type": "object",
"required": [
"error"
],
"properties": {
"error": {
"type": "object",
"required": [
"code",
"message"
],
"properties": {
"code": {
"type": "string",
"examples": [
"permission_denied",
"invalid_json",
"resource_limited"
]
},
"message": {
"type": "string"
}
}
},
"request_id": {
"type": "string"
},
"query_id": {
"type": "integer",
"format": "uint64"
}
}
}curl -sS --cacert tls/ca.crt -X POST "https://localhost:8080/v1/cancel/<query_id>" \
-H "Authorization: Bearer $SPYD_TOKEN" \
-H "Content-Type: application/json" \
-d '{}'const res = await fetch("https://localhost:8080/v1/cancel/<query_id>", {
method: "POST",
headers: {
Authorization: `Bearer ${process.env.SPYD_TOKEN}`,
"Content-Type": "application/json",
},
body: JSON.stringify({}),
});
const data = await res.json();import os, httpx
with httpx.Client(verify="tls/ca.crt") as client:
res = client.request(
"POST",
"https://localhost:8080/v1/cancel/<query_id>",
headers={"Authorization": f"Bearer {os.environ['SPYD_TOKEN']}"},
json={},
)
print(res.json())req, _ := http.NewRequest("POST", "https://localhost:8080/v1/cancel/<query_id>", strings.NewReader("{}"))
req.Header.Set("Authorization", "Bearer " + os.Getenv("SPYD_TOKEN"))
req.Header.Set("Content-Type", "application/json")
resp, err := httpClient.Do(req)HttpRequest req = HttpRequest.newBuilder()
.uri(URI.create("https://localhost:8080/v1/cancel/<query_id>"))
.header("Authorization", "Bearer " + System.getenv("SPYD_TOKEN"))
.header("Content-Type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{}"))
.build();
HttpResponse<String> res = client.send(req, HttpResponse.BodyHandlers.ofString());let res = reqwest_client
.request(reqwest::Method::POST, "https://localhost:8080/v1/cancel/<query_id>")
.bearer_auth(std::env::var("SPYD_TOKEN")?)
.json(&serde_json::json!({}))
.send().await?;
println!("{}", res.text().await?);| Name | In | Required | Schema |
|---|---|---|---|
| query_id | path | Yes | {"type":"integer","format":"uint64"} |
{
"_schemaName": "CancelResponse",
"type": "object",
"required": [
"query_id",
"cancelled"
],
"properties": {
"query_id": {
"type": "integer",
"format": "uint64"
},
"cancelled": {
"type": "boolean"
}
}
}{
"_schemaName": "ErrorEnvelope",
"type": "object",
"required": [
"error"
],
"properties": {
"error": {
"type": "object",
"required": [
"code",
"message"
],
"properties": {
"code": {
"type": "string",
"examples": [
"permission_denied",
"invalid_json",
"resource_limited"
]
},
"message": {
"type": "string"
}
}
},
"request_id": {
"type": "string"
},
"query_id": {
"type": "integer",
"format": "uint64"
}
}
}Searches transactional BM25 indexes across local collections, sharded clusters, or Cross-Cluster Search links.
curl -sS --cacert tls/ca.crt -X POST "https://localhost:8080/v1/search" \
-H "Authorization: Bearer $SPYD_TOKEN" \
-H "Content-Type: application/json" \
-d '{"query":"snapshot encryption","collections":["kb_articles","runbooks"],"take":10}'const res = await fetch("https://localhost:8080/v1/search", {
method: "POST",
headers: {
Authorization: `Bearer ${process.env.SPYD_TOKEN}`,
"Content-Type": "application/json",
},
body: JSON.stringify({
"query": "snapshot encryption",
"collections": [
"kb_articles",
"runbooks"
],
"take": 10
}),
});
const data = await res.json();import os, httpx
with httpx.Client(verify="tls/ca.crt") as client:
res = client.request(
"POST",
"https://localhost:8080/v1/search",
headers={"Authorization": f"Bearer {os.environ['SPYD_TOKEN']}"},
json={"query":"snapshot encryption","collections":["kb_articles","runbooks"],"take":10},
)
print(res.json())req, _ := http.NewRequest("POST", "https://localhost:8080/v1/search", strings.NewReader("{\"query\":\"snapshot encryption\",\"collections\":[\"kb_articles\",\"runbooks\"],\"take\":10}"))
req.Header.Set("Authorization", "Bearer " + os.Getenv("SPYD_TOKEN"))
req.Header.Set("Content-Type", "application/json")
resp, err := httpClient.Do(req)HttpRequest req = HttpRequest.newBuilder()
.uri(URI.create("https://localhost:8080/v1/search"))
.header("Authorization", "Bearer " + System.getenv("SPYD_TOKEN"))
.header("Content-Type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\"query\":\"snapshot encryption\",\"collections\":[\"kb_articles\",\"runbooks\"],\"take\":10}"))
.build();
HttpResponse<String> res = client.send(req, HttpResponse.BodyHandlers.ofString());let res = reqwest_client
.request(reqwest::Method::POST, "https://localhost:8080/v1/search")
.bearer_auth(std::env::var("SPYD_TOKEN")?)
.json(&serde_json::json!({"query":"snapshot encryption","collections":["kb_articles","runbooks"],"take":10}))
.send().await?;
println!("{}", res.text().await?);{
"query": "snapshot encryption",
"collections": [
"kb_articles",
"runbooks"
],
"take": 10
}{
"total": 1,
"hits": [
{
"collection": "kb_articles",
"id": "42",
"score": 4.82,
"highlights": {
"body": "<em>snapshot encryption</em>"
}
}
]
}Returns top matching indexed completions for autocomplete inputs.
curl -sS --cacert tls/ca.crt -X POST "https://localhost:8080/v1/suggest" \
-H "Authorization: Bearer $SPYD_TOKEN" \
-H "Content-Type: application/json" \
-d '{"prefix":"encryp","collections":["kb_articles"],"take":5}'const res = await fetch("https://localhost:8080/v1/suggest", {
method: "POST",
headers: {
Authorization: `Bearer ${process.env.SPYD_TOKEN}`,
"Content-Type": "application/json",
},
body: JSON.stringify({
"prefix": "encryp",
"collections": [
"kb_articles"
],
"take": 5
}),
});
const data = await res.json();import os, httpx
with httpx.Client(verify="tls/ca.crt") as client:
res = client.request(
"POST",
"https://localhost:8080/v1/suggest",
headers={"Authorization": f"Bearer {os.environ['SPYD_TOKEN']}"},
json={"prefix":"encryp","collections":["kb_articles"],"take":5},
)
print(res.json())req, _ := http.NewRequest("POST", "https://localhost:8080/v1/suggest", strings.NewReader("{\"prefix\":\"encryp\",\"collections\":[\"kb_articles\"],\"take\":5}"))
req.Header.Set("Authorization", "Bearer " + os.Getenv("SPYD_TOKEN"))
req.Header.Set("Content-Type", "application/json")
resp, err := httpClient.Do(req)HttpRequest req = HttpRequest.newBuilder()
.uri(URI.create("https://localhost:8080/v1/suggest"))
.header("Authorization", "Bearer " + System.getenv("SPYD_TOKEN"))
.header("Content-Type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\"prefix\":\"encryp\",\"collections\":[\"kb_articles\"],\"take\":5}"))
.build();
HttpResponse<String> res = client.send(req, HttpResponse.BodyHandlers.ofString());let res = reqwest_client
.request(reqwest::Method::POST, "https://localhost:8080/v1/suggest")
.bearer_auth(std::env::var("SPYD_TOKEN")?)
.json(&serde_json::json!({"prefix":"encryp","collections":["kb_articles"],"take":5}))
.send().await?;
println!("{}", res.text().await?);{
"prefix": "encryp",
"collections": [
"kb_articles"
],
"take": 5
}{
"suggestions": [
"encryption",
"encrypted"
]
}Returns the caller session’s privilege-filtered schema catalog for the active X-Spyd-Database.
curl -sS --cacert tls/ca.crt -X GET "https://localhost:8080/v1/catalog" \
-H "Authorization: Bearer $SPYD_TOKEN"const res = await fetch("https://localhost:8080/v1/catalog", {
method: "GET",
headers: {
Authorization: `Bearer ${process.env.SPYD_TOKEN}`,
},
});
const data = await res.json();import os, httpx
with httpx.Client(verify="tls/ca.crt") as client:
res = client.request(
"GET",
"https://localhost:8080/v1/catalog",
headers={"Authorization": f"Bearer {os.environ['SPYD_TOKEN']}"},
)
print(res.json())req, _ := http.NewRequest("GET", "https://localhost:8080/v1/catalog", nil)
req.Header.Set("Authorization", "Bearer " + os.Getenv("SPYD_TOKEN"))
resp, err := httpClient.Do(req)HttpRequest req = HttpRequest.newBuilder()
.uri(URI.create("https://localhost:8080/v1/catalog"))
.header("Authorization", "Bearer " + System.getenv("SPYD_TOKEN"))
.method("GET", HttpRequest.BodyPublishers.noBody())
.build();
HttpResponse<String> res = client.send(req, HttpResponse.BodyHandlers.ofString());let res = reqwest_client
.request(reqwest::Method::GET, "https://localhost:8080/v1/catalog")
.bearer_auth(std::env::var("SPYD_TOKEN")?)
.send().await?;
println!("{}", res.text().await?);{
"database": "default",
"collections": [
{
"name": "orders",
"fields": [
"id",
"customer",
"status",
"total"
]
}
]
}Reports effective identity, bound roles, tenant namespace, selected database, served databases, server status, and least-privilege capability booleans.
curl -sS --cacert tls/ca.crt -X GET "https://localhost:8080/v1/session" \
-H "Authorization: Bearer $SPYD_TOKEN"const res = await fetch("https://localhost:8080/v1/session", {
method: "GET",
headers: {
Authorization: `Bearer ${process.env.SPYD_TOKEN}`,
},
});
const data = await res.json();import os, httpx
with httpx.Client(verify="tls/ca.crt") as client:
res = client.request(
"GET",
"https://localhost:8080/v1/session",
headers={"Authorization": f"Bearer {os.environ['SPYD_TOKEN']}"},
)
print(res.json())req, _ := http.NewRequest("GET", "https://localhost:8080/v1/session", nil)
req.Header.Set("Authorization", "Bearer " + os.Getenv("SPYD_TOKEN"))
resp, err := httpClient.Do(req)HttpRequest req = HttpRequest.newBuilder()
.uri(URI.create("https://localhost:8080/v1/session"))
.header("Authorization", "Bearer " + System.getenv("SPYD_TOKEN"))
.method("GET", HttpRequest.BodyPublishers.noBody())
.build();
HttpResponse<String> res = client.send(req, HttpResponse.BodyHandlers.ofString());let res = reqwest_client
.request(reqwest::Method::GET, "https://localhost:8080/v1/session")
.bearer_auth(std::env::var("SPYD_TOKEN")?)
.send().await?;
println!("{}", res.text().await?);{
"user": "admin",
"roles": [
"admin"
],
"tenant": null,
"database": "default",
"databases": [
"default"
],
"can_manage": true,
"can_maintain": true,
"can_manage_extensions": true,
"can_read_fleet": true,
"version": "1.0.0",
"draining": false
}Returns structured operational counters for the connected node.
curl -sS --cacert tls/ca.crt -X GET "https://localhost:8080/v1/stats" \
-H "Authorization: Bearer $SPYD_TOKEN"const res = await fetch("https://localhost:8080/v1/stats", {
method: "GET",
headers: {
Authorization: `Bearer ${process.env.SPYD_TOKEN}`,
},
});
const data = await res.json();import os, httpx
with httpx.Client(verify="tls/ca.crt") as client:
res = client.request(
"GET",
"https://localhost:8080/v1/stats",
headers={"Authorization": f"Bearer {os.environ['SPYD_TOKEN']}"},
)
print(res.json())req, _ := http.NewRequest("GET", "https://localhost:8080/v1/stats", nil)
req.Header.Set("Authorization", "Bearer " + os.Getenv("SPYD_TOKEN"))
resp, err := httpClient.Do(req)HttpRequest req = HttpRequest.newBuilder()
.uri(URI.create("https://localhost:8080/v1/stats"))
.header("Authorization", "Bearer " + System.getenv("SPYD_TOKEN"))
.method("GET", HttpRequest.BodyPublishers.noBody())
.build();
HttpResponse<String> res = client.send(req, HttpResponse.BodyHandlers.ofString());let res = reqwest_client
.request(reqwest::Method::GET, "https://localhost:8080/v1/stats")
.bearer_auth(std::env::var("SPYD_TOKEN")?)
.send().await?;
println!("{}", res.text().await?);{
"wal_lsn": 18420,
"active_connections": 6,
"catalog_collections": 14
}Streams ready, insert, update, delete, reconnect, and resync_required events backed by the commit journal; supports Last-Event-ID resume and RBAC/tenant/record-grant enforcement.
curl -sS --cacert tls/ca.crt -X POST "https://localhost:8080/v1/events/subscribe" \
-H "Authorization: Bearer $SPYD_TOKEN" \
-H "Content-Type: application/json" \
-d '{"collections":["orders"],"events":["insert","update","delete"]}'const res = await fetch("https://localhost:8080/v1/events/subscribe", {
method: "POST",
headers: {
Authorization: `Bearer ${process.env.SPYD_TOKEN}`,
"Content-Type": "application/json",
},
body: JSON.stringify({
"collections": [
"orders"
],
"events": [
"insert",
"update",
"delete"
]
}),
});
const data = await res.json();import os, httpx
with httpx.Client(verify="tls/ca.crt") as client:
res = client.request(
"POST",
"https://localhost:8080/v1/events/subscribe",
headers={"Authorization": f"Bearer {os.environ['SPYD_TOKEN']}"},
json={"collections":["orders"],"events":["insert","update","delete"]},
)
print(res.json())req, _ := http.NewRequest("POST", "https://localhost:8080/v1/events/subscribe", strings.NewReader("{\"collections\":[\"orders\"],\"events\":[\"insert\",\"update\",\"delete\"]}"))
req.Header.Set("Authorization", "Bearer " + os.Getenv("SPYD_TOKEN"))
req.Header.Set("Content-Type", "application/json")
resp, err := httpClient.Do(req)HttpRequest req = HttpRequest.newBuilder()
.uri(URI.create("https://localhost:8080/v1/events/subscribe"))
.header("Authorization", "Bearer " + System.getenv("SPYD_TOKEN"))
.header("Content-Type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\"collections\":[\"orders\"],\"events\":[\"insert\",\"update\",\"delete\"]}"))
.build();
HttpResponse<String> res = client.send(req, HttpResponse.BodyHandlers.ofString());let res = reqwest_client
.request(reqwest::Method::POST, "https://localhost:8080/v1/events/subscribe")
.bearer_auth(std::env::var("SPYD_TOKEN")?)
.json(&serde_json::json!({"collections":["orders"],"events":["insert","update","delete"]}))
.send().await?;
println!("{}", res.text().await?);{
"collections": [
"orders"
],
"events": [
"insert",
"update",
"delete"
]
}Exchanges bearer authentication for a single-use SSE connection ticket.
curl -sS --cacert tls/ca.crt -X POST "https://localhost:8080/v1/events/ticket" \
-H "Authorization: Bearer $SPYD_TOKEN" \
-H "Content-Type: application/json" \
-d '{"collections":["orders"]}'const res = await fetch("https://localhost:8080/v1/events/ticket", {
method: "POST",
headers: {
Authorization: `Bearer ${process.env.SPYD_TOKEN}`,
"Content-Type": "application/json",
},
body: JSON.stringify({
"collections": [
"orders"
]
}),
});
const data = await res.json();import os, httpx
with httpx.Client(verify="tls/ca.crt") as client:
res = client.request(
"POST",
"https://localhost:8080/v1/events/ticket",
headers={"Authorization": f"Bearer {os.environ['SPYD_TOKEN']}"},
json={"collections":["orders"]},
)
print(res.json())req, _ := http.NewRequest("POST", "https://localhost:8080/v1/events/ticket", strings.NewReader("{\"collections\":[\"orders\"]}"))
req.Header.Set("Authorization", "Bearer " + os.Getenv("SPYD_TOKEN"))
req.Header.Set("Content-Type", "application/json")
resp, err := httpClient.Do(req)HttpRequest req = HttpRequest.newBuilder()
.uri(URI.create("https://localhost:8080/v1/events/ticket"))
.header("Authorization", "Bearer " + System.getenv("SPYD_TOKEN"))
.header("Content-Type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\"collections\":[\"orders\"]}"))
.build();
HttpResponse<String> res = client.send(req, HttpResponse.BodyHandlers.ofString());let res = reqwest_client
.request(reqwest::Method::POST, "https://localhost:8080/v1/events/ticket")
.bearer_auth(std::env::var("SPYD_TOKEN")?)
.json(&serde_json::json!({"collections":["orders"]}))
.send().await?;
println!("{}", res.text().await?);{
"collections": [
"orders"
]
}{
"ticket": "evt_...",
"expires_in_secs": 60
}Public discovery route returning configured external identity providers.
curl -sS --cacert tls/ca.crt -X GET "https://localhost:8080/v1/auth/providers"const res = await fetch("https://localhost:8080/v1/auth/providers", {
method: "GET",
headers: {
},
});
const data = await res.json();import os, httpx
with httpx.Client(verify="tls/ca.crt") as client:
res = client.request(
"GET",
"https://localhost:8080/v1/auth/providers",
)
print(res.json())req, _ := http.NewRequest("GET", "https://localhost:8080/v1/auth/providers", nil)
resp, err := httpClient.Do(req)HttpRequest req = HttpRequest.newBuilder()
.uri(URI.create("https://localhost:8080/v1/auth/providers"))
.method("GET", HttpRequest.BodyPublishers.noBody())
.build();
HttpResponse<String> res = client.send(req, HttpResponse.BodyHandlers.ofString());let res = reqwest_client
.request(reqwest::Method::GET, "https://localhost:8080/v1/auth/providers")
.send().await?;
println!("{}", res.text().await?);{
"oidc": [
{
"name": "corp",
"login_url": "/v1/auth/corp/login"
}
],
"saml": []
}Authenticates configured password/LDAP identities and mints a scoped bearer token.
curl -sS --cacert tls/ca.crt -X POST "https://localhost:8080/v1/auth/login" \
-H "Content-Type: application/json" \
-d '{"user":"alice","password":"secret-password"}'const res = await fetch("https://localhost:8080/v1/auth/login", {
method: "POST",
headers: {
"Content-Type": "application/json",
},
body: JSON.stringify({
"user": "alice",
"password": "secret-password"
}),
});
const data = await res.json();import os, httpx
with httpx.Client(verify="tls/ca.crt") as client:
res = client.request(
"POST",
"https://localhost:8080/v1/auth/login",
json={"user":"alice","password":"secret-password"},
)
print(res.json())req, _ := http.NewRequest("POST", "https://localhost:8080/v1/auth/login", strings.NewReader("{\"user\":\"alice\",\"password\":\"secret-password\"}"))
req.Header.Set("Content-Type", "application/json")
resp, err := httpClient.Do(req)HttpRequest req = HttpRequest.newBuilder()
.uri(URI.create("https://localhost:8080/v1/auth/login"))
.header("Content-Type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\"user\":\"alice\",\"password\":\"secret-password\"}"))
.build();
HttpResponse<String> res = client.send(req, HttpResponse.BodyHandlers.ofString());let res = reqwest_client
.request(reqwest::Method::POST, "https://localhost:8080/v1/auth/login")
.json(&serde_json::json!({"user":"alice","password":"secret-password"}))
.send().await?;
println!("{}", res.text().await?);{
"user": "alice",
"password": "secret-password"
}{
"token": "eyJhbGciOi...",
"user": "alice",
"roles": [
"reader"
]
}Revokes the caller’s minted HTTP session credential.
curl -sS --cacert tls/ca.crt -X POST "https://localhost:8080/v1/auth/logout" \
-H "Authorization: Bearer $SPYD_TOKEN" \
-H "Content-Type: application/json" \
-d '{}'const res = await fetch("https://localhost:8080/v1/auth/logout", {
method: "POST",
headers: {
Authorization: `Bearer ${process.env.SPYD_TOKEN}`,
"Content-Type": "application/json",
},
body: JSON.stringify({}),
});
const data = await res.json();import os, httpx
with httpx.Client(verify="tls/ca.crt") as client:
res = client.request(
"POST",
"https://localhost:8080/v1/auth/logout",
headers={"Authorization": f"Bearer {os.environ['SPYD_TOKEN']}"},
json={},
)
print(res.json())req, _ := http.NewRequest("POST", "https://localhost:8080/v1/auth/logout", strings.NewReader("{}"))
req.Header.Set("Authorization", "Bearer " + os.Getenv("SPYD_TOKEN"))
req.Header.Set("Content-Type", "application/json")
resp, err := httpClient.Do(req)HttpRequest req = HttpRequest.newBuilder()
.uri(URI.create("https://localhost:8080/v1/auth/logout"))
.header("Authorization", "Bearer " + System.getenv("SPYD_TOKEN"))
.header("Content-Type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{}"))
.build();
HttpResponse<String> res = client.send(req, HttpResponse.BodyHandlers.ofString());let res = reqwest_client
.request(reqwest::Method::POST, "https://localhost:8080/v1/auth/logout")
.bearer_auth(std::env::var("SPYD_TOKEN")?)
.json(&serde_json::json!({}))
.send().await?;
println!("{}", res.text().await?);{
"logged_out": true
}Ingests distributed traces into otel_traces and updates otel_service_edges and tail sampling buffers.
curl -sS --cacert tls/ca.crt -X POST "https://localhost:8080/v1/traces" \
-H "Authorization: Bearer $SPYD_TOKEN" \
-H "Content-Type: application/json" \
-d '{"resourceSpans":[{"resource":{"attributes":[{"key":"service.name","value":{"stringValue":"checkout-api"}}]},"scopeSpans":[]}]}'const res = await fetch("https://localhost:8080/v1/traces", {
method: "POST",
headers: {
Authorization: `Bearer ${process.env.SPYD_TOKEN}`,
"Content-Type": "application/json",
},
body: JSON.stringify({
"resourceSpans": [
{
"resource": {
"attributes": [
{
"key": "service.name",
"value": {
"stringValue": "checkout-api"
}
}
]
},
"scopeSpans": []
}
]
}),
});
const data = await res.json();import os, httpx
with httpx.Client(verify="tls/ca.crt") as client:
res = client.request(
"POST",
"https://localhost:8080/v1/traces",
headers={"Authorization": f"Bearer {os.environ['SPYD_TOKEN']}"},
json={"resourceSpans":[{"resource":{"attributes":[{"key":"service.name","value":{"stringValue":"checkout-api"}}]},"scopeSpans":[]}]},
)
print(res.json())req, _ := http.NewRequest("POST", "https://localhost:8080/v1/traces", strings.NewReader("{\"resourceSpans\":[{\"resource\":{\"attributes\":[{\"key\":\"service.name\",\"value\":{\"stringValue\":\"checkout-api\"}}]},\"scopeSpans\":[]}]}"))
req.Header.Set("Authorization", "Bearer " + os.Getenv("SPYD_TOKEN"))
req.Header.Set("Content-Type", "application/json")
resp, err := httpClient.Do(req)HttpRequest req = HttpRequest.newBuilder()
.uri(URI.create("https://localhost:8080/v1/traces"))
.header("Authorization", "Bearer " + System.getenv("SPYD_TOKEN"))
.header("Content-Type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\"resourceSpans\":[{\"resource\":{\"attributes\":[{\"key\":\"service.name\",\"value\":{\"stringValue\":\"checkout-api\"}}]},\"scopeSpans\":[]}]}"))
.build();
HttpResponse<String> res = client.send(req, HttpResponse.BodyHandlers.ofString());let res = reqwest_client
.request(reqwest::Method::POST, "https://localhost:8080/v1/traces")
.bearer_auth(std::env::var("SPYD_TOKEN")?)
.json(&serde_json::json!({"resourceSpans":[{"resource":{"attributes":[{"key":"service.name","value":{"stringValue":"checkout-api"}}]},"scopeSpans":[]}]}))
.send().await?;
println!("{}", res.text().await?);{
"resourceSpans": [
{
"resource": {
"attributes": [
{
"key": "service.name",
"value": {
"stringValue": "checkout-api"
}
}
]
},
"scopeSpans": []
}
]
}{
"accepted_spans": 1
}Ingests OTLP metric points into otel_metrics for SpydQL querying and alerting.
curl -sS --cacert tls/ca.crt -X POST "https://localhost:8080/v1/metrics" \
-H "Authorization: Bearer $SPYD_TOKEN" \
-H "Content-Type: application/json" \
-d '{"resourceMetrics":[]}'const res = await fetch("https://localhost:8080/v1/metrics", {
method: "POST",
headers: {
Authorization: `Bearer ${process.env.SPYD_TOKEN}`,
"Content-Type": "application/json",
},
body: JSON.stringify({
"resourceMetrics": []
}),
});
const data = await res.json();import os, httpx
with httpx.Client(verify="tls/ca.crt") as client:
res = client.request(
"POST",
"https://localhost:8080/v1/metrics",
headers={"Authorization": f"Bearer {os.environ['SPYD_TOKEN']}"},
json={"resourceMetrics":[]},
)
print(res.json())req, _ := http.NewRequest("POST", "https://localhost:8080/v1/metrics", strings.NewReader("{\"resourceMetrics\":[]}"))
req.Header.Set("Authorization", "Bearer " + os.Getenv("SPYD_TOKEN"))
req.Header.Set("Content-Type", "application/json")
resp, err := httpClient.Do(req)HttpRequest req = HttpRequest.newBuilder()
.uri(URI.create("https://localhost:8080/v1/metrics"))
.header("Authorization", "Bearer " + System.getenv("SPYD_TOKEN"))
.header("Content-Type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\"resourceMetrics\":[]}"))
.build();
HttpResponse<String> res = client.send(req, HttpResponse.BodyHandlers.ofString());let res = reqwest_client
.request(reqwest::Method::POST, "https://localhost:8080/v1/metrics")
.bearer_auth(std::env::var("SPYD_TOKEN")?)
.json(&serde_json::json!({"resourceMetrics":[]}))
.send().await?;
println!("{}", res.text().await?);{
"resourceMetrics": []
}{
"accepted_metrics": 0
}Stores trace-correlated log records with automatic BM25 indexing.
curl -sS --cacert tls/ca.crt -X POST "https://localhost:8080/v1/logs" \
-H "Authorization: Bearer $SPYD_TOKEN" \
-H "Content-Type: application/json" \
-d '{"resourceLogs":[]}'const res = await fetch("https://localhost:8080/v1/logs", {
method: "POST",
headers: {
Authorization: `Bearer ${process.env.SPYD_TOKEN}`,
"Content-Type": "application/json",
},
body: JSON.stringify({
"resourceLogs": []
}),
});
const data = await res.json();import os, httpx
with httpx.Client(verify="tls/ca.crt") as client:
res = client.request(
"POST",
"https://localhost:8080/v1/logs",
headers={"Authorization": f"Bearer {os.environ['SPYD_TOKEN']}"},
json={"resourceLogs":[]},
)
print(res.json())req, _ := http.NewRequest("POST", "https://localhost:8080/v1/logs", strings.NewReader("{\"resourceLogs\":[]}"))
req.Header.Set("Authorization", "Bearer " + os.Getenv("SPYD_TOKEN"))
req.Header.Set("Content-Type", "application/json")
resp, err := httpClient.Do(req)HttpRequest req = HttpRequest.newBuilder()
.uri(URI.create("https://localhost:8080/v1/logs"))
.header("Authorization", "Bearer " + System.getenv("SPYD_TOKEN"))
.header("Content-Type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\"resourceLogs\":[]}"))
.build();
HttpResponse<String> res = client.send(req, HttpResponse.BodyHandlers.ofString());let res = reqwest_client
.request(reqwest::Method::POST, "https://localhost:8080/v1/logs")
.bearer_auth(std::env::var("SPYD_TOKEN")?)
.json(&serde_json::json!({"resourceLogs":[]}))
.send().await?;
println!("{}", res.text().await?);{
"resourceLogs": []
}{
"accepted_logs": 0
}Pre-creates telemetry tables and indexes before ingest starts.
curl -sS --cacert tls/ca.crt -X POST "https://localhost:8080/v1/apm/bootstrap" \
-H "Authorization: Bearer $SPYD_TOKEN" \
-H "Content-Type: application/json" \
-d '{}'const res = await fetch("https://localhost:8080/v1/apm/bootstrap", {
method: "POST",
headers: {
Authorization: `Bearer ${process.env.SPYD_TOKEN}`,
"Content-Type": "application/json",
},
body: JSON.stringify({}),
});
const data = await res.json();import os, httpx
with httpx.Client(verify="tls/ca.crt") as client:
res = client.request(
"POST",
"https://localhost:8080/v1/apm/bootstrap",
headers={"Authorization": f"Bearer {os.environ['SPYD_TOKEN']}"},
json={},
)
print(res.json())req, _ := http.NewRequest("POST", "https://localhost:8080/v1/apm/bootstrap", strings.NewReader("{}"))
req.Header.Set("Authorization", "Bearer " + os.Getenv("SPYD_TOKEN"))
req.Header.Set("Content-Type", "application/json")
resp, err := httpClient.Do(req)HttpRequest req = HttpRequest.newBuilder()
.uri(URI.create("https://localhost:8080/v1/apm/bootstrap"))
.header("Authorization", "Bearer " + System.getenv("SPYD_TOKEN"))
.header("Content-Type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{}"))
.build();
HttpResponse<String> res = client.send(req, HttpResponse.BodyHandlers.ofString());let res = reqwest_client
.request(reqwest::Method::POST, "https://localhost:8080/v1/apm/bootstrap")
.bearer_auth(std::env::var("SPYD_TOKEN")?)
.json(&serde_json::json!({}))
.send().await?;
println!("{}", res.text().await?);{
"initialized": true
}Computes requests, error count, error rate %, avg, p50, p95, and p99 latency per service.
curl -sS --cacert tls/ca.crt -X GET "https://localhost:8080/v1/apm/services" \
-H "Authorization: Bearer $SPYD_TOKEN"const res = await fetch("https://localhost:8080/v1/apm/services", {
method: "GET",
headers: {
Authorization: `Bearer ${process.env.SPYD_TOKEN}`,
},
});
const data = await res.json();import os, httpx
with httpx.Client(verify="tls/ca.crt") as client:
res = client.request(
"GET",
"https://localhost:8080/v1/apm/services",
headers={"Authorization": f"Bearer {os.environ['SPYD_TOKEN']}"},
)
print(res.json())req, _ := http.NewRequest("GET", "https://localhost:8080/v1/apm/services", nil)
req.Header.Set("Authorization", "Bearer " + os.Getenv("SPYD_TOKEN"))
resp, err := httpClient.Do(req)HttpRequest req = HttpRequest.newBuilder()
.uri(URI.create("https://localhost:8080/v1/apm/services"))
.header("Authorization", "Bearer " + System.getenv("SPYD_TOKEN"))
.method("GET", HttpRequest.BodyPublishers.noBody())
.build();
HttpResponse<String> res = client.send(req, HttpResponse.BodyHandlers.ofString());let res = reqwest_client
.request(reqwest::Method::GET, "https://localhost:8080/v1/apm/services")
.bearer_auth(std::env::var("SPYD_TOKEN")?)
.send().await?;
println!("{}", res.text().await?);{
"services": [
{
"service": "checkout-api",
"requests": 14200,
"error_rate_pct": 0.21,
"p95_ms": 44.2
}
]
}Returns windowed time-series metrics for APM charts.
curl -sS --cacert tls/ca.crt -X GET "https://localhost:8080/v1/apm/timeseries" \
-H "Authorization: Bearer $SPYD_TOKEN"const res = await fetch("https://localhost:8080/v1/apm/timeseries", {
method: "GET",
headers: {
Authorization: `Bearer ${process.env.SPYD_TOKEN}`,
},
});
const data = await res.json();import os, httpx
with httpx.Client(verify="tls/ca.crt") as client:
res = client.request(
"GET",
"https://localhost:8080/v1/apm/timeseries",
headers={"Authorization": f"Bearer {os.environ['SPYD_TOKEN']}"},
)
print(res.json())req, _ := http.NewRequest("GET", "https://localhost:8080/v1/apm/timeseries", nil)
req.Header.Set("Authorization", "Bearer " + os.Getenv("SPYD_TOKEN"))
resp, err := httpClient.Do(req)HttpRequest req = HttpRequest.newBuilder()
.uri(URI.create("https://localhost:8080/v1/apm/timeseries"))
.header("Authorization", "Bearer " + System.getenv("SPYD_TOKEN"))
.method("GET", HttpRequest.BodyPublishers.noBody())
.build();
HttpResponse<String> res = client.send(req, HttpResponse.BodyHandlers.ofString());let res = reqwest_client
.request(reqwest::Method::GET, "https://localhost:8080/v1/apm/timeseries")
.bearer_auth(std::env::var("SPYD_TOKEN")?)
.send().await?;
println!("{}", res.text().await?);{
"buckets": [
{
"ts": "2026-11-27T15:00:00Z",
"requests": 380,
"p95_ms": 39.1
}
]
}Lists recent traces with root service, operation, span count, status, and duration.
curl -sS --cacert tls/ca.crt -X GET "https://localhost:8080/v1/apm/traces" \
-H "Authorization: Bearer $SPYD_TOKEN"const res = await fetch("https://localhost:8080/v1/apm/traces", {
method: "GET",
headers: {
Authorization: `Bearer ${process.env.SPYD_TOKEN}`,
},
});
const data = await res.json();import os, httpx
with httpx.Client(verify="tls/ca.crt") as client:
res = client.request(
"GET",
"https://localhost:8080/v1/apm/traces",
headers={"Authorization": f"Bearer {os.environ['SPYD_TOKEN']}"},
)
print(res.json())req, _ := http.NewRequest("GET", "https://localhost:8080/v1/apm/traces", nil)
req.Header.Set("Authorization", "Bearer " + os.Getenv("SPYD_TOKEN"))
resp, err := httpClient.Do(req)HttpRequest req = HttpRequest.newBuilder()
.uri(URI.create("https://localhost:8080/v1/apm/traces"))
.header("Authorization", "Bearer " + System.getenv("SPYD_TOKEN"))
.method("GET", HttpRequest.BodyPublishers.noBody())
.build();
HttpResponse<String> res = client.send(req, HttpResponse.BodyHandlers.ofString());let res = reqwest_client
.request(reqwest::Method::GET, "https://localhost:8080/v1/apm/traces")
.bearer_auth(std::env::var("SPYD_TOKEN")?)
.send().await?;
println!("{}", res.text().await?);{
"traces": [
{
"trace_id": "4bf92f3577b34da6a3ce929d0e0e4736",
"service": "api-gateway",
"duration_ms": 68.4
}
]
}Returns hierarchical offset/depth waterfall spans plus linked logs and flamegraphs.
curl -sS --cacert tls/ca.crt -X GET "https://localhost:8080/v1/apm/traces/<trace_id>" \
-H "Authorization: Bearer $SPYD_TOKEN"const res = await fetch("https://localhost:8080/v1/apm/traces/<trace_id>", {
method: "GET",
headers: {
Authorization: `Bearer ${process.env.SPYD_TOKEN}`,
},
});
const data = await res.json();import os, httpx
with httpx.Client(verify="tls/ca.crt") as client:
res = client.request(
"GET",
"https://localhost:8080/v1/apm/traces/<trace_id>",
headers={"Authorization": f"Bearer {os.environ['SPYD_TOKEN']}"},
)
print(res.json())req, _ := http.NewRequest("GET", "https://localhost:8080/v1/apm/traces/<trace_id>", nil)
req.Header.Set("Authorization", "Bearer " + os.Getenv("SPYD_TOKEN"))
resp, err := httpClient.Do(req)HttpRequest req = HttpRequest.newBuilder()
.uri(URI.create("https://localhost:8080/v1/apm/traces/<trace_id>"))
.header("Authorization", "Bearer " + System.getenv("SPYD_TOKEN"))
.method("GET", HttpRequest.BodyPublishers.noBody())
.build();
HttpResponse<String> res = client.send(req, HttpResponse.BodyHandlers.ofString());let res = reqwest_client
.request(reqwest::Method::GET, "https://localhost:8080/v1/apm/traces/<trace_id>")
.bearer_auth(std::env::var("SPYD_TOKEN")?)
.send().await?;
println!("{}", res.text().await?);| Name | In | Required | Schema |
|---|---|---|---|
| trace_id | path | Yes | {"type":"string"} |
{
"trace_id": "4bf92f3577b34da6a3ce929d0e0e4736",
"spans": [],
"logs": []
}Returns nodes and weighted edges discovered from OTLP parent-child spans.
curl -sS --cacert tls/ca.crt -X GET "https://localhost:8080/v1/apm/service-map" \
-H "Authorization: Bearer $SPYD_TOKEN"const res = await fetch("https://localhost:8080/v1/apm/service-map", {
method: "GET",
headers: {
Authorization: `Bearer ${process.env.SPYD_TOKEN}`,
},
});
const data = await res.json();import os, httpx
with httpx.Client(verify="tls/ca.crt") as client:
res = client.request(
"GET",
"https://localhost:8080/v1/apm/service-map",
headers={"Authorization": f"Bearer {os.environ['SPYD_TOKEN']}"},
)
print(res.json())req, _ := http.NewRequest("GET", "https://localhost:8080/v1/apm/service-map", nil)
req.Header.Set("Authorization", "Bearer " + os.Getenv("SPYD_TOKEN"))
resp, err := httpClient.Do(req)HttpRequest req = HttpRequest.newBuilder()
.uri(URI.create("https://localhost:8080/v1/apm/service-map"))
.header("Authorization", "Bearer " + System.getenv("SPYD_TOKEN"))
.method("GET", HttpRequest.BodyPublishers.noBody())
.build();
HttpResponse<String> res = client.send(req, HttpResponse.BodyHandlers.ofString());let res = reqwest_client
.request(reqwest::Method::GET, "https://localhost:8080/v1/apm/service-map")
.bearer_auth(std::env::var("SPYD_TOKEN")?)
.send().await?;
println!("{}", res.text().await?);{
"nodes": [
{
"id": "api-gateway"
},
{
"id": "spyddb"
}
],
"edges": [
{
"source": "api-gateway",
"target": "spyddb",
"calls": 1200
}
]
}Returns grouped application errors with occurrences and status (open/resolved/ignored).
curl -sS --cacert tls/ca.crt -X GET "https://localhost:8080/v1/apm/errors" \
-H "Authorization: Bearer $SPYD_TOKEN"const res = await fetch("https://localhost:8080/v1/apm/errors", {
method: "GET",
headers: {
Authorization: `Bearer ${process.env.SPYD_TOKEN}`,
},
});
const data = await res.json();import os, httpx
with httpx.Client(verify="tls/ca.crt") as client:
res = client.request(
"GET",
"https://localhost:8080/v1/apm/errors",
headers={"Authorization": f"Bearer {os.environ['SPYD_TOKEN']}"},
)
print(res.json())req, _ := http.NewRequest("GET", "https://localhost:8080/v1/apm/errors", nil)
req.Header.Set("Authorization", "Bearer " + os.Getenv("SPYD_TOKEN"))
resp, err := httpClient.Do(req)HttpRequest req = HttpRequest.newBuilder()
.uri(URI.create("https://localhost:8080/v1/apm/errors"))
.header("Authorization", "Bearer " + System.getenv("SPYD_TOKEN"))
.method("GET", HttpRequest.BodyPublishers.noBody())
.build();
HttpResponse<String> res = client.send(req, HttpResponse.BodyHandlers.ofString());let res = reqwest_client
.request(reqwest::Method::GET, "https://localhost:8080/v1/apm/errors")
.bearer_auth(std::env::var("SPYD_TOKEN")?)
.send().await?;
println!("{}", res.text().await?);{
"errors": [
{
"fingerprint": "a81f90c2",
"exception_type": "TimeoutError",
"occurrences": 14,
"status": "open"
}
]
}Transitions the triage status of an exception fingerprint.
curl -sS --cacert tls/ca.crt -X POST "https://localhost:8080/v1/apm/errors/<fingerprint>/status" \
-H "Authorization: Bearer $SPYD_TOKEN" \
-H "Content-Type: application/json" \
-d '{"status":"resolved"}'const res = await fetch("https://localhost:8080/v1/apm/errors/<fingerprint>/status", {
method: "POST",
headers: {
Authorization: `Bearer ${process.env.SPYD_TOKEN}`,
"Content-Type": "application/json",
},
body: JSON.stringify({
"status": "resolved"
}),
});
const data = await res.json();import os, httpx
with httpx.Client(verify="tls/ca.crt") as client:
res = client.request(
"POST",
"https://localhost:8080/v1/apm/errors/<fingerprint>/status",
headers={"Authorization": f"Bearer {os.environ['SPYD_TOKEN']}"},
json={"status":"resolved"},
)
print(res.json())req, _ := http.NewRequest("POST", "https://localhost:8080/v1/apm/errors/<fingerprint>/status", strings.NewReader("{\"status\":\"resolved\"}"))
req.Header.Set("Authorization", "Bearer " + os.Getenv("SPYD_TOKEN"))
req.Header.Set("Content-Type", "application/json")
resp, err := httpClient.Do(req)HttpRequest req = HttpRequest.newBuilder()
.uri(URI.create("https://localhost:8080/v1/apm/errors/<fingerprint>/status"))
.header("Authorization", "Bearer " + System.getenv("SPYD_TOKEN"))
.header("Content-Type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\"status\":\"resolved\"}"))
.build();
HttpResponse<String> res = client.send(req, HttpResponse.BodyHandlers.ofString());let res = reqwest_client
.request(reqwest::Method::POST, "https://localhost:8080/v1/apm/errors/<fingerprint>/status")
.bearer_auth(std::env::var("SPYD_TOKEN")?)
.json(&serde_json::json!({"status":"resolved"}))
.send().await?;
println!("{}", res.text().await?);| Name | In | Required | Schema |
|---|---|---|---|
| fingerprint | path | Yes | {"type":"string"} |
{
"status": "resolved"
}{
"fingerprint": "a81f90c2",
"status": "resolved"
}Returns folded stack frame aggregations filtered by service or trace_id.
curl -sS --cacert tls/ca.crt -X GET "https://localhost:8080/v1/apm/profiles" \
-H "Authorization: Bearer $SPYD_TOKEN"const res = await fetch("https://localhost:8080/v1/apm/profiles", {
method: "GET",
headers: {
Authorization: `Bearer ${process.env.SPYD_TOKEN}`,
},
});
const data = await res.json();import os, httpx
with httpx.Client(verify="tls/ca.crt") as client:
res = client.request(
"GET",
"https://localhost:8080/v1/apm/profiles",
headers={"Authorization": f"Bearer {os.environ['SPYD_TOKEN']}"},
)
print(res.json())req, _ := http.NewRequest("GET", "https://localhost:8080/v1/apm/profiles", nil)
req.Header.Set("Authorization", "Bearer " + os.Getenv("SPYD_TOKEN"))
resp, err := httpClient.Do(req)HttpRequest req = HttpRequest.newBuilder()
.uri(URI.create("https://localhost:8080/v1/apm/profiles"))
.header("Authorization", "Bearer " + System.getenv("SPYD_TOKEN"))
.method("GET", HttpRequest.BodyPublishers.noBody())
.build();
HttpResponse<String> res = client.send(req, HttpResponse.BodyHandlers.ofString());let res = reqwest_client
.request(reqwest::Method::GET, "https://localhost:8080/v1/apm/profiles")
.bearer_auth(std::env::var("SPYD_TOKEN")?)
.send().await?;
println!("{}", res.text().await?);{
"profiles": []
}Records continuous profiling stacks linked to services and trace IDs.
curl -sS --cacert tls/ca.crt -X POST "https://localhost:8080/v1/profiles" \
-H "Authorization: Bearer $SPYD_TOKEN" \
-H "Content-Type: application/json" \
-d '{"service":"checkout-api","profile_type":"cpu","stacks":"main;handle_order 42\n"}'const res = await fetch("https://localhost:8080/v1/profiles", {
method: "POST",
headers: {
Authorization: `Bearer ${process.env.SPYD_TOKEN}`,
"Content-Type": "application/json",
},
body: JSON.stringify({
"service": "checkout-api",
"profile_type": "cpu",
"stacks": "main;handle_order 42\n"
}),
});
const data = await res.json();import os, httpx
with httpx.Client(verify="tls/ca.crt") as client:
res = client.request(
"POST",
"https://localhost:8080/v1/profiles",
headers={"Authorization": f"Bearer {os.environ['SPYD_TOKEN']}"},
json={"service":"checkout-api","profile_type":"cpu","stacks":"main;handle_order 42\n"},
)
print(res.json())req, _ := http.NewRequest("POST", "https://localhost:8080/v1/profiles", strings.NewReader("{\"service\":\"checkout-api\",\"profile_type\":\"cpu\",\"stacks\":\"main;handle_order 42\\n\"}"))
req.Header.Set("Authorization", "Bearer " + os.Getenv("SPYD_TOKEN"))
req.Header.Set("Content-Type", "application/json")
resp, err := httpClient.Do(req)HttpRequest req = HttpRequest.newBuilder()
.uri(URI.create("https://localhost:8080/v1/profiles"))
.header("Authorization", "Bearer " + System.getenv("SPYD_TOKEN"))
.header("Content-Type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\"service\":\"checkout-api\",\"profile_type\":\"cpu\",\"stacks\":\"main;handle_order 42\\n\"}"))
.build();
HttpResponse<String> res = client.send(req, HttpResponse.BodyHandlers.ofString());let res = reqwest_client
.request(reqwest::Method::POST, "https://localhost:8080/v1/profiles")
.bearer_auth(std::env::var("SPYD_TOKEN")?)
.json(&serde_json::json!({"service":"checkout-api","profile_type":"cpu","stacks":"main;handle_order 42\n"}))
.send().await?;
println!("{}", res.text().await?);{
"service": "checkout-api",
"profile_type": "cpu",
"stacks": "main;handle_order 42\n"
}{
"accepted": true
}Records LCP, INP, CLS, FCP, and TTFB beacons alongside frontend exceptions.
curl -sS --cacert tls/ca.crt -X POST "https://localhost:8080/v1/apm/rum" \
-H "Authorization: Bearer $SPYD_TOKEN" \
-H "Content-Type: application/json" \
-d '{"app":"storefront-web","url":"/checkout","lcp_ms":1420,"inp_ms":48,"cls":0.02}'const res = await fetch("https://localhost:8080/v1/apm/rum", {
method: "POST",
headers: {
Authorization: `Bearer ${process.env.SPYD_TOKEN}`,
"Content-Type": "application/json",
},
body: JSON.stringify({
"app": "storefront-web",
"url": "/checkout",
"lcp_ms": 1420,
"inp_ms": 48,
"cls": 0.02
}),
});
const data = await res.json();import os, httpx
with httpx.Client(verify="tls/ca.crt") as client:
res = client.request(
"POST",
"https://localhost:8080/v1/apm/rum",
headers={"Authorization": f"Bearer {os.environ['SPYD_TOKEN']}"},
json={"app":"storefront-web","url":"/checkout","lcp_ms":1420,"inp_ms":48,"cls":0.02},
)
print(res.json())req, _ := http.NewRequest("POST", "https://localhost:8080/v1/apm/rum", strings.NewReader("{\"app\":\"storefront-web\",\"url\":\"/checkout\",\"lcp_ms\":1420,\"inp_ms\":48,\"cls\":0.02}"))
req.Header.Set("Authorization", "Bearer " + os.Getenv("SPYD_TOKEN"))
req.Header.Set("Content-Type", "application/json")
resp, err := httpClient.Do(req)HttpRequest req = HttpRequest.newBuilder()
.uri(URI.create("https://localhost:8080/v1/apm/rum"))
.header("Authorization", "Bearer " + System.getenv("SPYD_TOKEN"))
.header("Content-Type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\"app\":\"storefront-web\",\"url\":\"/checkout\",\"lcp_ms\":1420,\"inp_ms\":48,\"cls\":0.02}"))
.build();
HttpResponse<String> res = client.send(req, HttpResponse.BodyHandlers.ofString());let res = reqwest_client
.request(reqwest::Method::POST, "https://localhost:8080/v1/apm/rum")
.bearer_auth(std::env::var("SPYD_TOKEN")?)
.json(&serde_json::json!({"app":"storefront-web","url":"/checkout","lcp_ms":1420,"inp_ms":48,"cls":0.02}))
.send().await?;
println!("{}", res.text().await?);{
"app": "storefront-web",
"url": "/checkout",
"lcp_ms": 1420,
"inp_ms": 48,
"cls": 0.02
}{
"recorded": true
}Registers a recurring endpoint check stored in otel_synthetics_monitors.
curl -sS --cacert tls/ca.crt -X POST "https://localhost:8080/v1/apm/synthetics" \
-H "Authorization: Bearer $SPYD_TOKEN" \
-H "Content-Type: application/json" \
-d '{"name":"api-health","kind":"http","target":"https://api.example.com/health","interval_secs":60}'const res = await fetch("https://localhost:8080/v1/apm/synthetics", {
method: "POST",
headers: {
Authorization: `Bearer ${process.env.SPYD_TOKEN}`,
"Content-Type": "application/json",
},
body: JSON.stringify({
"name": "api-health",
"kind": "http",
"target": "https://api.example.com/health",
"interval_secs": 60
}),
});
const data = await res.json();import os, httpx
with httpx.Client(verify="tls/ca.crt") as client:
res = client.request(
"POST",
"https://localhost:8080/v1/apm/synthetics",
headers={"Authorization": f"Bearer {os.environ['SPYD_TOKEN']}"},
json={"name":"api-health","kind":"http","target":"https://api.example.com/health","interval_secs":60},
)
print(res.json())req, _ := http.NewRequest("POST", "https://localhost:8080/v1/apm/synthetics", strings.NewReader("{\"name\":\"api-health\",\"kind\":\"http\",\"target\":\"https://api.example.com/health\",\"interval_secs\":60}"))
req.Header.Set("Authorization", "Bearer " + os.Getenv("SPYD_TOKEN"))
req.Header.Set("Content-Type", "application/json")
resp, err := httpClient.Do(req)HttpRequest req = HttpRequest.newBuilder()
.uri(URI.create("https://localhost:8080/v1/apm/synthetics"))
.header("Authorization", "Bearer " + System.getenv("SPYD_TOKEN"))
.header("Content-Type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\"name\":\"api-health\",\"kind\":\"http\",\"target\":\"https://api.example.com/health\",\"interval_secs\":60}"))
.build();
HttpResponse<String> res = client.send(req, HttpResponse.BodyHandlers.ofString());let res = reqwest_client
.request(reqwest::Method::POST, "https://localhost:8080/v1/apm/synthetics")
.bearer_auth(std::env::var("SPYD_TOKEN")?)
.json(&serde_json::json!({"name":"api-health","kind":"http","target":"https://api.example.com/health","interval_secs":60}))
.send().await?;
println!("{}", res.text().await?);{
"name": "api-health",
"kind": "http",
"target": "https://api.example.com/health",
"interval_secs": 60
}{
"id": 1,
"name": "api-health"
}Configures keep_errors, min_latency_ms, and baseline_rate without restarting.
curl -sS --cacert tls/ca.crt -X PUT "https://localhost:8080/v1/apm/sampling" \
-H "Authorization: Bearer $SPYD_TOKEN" \
-H "Content-Type: application/json" \
-d '{"enabled":true,"keep_errors":true,"min_latency_ms":250,"baseline_rate":0.1,"max_buffered_traces":4096}'const res = await fetch("https://localhost:8080/v1/apm/sampling", {
method: "PUT",
headers: {
Authorization: `Bearer ${process.env.SPYD_TOKEN}`,
"Content-Type": "application/json",
},
body: JSON.stringify({
"enabled": true,
"keep_errors": true,
"min_latency_ms": 250,
"baseline_rate": 0.1,
"max_buffered_traces": 4096
}),
});
const data = await res.json();import os, httpx
with httpx.Client(verify="tls/ca.crt") as client:
res = client.request(
"PUT",
"https://localhost:8080/v1/apm/sampling",
headers={"Authorization": f"Bearer {os.environ['SPYD_TOKEN']}"},
json={"enabled":true,"keep_errors":true,"min_latency_ms":250,"baseline_rate":0.1,"max_buffered_traces":4096},
)
print(res.json())req, _ := http.NewRequest("PUT", "https://localhost:8080/v1/apm/sampling", strings.NewReader("{\"enabled\":true,\"keep_errors\":true,\"min_latency_ms\":250,\"baseline_rate\":0.1,\"max_buffered_traces\":4096}"))
req.Header.Set("Authorization", "Bearer " + os.Getenv("SPYD_TOKEN"))
req.Header.Set("Content-Type", "application/json")
resp, err := httpClient.Do(req)HttpRequest req = HttpRequest.newBuilder()
.uri(URI.create("https://localhost:8080/v1/apm/sampling"))
.header("Authorization", "Bearer " + System.getenv("SPYD_TOKEN"))
.header("Content-Type", "application/json")
.method("PUT", HttpRequest.BodyPublishers.ofString("{\"enabled\":true,\"keep_errors\":true,\"min_latency_ms\":250,\"baseline_rate\":0.1,\"max_buffered_traces\":4096}"))
.build();
HttpResponse<String> res = client.send(req, HttpResponse.BodyHandlers.ofString());let res = reqwest_client
.request(reqwest::Method::PUT, "https://localhost:8080/v1/apm/sampling")
.bearer_auth(std::env::var("SPYD_TOKEN")?)
.json(&serde_json::json!({"enabled":true,"keep_errors":true,"min_latency_ms":250,"baseline_rate":0.1,"max_buffered_traces":4096}))
.send().await?;
println!("{}", res.text().await?);{
"enabled": true,
"keep_errors": true,
"min_latency_ms": 250,
"baseline_rate": 0.1,
"max_buffered_traces": 4096
}{
"updated": true
}Computes real-time availability/latency compliance, remaining error budget %, and burn rates.
curl -sS --cacert tls/ca.crt -X GET "https://localhost:8080/v1/slos" \
-H "Authorization: Bearer $SPYD_TOKEN"const res = await fetch("https://localhost:8080/v1/slos", {
method: "GET",
headers: {
Authorization: `Bearer ${process.env.SPYD_TOKEN}`,
},
});
const data = await res.json();import os, httpx
with httpx.Client(verify="tls/ca.crt") as client:
res = client.request(
"GET",
"https://localhost:8080/v1/slos",
headers={"Authorization": f"Bearer {os.environ['SPYD_TOKEN']}"},
)
print(res.json())req, _ := http.NewRequest("GET", "https://localhost:8080/v1/slos", nil)
req.Header.Set("Authorization", "Bearer " + os.Getenv("SPYD_TOKEN"))
resp, err := httpClient.Do(req)HttpRequest req = HttpRequest.newBuilder()
.uri(URI.create("https://localhost:8080/v1/slos"))
.header("Authorization", "Bearer " + System.getenv("SPYD_TOKEN"))
.method("GET", HttpRequest.BodyPublishers.noBody())
.build();
HttpResponse<String> res = client.send(req, HttpResponse.BodyHandlers.ofString());let res = reqwest_client
.request(reqwest::Method::GET, "https://localhost:8080/v1/slos")
.bearer_auth(std::env::var("SPYD_TOKEN")?)
.send().await?;
println!("{}", res.text().await?);{
"slos": [
{
"id": 1,
"name": "checkout-99.9",
"objective_pct": 99.9,
"budget_remaining_pct": 91.4
}
]
}Defines a new SLO evaluated continuously over otel_traces or custom SpydQL queries.
curl -sS --cacert tls/ca.crt -X POST "https://localhost:8080/v1/slos" \
-H "Authorization: Bearer $SPYD_TOKEN" \
-H "Content-Type: application/json" \
-d '{"name":"checkout-99.9","service":"checkout-api","sli_kind":"availability","objective_pct":99.9,"window_secs":2592000}'const res = await fetch("https://localhost:8080/v1/slos", {
method: "POST",
headers: {
Authorization: `Bearer ${process.env.SPYD_TOKEN}`,
"Content-Type": "application/json",
},
body: JSON.stringify({
"name": "checkout-99.9",
"service": "checkout-api",
"sli_kind": "availability",
"objective_pct": 99.9,
"window_secs": 2592000
}),
});
const data = await res.json();import os, httpx
with httpx.Client(verify="tls/ca.crt") as client:
res = client.request(
"POST",
"https://localhost:8080/v1/slos",
headers={"Authorization": f"Bearer {os.environ['SPYD_TOKEN']}"},
json={"name":"checkout-99.9","service":"checkout-api","sli_kind":"availability","objective_pct":99.9,"window_secs":2592000},
)
print(res.json())req, _ := http.NewRequest("POST", "https://localhost:8080/v1/slos", strings.NewReader("{\"name\":\"checkout-99.9\",\"service\":\"checkout-api\",\"sli_kind\":\"availability\",\"objective_pct\":99.9,\"window_secs\":2592000}"))
req.Header.Set("Authorization", "Bearer " + os.Getenv("SPYD_TOKEN"))
req.Header.Set("Content-Type", "application/json")
resp, err := httpClient.Do(req)HttpRequest req = HttpRequest.newBuilder()
.uri(URI.create("https://localhost:8080/v1/slos"))
.header("Authorization", "Bearer " + System.getenv("SPYD_TOKEN"))
.header("Content-Type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\"name\":\"checkout-99.9\",\"service\":\"checkout-api\",\"sli_kind\":\"availability\",\"objective_pct\":99.9,\"window_secs\":2592000}"))
.build();
HttpResponse<String> res = client.send(req, HttpResponse.BodyHandlers.ofString());let res = reqwest_client
.request(reqwest::Method::POST, "https://localhost:8080/v1/slos")
.bearer_auth(std::env::var("SPYD_TOKEN")?)
.json(&serde_json::json!({"name":"checkout-99.9","service":"checkout-api","sli_kind":"availability","objective_pct":99.9,"window_secs":2592000}))
.send().await?;
println!("{}", res.text().await?);{
"name": "checkout-99.9",
"service": "checkout-api",
"sli_kind": "availability",
"objective_pct": 99.9,
"window_secs": 2592000
}{
"id": 1,
"name": "checkout-99.9"
}Configures outbound alert delivery targets.
curl -sS --cacert tls/ca.crt -X POST "https://localhost:8080/v1/alerts/channels" \
-H "Authorization: Bearer $SPYD_TOKEN" \
-H "Content-Type: application/json" \
-d '{"name":"ops-webhook","kind":"webhook","target_url":"https://hooks.internal/alerts","secret":"whsec_secret","enabled":true}'const res = await fetch("https://localhost:8080/v1/alerts/channels", {
method: "POST",
headers: {
Authorization: `Bearer ${process.env.SPYD_TOKEN}`,
"Content-Type": "application/json",
},
body: JSON.stringify({
"name": "ops-webhook",
"kind": "webhook",
"target_url": "https://hooks.internal/alerts",
"secret": "whsec_secret",
"enabled": true
}),
});
const data = await res.json();import os, httpx
with httpx.Client(verify="tls/ca.crt") as client:
res = client.request(
"POST",
"https://localhost:8080/v1/alerts/channels",
headers={"Authorization": f"Bearer {os.environ['SPYD_TOKEN']}"},
json={"name":"ops-webhook","kind":"webhook","target_url":"https://hooks.internal/alerts","secret":"whsec_secret","enabled":true},
)
print(res.json())req, _ := http.NewRequest("POST", "https://localhost:8080/v1/alerts/channels", strings.NewReader("{\"name\":\"ops-webhook\",\"kind\":\"webhook\",\"target_url\":\"https://hooks.internal/alerts\",\"secret\":\"whsec_secret\",\"enabled\":true}"))
req.Header.Set("Authorization", "Bearer " + os.Getenv("SPYD_TOKEN"))
req.Header.Set("Content-Type", "application/json")
resp, err := httpClient.Do(req)HttpRequest req = HttpRequest.newBuilder()
.uri(URI.create("https://localhost:8080/v1/alerts/channels"))
.header("Authorization", "Bearer " + System.getenv("SPYD_TOKEN"))
.header("Content-Type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\"name\":\"ops-webhook\",\"kind\":\"webhook\",\"target_url\":\"https://hooks.internal/alerts\",\"secret\":\"whsec_secret\",\"enabled\":true}"))
.build();
HttpResponse<String> res = client.send(req, HttpResponse.BodyHandlers.ofString());let res = reqwest_client
.request(reqwest::Method::POST, "https://localhost:8080/v1/alerts/channels")
.bearer_auth(std::env::var("SPYD_TOKEN")?)
.json(&serde_json::json!({"name":"ops-webhook","kind":"webhook","target_url":"https://hooks.internal/alerts","secret":"whsec_secret","enabled":true}))
.send().await?;
println!("{}", res.text().await?);{
"name": "ops-webhook",
"kind": "webhook",
"target_url": "https://hooks.internal/alerts",
"secret": "whsec_secret",
"enabled": true
}{
"id": 1,
"name": "ops-webhook"
}Evaluates periodically and fires notifications across configured channels.
curl -sS --cacert tls/ca.crt -X POST "https://localhost:8080/v1/alerts/rules" \
-H "Authorization: Bearer $SPYD_TOKEN" \
-H "Content-Type: application/json" \
-d '{"name":"high-p95","rule_kind":"spydql_threshold","query":"otel_traces | agg approx_percentile(duration_ms, 0.95) as p95","metric_column":"p95","comparator":"gt","threshold":250,"for_secs":60,"severity":"critical","channel_ids":[1]}'const res = await fetch("https://localhost:8080/v1/alerts/rules", {
method: "POST",
headers: {
Authorization: `Bearer ${process.env.SPYD_TOKEN}`,
"Content-Type": "application/json",
},
body: JSON.stringify({
"name": "high-p95",
"rule_kind": "spydql_threshold",
"query": "otel_traces | agg approx_percentile(duration_ms, 0.95) as p95",
"metric_column": "p95",
"comparator": "gt",
"threshold": 250,
"for_secs": 60,
"severity": "critical",
"channel_ids": [
1
]
}),
});
const data = await res.json();import os, httpx
with httpx.Client(verify="tls/ca.crt") as client:
res = client.request(
"POST",
"https://localhost:8080/v1/alerts/rules",
headers={"Authorization": f"Bearer {os.environ['SPYD_TOKEN']}"},
json={"name":"high-p95","rule_kind":"spydql_threshold","query":"otel_traces | agg approx_percentile(duration_ms, 0.95) as p95","metric_column":"p95","comparator":"gt","threshold":250,"for_secs":60,"severity":"critical","channel_ids":[1]},
)
print(res.json())req, _ := http.NewRequest("POST", "https://localhost:8080/v1/alerts/rules", strings.NewReader("{\"name\":\"high-p95\",\"rule_kind\":\"spydql_threshold\",\"query\":\"otel_traces | agg approx_percentile(duration_ms, 0.95) as p95\",\"metric_column\":\"p95\",\"comparator\":\"gt\",\"threshold\":250,\"for_secs\":60,\"severity\":\"critical\",\"channel_ids\":[1]}"))
req.Header.Set("Authorization", "Bearer " + os.Getenv("SPYD_TOKEN"))
req.Header.Set("Content-Type", "application/json")
resp, err := httpClient.Do(req)HttpRequest req = HttpRequest.newBuilder()
.uri(URI.create("https://localhost:8080/v1/alerts/rules"))
.header("Authorization", "Bearer " + System.getenv("SPYD_TOKEN"))
.header("Content-Type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\"name\":\"high-p95\",\"rule_kind\":\"spydql_threshold\",\"query\":\"otel_traces | agg approx_percentile(duration_ms, 0.95) as p95\",\"metric_column\":\"p95\",\"comparator\":\"gt\",\"threshold\":250,\"for_secs\":60,\"severity\":\"critical\",\"channel_ids\":[1]}"))
.build();
HttpResponse<String> res = client.send(req, HttpResponse.BodyHandlers.ofString());let res = reqwest_client
.request(reqwest::Method::POST, "https://localhost:8080/v1/alerts/rules")
.bearer_auth(std::env::var("SPYD_TOKEN")?)
.json(&serde_json::json!({"name":"high-p95","rule_kind":"spydql_threshold","query":"otel_traces | agg approx_percentile(duration_ms, 0.95) as p95","metric_column":"p95","comparator":"gt","threshold":250,"for_secs":60,"severity":"critical","channel_ids":[1]}))
.send().await?;
println!("{}", res.text().await?);{
"name": "high-p95",
"rule_kind": "spydql_threshold",
"query": "otel_traces | agg approx_percentile(duration_ms, 0.95) as p95",
"metric_column": "p95",
"comparator": "gt",
"threshold": 250,
"for_secs": 60,
"severity": "critical",
"channel_ids": [
1
]
}{
"id": 1,
"name": "high-p95",
"state": "ok"
}Suspends paging on rule {id} for duration_secs.
curl -sS --cacert tls/ca.crt -X POST "https://localhost:8080/v1/alerts/rules/<id>/silence" \
-H "Authorization: Bearer $SPYD_TOKEN" \
-H "Content-Type: application/json" \
-d '{"duration_secs":3600}'const res = await fetch("https://localhost:8080/v1/alerts/rules/<id>/silence", {
method: "POST",
headers: {
Authorization: `Bearer ${process.env.SPYD_TOKEN}`,
"Content-Type": "application/json",
},
body: JSON.stringify({
"duration_secs": 3600
}),
});
const data = await res.json();import os, httpx
with httpx.Client(verify="tls/ca.crt") as client:
res = client.request(
"POST",
"https://localhost:8080/v1/alerts/rules/<id>/silence",
headers={"Authorization": f"Bearer {os.environ['SPYD_TOKEN']}"},
json={"duration_secs":3600},
)
print(res.json())req, _ := http.NewRequest("POST", "https://localhost:8080/v1/alerts/rules/<id>/silence", strings.NewReader("{\"duration_secs\":3600}"))
req.Header.Set("Authorization", "Bearer " + os.Getenv("SPYD_TOKEN"))
req.Header.Set("Content-Type", "application/json")
resp, err := httpClient.Do(req)HttpRequest req = HttpRequest.newBuilder()
.uri(URI.create("https://localhost:8080/v1/alerts/rules/<id>/silence"))
.header("Authorization", "Bearer " + System.getenv("SPYD_TOKEN"))
.header("Content-Type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\"duration_secs\":3600}"))
.build();
HttpResponse<String> res = client.send(req, HttpResponse.BodyHandlers.ofString());let res = reqwest_client
.request(reqwest::Method::POST, "https://localhost:8080/v1/alerts/rules/<id>/silence")
.bearer_auth(std::env::var("SPYD_TOKEN")?)
.json(&serde_json::json!({"duration_secs":3600}))
.send().await?;
println!("{}", res.text().await?);| Name | In | Required | Schema |
|---|---|---|---|
| id | path | Yes | {"type":"integer"} |
{
"duration_secs": 3600
}{
"silenced": true
}Evaluates pending state transitions and returns evaluation results.
curl -sS --cacert tls/ca.crt -X POST "https://localhost:8080/v1/alerts/evaluate" \
-H "Authorization: Bearer $SPYD_TOKEN" \
-H "Content-Type: application/json" \
-d '{}'const res = await fetch("https://localhost:8080/v1/alerts/evaluate", {
method: "POST",
headers: {
Authorization: `Bearer ${process.env.SPYD_TOKEN}`,
"Content-Type": "application/json",
},
body: JSON.stringify({}),
});
const data = await res.json();import os, httpx
with httpx.Client(verify="tls/ca.crt") as client:
res = client.request(
"POST",
"https://localhost:8080/v1/alerts/evaluate",
headers={"Authorization": f"Bearer {os.environ['SPYD_TOKEN']}"},
json={},
)
print(res.json())req, _ := http.NewRequest("POST", "https://localhost:8080/v1/alerts/evaluate", strings.NewReader("{}"))
req.Header.Set("Authorization", "Bearer " + os.Getenv("SPYD_TOKEN"))
req.Header.Set("Content-Type", "application/json")
resp, err := httpClient.Do(req)HttpRequest req = HttpRequest.newBuilder()
.uri(URI.create("https://localhost:8080/v1/alerts/evaluate"))
.header("Authorization", "Bearer " + System.getenv("SPYD_TOKEN"))
.header("Content-Type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{}"))
.build();
HttpResponse<String> res = client.send(req, HttpResponse.BodyHandlers.ofString());let res = reqwest_client
.request(reqwest::Method::POST, "https://localhost:8080/v1/alerts/evaluate")
.bearer_auth(std::env::var("SPYD_TOKEN")?)
.json(&serde_json::json!({}))
.send().await?;
println!("{}", res.text().await?);{
"evaluated": 3,
"firing": 0
}Lists firing, pending, and resolved incident transitions.
curl -sS --cacert tls/ca.crt -X GET "https://localhost:8080/v1/alerts/events" \
-H "Authorization: Bearer $SPYD_TOKEN"const res = await fetch("https://localhost:8080/v1/alerts/events", {
method: "GET",
headers: {
Authorization: `Bearer ${process.env.SPYD_TOKEN}`,
},
});
const data = await res.json();import os, httpx
with httpx.Client(verify="tls/ca.crt") as client:
res = client.request(
"GET",
"https://localhost:8080/v1/alerts/events",
headers={"Authorization": f"Bearer {os.environ['SPYD_TOKEN']}"},
)
print(res.json())req, _ := http.NewRequest("GET", "https://localhost:8080/v1/alerts/events", nil)
req.Header.Set("Authorization", "Bearer " + os.Getenv("SPYD_TOKEN"))
resp, err := httpClient.Do(req)HttpRequest req = HttpRequest.newBuilder()
.uri(URI.create("https://localhost:8080/v1/alerts/events"))
.header("Authorization", "Bearer " + System.getenv("SPYD_TOKEN"))
.method("GET", HttpRequest.BodyPublishers.noBody())
.build();
HttpResponse<String> res = client.send(req, HttpResponse.BodyHandlers.ofString());let res = reqwest_client
.request(reqwest::Method::GET, "https://localhost:8080/v1/alerts/events")
.bearer_auth(std::env::var("SPYD_TOKEN")?)
.send().await?;
println!("{}", res.text().await?);{
"events": []
}Returns full redacted topology metadata for the distributed cluster.
curl -sS --cacert tls/ca.crt -X GET "https://localhost:8080/v1/cluster/topology" \
-H "Authorization: Bearer $SPYD_TOKEN"const res = await fetch("https://localhost:8080/v1/cluster/topology", {
method: "GET",
headers: {
Authorization: `Bearer ${process.env.SPYD_TOKEN}`,
},
});
const data = await res.json();import os, httpx
with httpx.Client(verify="tls/ca.crt") as client:
res = client.request(
"GET",
"https://localhost:8080/v1/cluster/topology",
headers={"Authorization": f"Bearer {os.environ['SPYD_TOKEN']}"},
)
print(res.json())req, _ := http.NewRequest("GET", "https://localhost:8080/v1/cluster/topology", nil)
req.Header.Set("Authorization", "Bearer " + os.Getenv("SPYD_TOKEN"))
resp, err := httpClient.Do(req)HttpRequest req = HttpRequest.newBuilder()
.uri(URI.create("https://localhost:8080/v1/cluster/topology"))
.header("Authorization", "Bearer " + System.getenv("SPYD_TOKEN"))
.method("GET", HttpRequest.BodyPublishers.noBody())
.build();
HttpResponse<String> res = client.send(req, HttpResponse.BodyHandlers.ofString());let res = reqwest_client
.request(reqwest::Method::GET, "https://localhost:8080/v1/cluster/topology")
.bearer_auth(std::env::var("SPYD_TOKEN")?)
.send().await?;
println!("{}", res.text().await?);{
"generation": 4,
"nodes": [],
"sharded_collections": [],
"raft_groups": []
}Adds a voter/learner HTTP + SpydWire node descriptor.
curl -sS --cacert tls/ca.crt -X POST "https://localhost:8080/v1/cluster/nodes" \
-H "Authorization: Bearer $SPYD_TOKEN" \
-H "Content-Type: application/json" \
-d '{"node_id":"node-2","http_url":"https://node2.internal:8080","wire_addr":"node2.internal:5433","role":"voter"}'const res = await fetch("https://localhost:8080/v1/cluster/nodes", {
method: "POST",
headers: {
Authorization: `Bearer ${process.env.SPYD_TOKEN}`,
"Content-Type": "application/json",
},
body: JSON.stringify({
"node_id": "node-2",
"http_url": "https://node2.internal:8080",
"wire_addr": "node2.internal:5433",
"role": "voter"
}),
});
const data = await res.json();import os, httpx
with httpx.Client(verify="tls/ca.crt") as client:
res = client.request(
"POST",
"https://localhost:8080/v1/cluster/nodes",
headers={"Authorization": f"Bearer {os.environ['SPYD_TOKEN']}"},
json={"node_id":"node-2","http_url":"https://node2.internal:8080","wire_addr":"node2.internal:5433","role":"voter"},
)
print(res.json())req, _ := http.NewRequest("POST", "https://localhost:8080/v1/cluster/nodes", strings.NewReader("{\"node_id\":\"node-2\",\"http_url\":\"https://node2.internal:8080\",\"wire_addr\":\"node2.internal:5433\",\"role\":\"voter\"}"))
req.Header.Set("Authorization", "Bearer " + os.Getenv("SPYD_TOKEN"))
req.Header.Set("Content-Type", "application/json")
resp, err := httpClient.Do(req)HttpRequest req = HttpRequest.newBuilder()
.uri(URI.create("https://localhost:8080/v1/cluster/nodes"))
.header("Authorization", "Bearer " + System.getenv("SPYD_TOKEN"))
.header("Content-Type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\"node_id\":\"node-2\",\"http_url\":\"https://node2.internal:8080\",\"wire_addr\":\"node2.internal:5433\",\"role\":\"voter\"}"))
.build();
HttpResponse<String> res = client.send(req, HttpResponse.BodyHandlers.ofString());let res = reqwest_client
.request(reqwest::Method::POST, "https://localhost:8080/v1/cluster/nodes")
.bearer_auth(std::env::var("SPYD_TOKEN")?)
.json(&serde_json::json!({"node_id":"node-2","http_url":"https://node2.internal:8080","wire_addr":"node2.internal:5433","role":"voter"}))
.send().await?;
println!("{}", res.text().await?);{
"node_id": "node-2",
"http_url": "https://node2.internal:8080",
"wire_addr": "node2.internal:5433",
"role": "voter"
}{
"generation": 5,
"registered": "node-2"
}Partitions a collection by shard_key across voter nodes.
curl -sS --cacert tls/ca.crt -X POST "https://localhost:8080/v1/cluster/shards" \
-H "Authorization: Bearer $SPYD_TOKEN" \
-H "Content-Type: application/json" \
-d '{"collection":"orders","shard_key":"customer_id","strategy":"hash","shard_count":8,"replication_factor":3}'const res = await fetch("https://localhost:8080/v1/cluster/shards", {
method: "POST",
headers: {
Authorization: `Bearer ${process.env.SPYD_TOKEN}`,
"Content-Type": "application/json",
},
body: JSON.stringify({
"collection": "orders",
"shard_key": "customer_id",
"strategy": "hash",
"shard_count": 8,
"replication_factor": 3
}),
});
const data = await res.json();import os, httpx
with httpx.Client(verify="tls/ca.crt") as client:
res = client.request(
"POST",
"https://localhost:8080/v1/cluster/shards",
headers={"Authorization": f"Bearer {os.environ['SPYD_TOKEN']}"},
json={"collection":"orders","shard_key":"customer_id","strategy":"hash","shard_count":8,"replication_factor":3},
)
print(res.json())req, _ := http.NewRequest("POST", "https://localhost:8080/v1/cluster/shards", strings.NewReader("{\"collection\":\"orders\",\"shard_key\":\"customer_id\",\"strategy\":\"hash\",\"shard_count\":8,\"replication_factor\":3}"))
req.Header.Set("Authorization", "Bearer " + os.Getenv("SPYD_TOKEN"))
req.Header.Set("Content-Type", "application/json")
resp, err := httpClient.Do(req)HttpRequest req = HttpRequest.newBuilder()
.uri(URI.create("https://localhost:8080/v1/cluster/shards"))
.header("Authorization", "Bearer " + System.getenv("SPYD_TOKEN"))
.header("Content-Type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\"collection\":\"orders\",\"shard_key\":\"customer_id\",\"strategy\":\"hash\",\"shard_count\":8,\"replication_factor\":3}"))
.build();
HttpResponse<String> res = client.send(req, HttpResponse.BodyHandlers.ofString());let res = reqwest_client
.request(reqwest::Method::POST, "https://localhost:8080/v1/cluster/shards")
.bearer_auth(std::env::var("SPYD_TOKEN")?)
.json(&serde_json::json!({"collection":"orders","shard_key":"customer_id","strategy":"hash","shard_count":8,"replication_factor":3}))
.send().await?;
println!("{}", res.text().await?);{
"collection": "orders",
"shard_key": "customer_id",
"strategy": "hash",
"shard_count": 8,
"replication_factor": 3
}{
"collection": "orders",
"shard_count": 8
}Performs DualWrite catch-up, write fence, delta drain, and generation cutover.
curl -sS --cacert tls/ca.crt -X POST "https://localhost:8080/v1/cluster/shards/rebalance" \
-H "Authorization: Bearer $SPYD_TOKEN" \
-H "Content-Type: application/json" \
-d '{"collection":"orders","shard_id":2,"to_node":"node-2"}'const res = await fetch("https://localhost:8080/v1/cluster/shards/rebalance", {
method: "POST",
headers: {
Authorization: `Bearer ${process.env.SPYD_TOKEN}`,
"Content-Type": "application/json",
},
body: JSON.stringify({
"collection": "orders",
"shard_id": 2,
"to_node": "node-2"
}),
});
const data = await res.json();import os, httpx
with httpx.Client(verify="tls/ca.crt") as client:
res = client.request(
"POST",
"https://localhost:8080/v1/cluster/shards/rebalance",
headers={"Authorization": f"Bearer {os.environ['SPYD_TOKEN']}"},
json={"collection":"orders","shard_id":2,"to_node":"node-2"},
)
print(res.json())req, _ := http.NewRequest("POST", "https://localhost:8080/v1/cluster/shards/rebalance", strings.NewReader("{\"collection\":\"orders\",\"shard_id\":2,\"to_node\":\"node-2\"}"))
req.Header.Set("Authorization", "Bearer " + os.Getenv("SPYD_TOKEN"))
req.Header.Set("Content-Type", "application/json")
resp, err := httpClient.Do(req)HttpRequest req = HttpRequest.newBuilder()
.uri(URI.create("https://localhost:8080/v1/cluster/shards/rebalance"))
.header("Authorization", "Bearer " + System.getenv("SPYD_TOKEN"))
.header("Content-Type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\"collection\":\"orders\",\"shard_id\":2,\"to_node\":\"node-2\"}"))
.build();
HttpResponse<String> res = client.send(req, HttpResponse.BodyHandlers.ofString());let res = reqwest_client
.request(reqwest::Method::POST, "https://localhost:8080/v1/cluster/shards/rebalance")
.bearer_auth(std::env::var("SPYD_TOKEN")?)
.json(&serde_json::json!({"collection":"orders","shard_id":2,"to_node":"node-2"}))
.send().await?;
println!("{}", res.text().await?);{
"collection": "orders",
"shard_id": 2,
"to_node": "node-2"
}{
"migrated": true,
"generation": 6
}Supports per-shard quorum durability and atomic cross-shard 2PC commits.
curl -sS --cacert tls/ca.crt -X POST "https://localhost:8080/v1/cluster/insert" \
-H "Authorization: Bearer $SPYD_TOKEN" \
-H "Content-Type: application/json" \
-d '{"collection":"orders","rows":[{"id":101,"customer_id":7,"total":95}],"write_concern":"quorum","atomic":true}'const res = await fetch("https://localhost:8080/v1/cluster/insert", {
method: "POST",
headers: {
Authorization: `Bearer ${process.env.SPYD_TOKEN}`,
"Content-Type": "application/json",
},
body: JSON.stringify({
"collection": "orders",
"rows": [
{
"id": 101,
"customer_id": 7,
"total": 95
}
],
"write_concern": "quorum",
"atomic": true
}),
});
const data = await res.json();import os, httpx
with httpx.Client(verify="tls/ca.crt") as client:
res = client.request(
"POST",
"https://localhost:8080/v1/cluster/insert",
headers={"Authorization": f"Bearer {os.environ['SPYD_TOKEN']}"},
json={"collection":"orders","rows":[{"id":101,"customer_id":7,"total":95}],"write_concern":"quorum","atomic":true},
)
print(res.json())req, _ := http.NewRequest("POST", "https://localhost:8080/v1/cluster/insert", strings.NewReader("{\"collection\":\"orders\",\"rows\":[{\"id\":101,\"customer_id\":7,\"total\":95}],\"write_concern\":\"quorum\",\"atomic\":true}"))
req.Header.Set("Authorization", "Bearer " + os.Getenv("SPYD_TOKEN"))
req.Header.Set("Content-Type", "application/json")
resp, err := httpClient.Do(req)HttpRequest req = HttpRequest.newBuilder()
.uri(URI.create("https://localhost:8080/v1/cluster/insert"))
.header("Authorization", "Bearer " + System.getenv("SPYD_TOKEN"))
.header("Content-Type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\"collection\":\"orders\",\"rows\":[{\"id\":101,\"customer_id\":7,\"total\":95}],\"write_concern\":\"quorum\",\"atomic\":true}"))
.build();
HttpResponse<String> res = client.send(req, HttpResponse.BodyHandlers.ofString());let res = reqwest_client
.request(reqwest::Method::POST, "https://localhost:8080/v1/cluster/insert")
.bearer_auth(std::env::var("SPYD_TOKEN")?)
.json(&serde_json::json!({"collection":"orders","rows":[{"id":101,"customer_id":7,"total":95}],"write_concern":"quorum","atomic":true}))
.send().await?;
println!("{}", res.text().await?);{
"collection": "orders",
"rows": [
{
"id": 101,
"customer_id": 7,
"total": 95
}
],
"write_concern": "quorum",
"atomic": true
}{
"inserted": 1
}Prunes irrelevant shards, merges partial aggregates, and optionally fans out across clusters[].
curl -sS --cacert tls/ca.crt -X POST "https://localhost:8080/v1/cluster/query" \
-H "Authorization: Bearer $SPYD_TOKEN" \
-H "Content-Type: application/json" \
-d '{"sql":"orders | where customer_id == $1 | pick id, total","parameters":[{"U64":7}],"clusters":["local","eu-west"]}'const res = await fetch("https://localhost:8080/v1/cluster/query", {
method: "POST",
headers: {
Authorization: `Bearer ${process.env.SPYD_TOKEN}`,
"Content-Type": "application/json",
},
body: JSON.stringify({
"sql": "orders | where customer_id == $1 | pick id, total",
"parameters": [
{
"U64": 7
}
],
"clusters": [
"local",
"eu-west"
]
}),
});
const data = await res.json();import os, httpx
with httpx.Client(verify="tls/ca.crt") as client:
res = client.request(
"POST",
"https://localhost:8080/v1/cluster/query",
headers={"Authorization": f"Bearer {os.environ['SPYD_TOKEN']}"},
json={"sql":"orders | where customer_id == $1 | pick id, total","parameters":[{"U64":7}],"clusters":["local","eu-west"]},
)
print(res.json())req, _ := http.NewRequest("POST", "https://localhost:8080/v1/cluster/query", strings.NewReader("{\"sql\":\"orders | where customer_id == $1 | pick id, total\",\"parameters\":[{\"U64\":7}],\"clusters\":[\"local\",\"eu-west\"]}"))
req.Header.Set("Authorization", "Bearer " + os.Getenv("SPYD_TOKEN"))
req.Header.Set("Content-Type", "application/json")
resp, err := httpClient.Do(req)HttpRequest req = HttpRequest.newBuilder()
.uri(URI.create("https://localhost:8080/v1/cluster/query"))
.header("Authorization", "Bearer " + System.getenv("SPYD_TOKEN"))
.header("Content-Type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\"sql\":\"orders | where customer_id == $1 | pick id, total\",\"parameters\":[{\"U64\":7}],\"clusters\":[\"local\",\"eu-west\"]}"))
.build();
HttpResponse<String> res = client.send(req, HttpResponse.BodyHandlers.ofString());let res = reqwest_client
.request(reqwest::Method::POST, "https://localhost:8080/v1/cluster/query")
.bearer_auth(std::env::var("SPYD_TOKEN")?)
.json(&serde_json::json!({"sql":"orders | where customer_id == $1 | pick id, total","parameters":[{"U64":7}],"clusters":["local","eu-west"]}))
.send().await?;
println!("{}", res.text().await?);{
"sql": "orders | where customer_id == $1 | pick id, total",
"parameters": [
{
"U64": 7
}
],
"clusters": [
"local",
"eu-west"
]
}{
"columns": [
{
"name": "id",
"data_type": "U64"
}
],
"rows": []
}Performs add_voter, remove_voter, transfer_leadership, or campaign on a shard Raft group.
curl -sS --cacert tls/ca.crt -X POST "https://localhost:8080/v1/cluster/raft/groups" \
-H "Authorization: Bearer $SPYD_TOKEN" \
-H "Content-Type: application/json" \
-d '{"action":"transfer_leadership","group_id":1,"node_id":2}'const res = await fetch("https://localhost:8080/v1/cluster/raft/groups", {
method: "POST",
headers: {
Authorization: `Bearer ${process.env.SPYD_TOKEN}`,
"Content-Type": "application/json",
},
body: JSON.stringify({
"action": "transfer_leadership",
"group_id": 1,
"node_id": 2
}),
});
const data = await res.json();import os, httpx
with httpx.Client(verify="tls/ca.crt") as client:
res = client.request(
"POST",
"https://localhost:8080/v1/cluster/raft/groups",
headers={"Authorization": f"Bearer {os.environ['SPYD_TOKEN']}"},
json={"action":"transfer_leadership","group_id":1,"node_id":2},
)
print(res.json())req, _ := http.NewRequest("POST", "https://localhost:8080/v1/cluster/raft/groups", strings.NewReader("{\"action\":\"transfer_leadership\",\"group_id\":1,\"node_id\":2}"))
req.Header.Set("Authorization", "Bearer " + os.Getenv("SPYD_TOKEN"))
req.Header.Set("Content-Type", "application/json")
resp, err := httpClient.Do(req)HttpRequest req = HttpRequest.newBuilder()
.uri(URI.create("https://localhost:8080/v1/cluster/raft/groups"))
.header("Authorization", "Bearer " + System.getenv("SPYD_TOKEN"))
.header("Content-Type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\"action\":\"transfer_leadership\",\"group_id\":1,\"node_id\":2}"))
.build();
HttpResponse<String> res = client.send(req, HttpResponse.BodyHandlers.ofString());let res = reqwest_client
.request(reqwest::Method::POST, "https://localhost:8080/v1/cluster/raft/groups")
.bearer_auth(std::env::var("SPYD_TOKEN")?)
.json(&serde_json::json!({"action":"transfer_leadership","group_id":1,"node_id":2}))
.send().await?;
println!("{}", res.text().await?);{
"action": "transfer_leadership",
"group_id": 1,
"node_id": 2
}{
"ok": true
}Opens a coordinator-managed multi-shard transaction session paired with /v1/cluster/tx/{query,stage,end}.
curl -sS --cacert tls/ca.crt -X POST "https://localhost:8080/v1/cluster/tx/begin" \
-H "Authorization: Bearer $SPYD_TOKEN" \
-H "Content-Type: application/json" \
-d '{"timeout_ms":15000}'const res = await fetch("https://localhost:8080/v1/cluster/tx/begin", {
method: "POST",
headers: {
Authorization: `Bearer ${process.env.SPYD_TOKEN}`,
"Content-Type": "application/json",
},
body: JSON.stringify({
"timeout_ms": 15000
}),
});
const data = await res.json();import os, httpx
with httpx.Client(verify="tls/ca.crt") as client:
res = client.request(
"POST",
"https://localhost:8080/v1/cluster/tx/begin",
headers={"Authorization": f"Bearer {os.environ['SPYD_TOKEN']}"},
json={"timeout_ms":15000},
)
print(res.json())req, _ := http.NewRequest("POST", "https://localhost:8080/v1/cluster/tx/begin", strings.NewReader("{\"timeout_ms\":15000}"))
req.Header.Set("Authorization", "Bearer " + os.Getenv("SPYD_TOKEN"))
req.Header.Set("Content-Type", "application/json")
resp, err := httpClient.Do(req)HttpRequest req = HttpRequest.newBuilder()
.uri(URI.create("https://localhost:8080/v1/cluster/tx/begin"))
.header("Authorization", "Bearer " + System.getenv("SPYD_TOKEN"))
.header("Content-Type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\"timeout_ms\":15000}"))
.build();
HttpResponse<String> res = client.send(req, HttpResponse.BodyHandlers.ofString());let res = reqwest_client
.request(reqwest::Method::POST, "https://localhost:8080/v1/cluster/tx/begin")
.bearer_auth(std::env::var("SPYD_TOKEN")?)
.json(&serde_json::json!({"timeout_ms":15000}))
.send().await?;
println!("{}", res.text().await?);{
"timeout_ms": 15000
}{
"tx_id": "tx-91f8a2",
"status": "open"
}Lists authoritative region leases managed via /v1/cluster/leases/{acquire,fence,transfer}.
curl -sS --cacert tls/ca.crt -X GET "https://localhost:8080/v1/cluster/leases" \
-H "Authorization: Bearer $SPYD_TOKEN"const res = await fetch("https://localhost:8080/v1/cluster/leases", {
method: "GET",
headers: {
Authorization: `Bearer ${process.env.SPYD_TOKEN}`,
},
});
const data = await res.json();import os, httpx
with httpx.Client(verify="tls/ca.crt") as client:
res = client.request(
"GET",
"https://localhost:8080/v1/cluster/leases",
headers={"Authorization": f"Bearer {os.environ['SPYD_TOKEN']}"},
)
print(res.json())req, _ := http.NewRequest("GET", "https://localhost:8080/v1/cluster/leases", nil)
req.Header.Set("Authorization", "Bearer " + os.Getenv("SPYD_TOKEN"))
resp, err := httpClient.Do(req)HttpRequest req = HttpRequest.newBuilder()
.uri(URI.create("https://localhost:8080/v1/cluster/leases"))
.header("Authorization", "Bearer " + System.getenv("SPYD_TOKEN"))
.method("GET", HttpRequest.BodyPublishers.noBody())
.build();
HttpResponse<String> res = client.send(req, HttpResponse.BodyHandlers.ofString());let res = reqwest_client
.request(reqwest::Method::GET, "https://localhost:8080/v1/cluster/leases")
.bearer_auth(std::env::var("SPYD_TOKEN")?)
.send().await?;
println!("{}", res.text().await?);{
"leases": []
}Lists held exclusive and shared distributed row locks managed via /v1/cluster/locks/{acquire,release}.
curl -sS --cacert tls/ca.crt -X GET "https://localhost:8080/v1/cluster/locks" \
-H "Authorization: Bearer $SPYD_TOKEN"const res = await fetch("https://localhost:8080/v1/cluster/locks", {
method: "GET",
headers: {
Authorization: `Bearer ${process.env.SPYD_TOKEN}`,
},
});
const data = await res.json();import os, httpx
with httpx.Client(verify="tls/ca.crt") as client:
res = client.request(
"GET",
"https://localhost:8080/v1/cluster/locks",
headers={"Authorization": f"Bearer {os.environ['SPYD_TOKEN']}"},
)
print(res.json())req, _ := http.NewRequest("GET", "https://localhost:8080/v1/cluster/locks", nil)
req.Header.Set("Authorization", "Bearer " + os.Getenv("SPYD_TOKEN"))
resp, err := httpClient.Do(req)HttpRequest req = HttpRequest.newBuilder()
.uri(URI.create("https://localhost:8080/v1/cluster/locks"))
.header("Authorization", "Bearer " + System.getenv("SPYD_TOKEN"))
.method("GET", HttpRequest.BodyPublishers.noBody())
.build();
HttpResponse<String> res = client.send(req, HttpResponse.BodyHandlers.ofString());let res = reqwest_client
.request(reqwest::Method::GET, "https://localhost:8080/v1/cluster/locks")
.bearer_auth(std::env::var("SPYD_TOKEN")?)
.send().await?;
println!("{}", res.text().await?);{
"locks": []
}Returns the current physical/logical HLC watermark used for causally consistent multi-cluster snapshots.
curl -sS --cacert tls/ca.crt -X GET "https://localhost:8080/v1/cluster/hlc" \
-H "Authorization: Bearer $SPYD_TOKEN"const res = await fetch("https://localhost:8080/v1/cluster/hlc", {
method: "GET",
headers: {
Authorization: `Bearer ${process.env.SPYD_TOKEN}`,
},
});
const data = await res.json();import os, httpx
with httpx.Client(verify="tls/ca.crt") as client:
res = client.request(
"GET",
"https://localhost:8080/v1/cluster/hlc",
headers={"Authorization": f"Bearer {os.environ['SPYD_TOKEN']}"},
)
print(res.json())req, _ := http.NewRequest("GET", "https://localhost:8080/v1/cluster/hlc", nil)
req.Header.Set("Authorization", "Bearer " + os.Getenv("SPYD_TOKEN"))
resp, err := httpClient.Do(req)HttpRequest req = HttpRequest.newBuilder()
.uri(URI.create("https://localhost:8080/v1/cluster/hlc"))
.header("Authorization", "Bearer " + System.getenv("SPYD_TOKEN"))
.method("GET", HttpRequest.BodyPublishers.noBody())
.build();
HttpResponse<String> res = client.send(req, HttpResponse.BodyHandlers.ofString());let res = reqwest_client
.request(reqwest::Method::GET, "https://localhost:8080/v1/cluster/hlc")
.bearer_auth(std::env::var("SPYD_TOKEN")?)
.send().await?;
println!("{}", res.text().await?);{
"physical_us": 1796185200000000,
"logical": 0
}Replicates schema changes and continuous row streams across clusters.
curl -sS --cacert tls/ca.crt -X POST "https://localhost:8080/v1/cluster/ccr" \
-H "Authorization: Bearer $SPYD_TOKEN" \
-H "Content-Type: application/json" \
-d '{"name":"orders-eu-sync","link_name":"eu-west","remote_collection":"orders","local_collection":"orders_eu","conflict_policy":"lww"}'const res = await fetch("https://localhost:8080/v1/cluster/ccr", {
method: "POST",
headers: {
Authorization: `Bearer ${process.env.SPYD_TOKEN}`,
"Content-Type": "application/json",
},
body: JSON.stringify({
"name": "orders-eu-sync",
"link_name": "eu-west",
"remote_collection": "orders",
"local_collection": "orders_eu",
"conflict_policy": "lww"
}),
});
const data = await res.json();import os, httpx
with httpx.Client(verify="tls/ca.crt") as client:
res = client.request(
"POST",
"https://localhost:8080/v1/cluster/ccr",
headers={"Authorization": f"Bearer {os.environ['SPYD_TOKEN']}"},
json={"name":"orders-eu-sync","link_name":"eu-west","remote_collection":"orders","local_collection":"orders_eu","conflict_policy":"lww"},
)
print(res.json())req, _ := http.NewRequest("POST", "https://localhost:8080/v1/cluster/ccr", strings.NewReader("{\"name\":\"orders-eu-sync\",\"link_name\":\"eu-west\",\"remote_collection\":\"orders\",\"local_collection\":\"orders_eu\",\"conflict_policy\":\"lww\"}"))
req.Header.Set("Authorization", "Bearer " + os.Getenv("SPYD_TOKEN"))
req.Header.Set("Content-Type", "application/json")
resp, err := httpClient.Do(req)HttpRequest req = HttpRequest.newBuilder()
.uri(URI.create("https://localhost:8080/v1/cluster/ccr"))
.header("Authorization", "Bearer " + System.getenv("SPYD_TOKEN"))
.header("Content-Type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\"name\":\"orders-eu-sync\",\"link_name\":\"eu-west\",\"remote_collection\":\"orders\",\"local_collection\":\"orders_eu\",\"conflict_policy\":\"lww\"}"))
.build();
HttpResponse<String> res = client.send(req, HttpResponse.BodyHandlers.ofString());let res = reqwest_client
.request(reqwest::Method::POST, "https://localhost:8080/v1/cluster/ccr")
.bearer_auth(std::env::var("SPYD_TOKEN")?)
.json(&serde_json::json!({"name":"orders-eu-sync","link_name":"eu-west","remote_collection":"orders","local_collection":"orders_eu","conflict_policy":"lww"}))
.send().await?;
println!("{}", res.text().await?);{
"name": "orders-eu-sync",
"link_name": "eu-west",
"remote_collection": "orders",
"local_collection": "orders_eu",
"conflict_policy": "lww"
}{
"created": "orders-eu-sync"
}Configures seed URLs (max 16), TLS/CA/leaf certificate pinning, auth_mode (caller_token or link_token), security sync opt-in, or inbound_user for reverse-dial NAT clusters.
curl -sS --cacert tls/ca.crt -X POST "https://localhost:8080/v1/cluster/links" \
-H "Authorization: Bearer $SPYD_TOKEN" \
-H "Content-Type: application/json" \
-d '{"name":"eu-west","seed_urls":["https://eu-1.spyd.internal:8080"],"environment":"production","auth_mode":"caller_token","telemetry_token":"<monitor-token>","sync_security":true}'const res = await fetch("https://localhost:8080/v1/cluster/links", {
method: "POST",
headers: {
Authorization: `Bearer ${process.env.SPYD_TOKEN}`,
"Content-Type": "application/json",
},
body: JSON.stringify({
"name": "eu-west",
"seed_urls": [
"https://eu-1.spyd.internal:8080"
],
"environment": "production",
"auth_mode": "caller_token",
"telemetry_token": "<monitor-token>",
"sync_security": true
}),
});
const data = await res.json();import os, httpx
with httpx.Client(verify="tls/ca.crt") as client:
res = client.request(
"POST",
"https://localhost:8080/v1/cluster/links",
headers={"Authorization": f"Bearer {os.environ['SPYD_TOKEN']}"},
json={"name":"eu-west","seed_urls":["https://eu-1.spyd.internal:8080"],"environment":"production","auth_mode":"caller_token","telemetry_token":"<monitor-token>","sync_security":true},
)
print(res.json())req, _ := http.NewRequest("POST", "https://localhost:8080/v1/cluster/links", strings.NewReader("{\"name\":\"eu-west\",\"seed_urls\":[\"https://eu-1.spyd.internal:8080\"],\"environment\":\"production\",\"auth_mode\":\"caller_token\",\"telemetry_token\":\"<monitor-token>\",\"sync_security\":true}"))
req.Header.Set("Authorization", "Bearer " + os.Getenv("SPYD_TOKEN"))
req.Header.Set("Content-Type", "application/json")
resp, err := httpClient.Do(req)HttpRequest req = HttpRequest.newBuilder()
.uri(URI.create("https://localhost:8080/v1/cluster/links"))
.header("Authorization", "Bearer " + System.getenv("SPYD_TOKEN"))
.header("Content-Type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\"name\":\"eu-west\",\"seed_urls\":[\"https://eu-1.spyd.internal:8080\"],\"environment\":\"production\",\"auth_mode\":\"caller_token\",\"telemetry_token\":\"<monitor-token>\",\"sync_security\":true}"))
.build();
HttpResponse<String> res = client.send(req, HttpResponse.BodyHandlers.ofString());let res = reqwest_client
.request(reqwest::Method::POST, "https://localhost:8080/v1/cluster/links")
.bearer_auth(std::env::var("SPYD_TOKEN")?)
.json(&serde_json::json!({"name":"eu-west","seed_urls":["https://eu-1.spyd.internal:8080"],"environment":"production","auth_mode":"caller_token","telemetry_token":"<monitor-token>","sync_security":true}))
.send().await?;
println!("{}", res.text().await?);{
"name": "eu-west",
"seed_urls": [
"https://eu-1.spyd.internal:8080"
],
"environment": "production",
"auth_mode": "caller_token",
"telemetry_token": "<monitor-token>",
"sync_security": true
}{
"generation": 6,
"links": [
{
"name": "eu-west",
"environment": "production",
"auth_mode": "caller_token",
"sync_security": true
}
]
}Deletes the named cluster link from shard catalog and reconciles active fleet watchers.
curl -sS --cacert tls/ca.crt -X DELETE "https://localhost:8080/v1/cluster/links/<name>" \
-H "Authorization: Bearer $SPYD_TOKEN"const res = await fetch("https://localhost:8080/v1/cluster/links/<name>", {
method: "DELETE",
headers: {
Authorization: `Bearer ${process.env.SPYD_TOKEN}`,
},
});
const data = await res.json();import os, httpx
with httpx.Client(verify="tls/ca.crt") as client:
res = client.request(
"DELETE",
"https://localhost:8080/v1/cluster/links/<name>",
headers={"Authorization": f"Bearer {os.environ['SPYD_TOKEN']}"},
)
print(res.json())req, _ := http.NewRequest("DELETE", "https://localhost:8080/v1/cluster/links/<name>", nil)
req.Header.Set("Authorization", "Bearer " + os.Getenv("SPYD_TOKEN"))
resp, err := httpClient.Do(req)HttpRequest req = HttpRequest.newBuilder()
.uri(URI.create("https://localhost:8080/v1/cluster/links/<name>"))
.header("Authorization", "Bearer " + System.getenv("SPYD_TOKEN"))
.method("DELETE", HttpRequest.BodyPublishers.noBody())
.build();
HttpResponse<String> res = client.send(req, HttpResponse.BodyHandlers.ofString());let res = reqwest_client
.request(reqwest::Method::DELETE, "https://localhost:8080/v1/cluster/links/<name>")
.bearer_auth(std::env::var("SPYD_TOKEN")?)
.send().await?;
println!("{}", res.text().await?);| Name | In | Required | Schema |
|---|---|---|---|
| name | path | Yes | {"type":"string"} |
{
"deleted": true,
"link": "eu-west"
}Accessible to cluster administrators and the monitor role; rebuilt at most every 2s from in-memory counters.
curl -sS --cacert tls/ca.crt -X GET "https://localhost:8080/v1/cluster/telemetry" \
-H "Authorization: Bearer $SPYD_TOKEN"const res = await fetch("https://localhost:8080/v1/cluster/telemetry", {
method: "GET",
headers: {
Authorization: `Bearer ${process.env.SPYD_TOKEN}`,
},
});
const data = await res.json();import os, httpx
with httpx.Client(verify="tls/ca.crt") as client:
res = client.request(
"GET",
"https://localhost:8080/v1/cluster/telemetry",
headers={"Authorization": f"Bearer {os.environ['SPYD_TOKEN']}"},
)
print(res.json())req, _ := http.NewRequest("GET", "https://localhost:8080/v1/cluster/telemetry", nil)
req.Header.Set("Authorization", "Bearer " + os.Getenv("SPYD_TOKEN"))
resp, err := httpClient.Do(req)HttpRequest req = HttpRequest.newBuilder()
.uri(URI.create("https://localhost:8080/v1/cluster/telemetry"))
.header("Authorization", "Bearer " + System.getenv("SPYD_TOKEN"))
.method("GET", HttpRequest.BodyPublishers.noBody())
.build();
HttpResponse<String> res = client.send(req, HttpResponse.BodyHandlers.ofString());let res = reqwest_client
.request(reqwest::Method::GET, "https://localhost:8080/v1/cluster/telemetry")
.bearer_auth(std::env::var("SPYD_TOKEN")?)
.send().await?;
println!("{}", res.text().await?);{
"version": "1.0.0",
"ready": true,
"active_queries": 2,
"p99_query_ms": 8,
"topology": {
"node_id": "node-1",
"nodes": 3,
"healthy_nodes": 3,
"security": {
"version": 12,
"sync_enabled": true
}
}
}Server-sent event stream consumed by fleet hubs; requires cluster admin or monitor role.
curl -sS --cacert tls/ca.crt -X GET "https://localhost:8080/v1/cluster/telemetry/stream" \
-H "Authorization: Bearer $SPYD_TOKEN"const res = await fetch("https://localhost:8080/v1/cluster/telemetry/stream", {
method: "GET",
headers: {
Authorization: `Bearer ${process.env.SPYD_TOKEN}`,
},
});
const data = await res.json();import os, httpx
with httpx.Client(verify="tls/ca.crt") as client:
res = client.request(
"GET",
"https://localhost:8080/v1/cluster/telemetry/stream",
headers={"Authorization": f"Bearer {os.environ['SPYD_TOKEN']}"},
)
print(res.json())req, _ := http.NewRequest("GET", "https://localhost:8080/v1/cluster/telemetry/stream", nil)
req.Header.Set("Authorization", "Bearer " + os.Getenv("SPYD_TOKEN"))
resp, err := httpClient.Do(req)HttpRequest req = HttpRequest.newBuilder()
.uri(URI.create("https://localhost:8080/v1/cluster/telemetry/stream"))
.header("Authorization", "Bearer " + System.getenv("SPYD_TOKEN"))
.method("GET", HttpRequest.BodyPublishers.noBody())
.build();
HttpResponse<String> res = client.send(req, HttpResponse.BodyHandlers.ofString());let res = reqwest_client
.request(reqwest::Method::GET, "https://localhost:8080/v1/cluster/telemetry/stream")
.bearer_auth(std::env::var("SPYD_TOKEN")?)
.send().await?;
println!("{}", res.text().await?);Returns cached fleet cluster summaries with local sorted first; requires cluster admin or monitor role.
curl -sS --cacert tls/ca.crt -X GET "https://localhost:8080/v1/cluster/fleet" \
-H "Authorization: Bearer $SPYD_TOKEN"const res = await fetch("https://localhost:8080/v1/cluster/fleet", {
method: "GET",
headers: {
Authorization: `Bearer ${process.env.SPYD_TOKEN}`,
},
});
const data = await res.json();import os, httpx
with httpx.Client(verify="tls/ca.crt") as client:
res = client.request(
"GET",
"https://localhost:8080/v1/cluster/fleet",
headers={"Authorization": f"Bearer {os.environ['SPYD_TOKEN']}"},
)
print(res.json())req, _ := http.NewRequest("GET", "https://localhost:8080/v1/cluster/fleet", nil)
req.Header.Set("Authorization", "Bearer " + os.Getenv("SPYD_TOKEN"))
resp, err := httpClient.Do(req)HttpRequest req = HttpRequest.newBuilder()
.uri(URI.create("https://localhost:8080/v1/cluster/fleet"))
.header("Authorization", "Bearer " + System.getenv("SPYD_TOKEN"))
.method("GET", HttpRequest.BodyPublishers.noBody())
.build();
HttpResponse<String> res = client.send(req, HttpResponse.BodyHandlers.ofString());let res = reqwest_client
.request(reqwest::Method::GET, "https://localhost:8080/v1/cluster/fleet")
.bearer_auth(std::env::var("SPYD_TOKEN")?)
.send().await?;
println!("{}", res.text().await?);| Name | In | Required | Schema |
|---|---|---|---|
| offset | query | No | {"type":"integer","minimum":0} |
| limit | query | No | {"type":"integer","minimum":1,"maximum":5000} |
{
"revision": 42,
"total": 2,
"clusters": [
{
"name": "local",
"is_local": true,
"environment": "local",
"status": "connected",
"rtt_ms": 0,
"dial_in": false
}
]
}Backed by StreamHub (snapshot first, then incremental clusters events + removed[] every 500ms with 15s keep-alives); requires cluster admin or monitor role.
curl -sS --cacert tls/ca.crt -X GET "https://localhost:8080/v1/cluster/fleet/stream" \
-H "Authorization: Bearer $SPYD_TOKEN"const res = await fetch("https://localhost:8080/v1/cluster/fleet/stream", {
method: "GET",
headers: {
Authorization: `Bearer ${process.env.SPYD_TOKEN}`,
},
});
const data = await res.json();import os, httpx
with httpx.Client(verify="tls/ca.crt") as client:
res = client.request(
"GET",
"https://localhost:8080/v1/cluster/fleet/stream",
headers={"Authorization": f"Bearer {os.environ['SPYD_TOKEN']}"},
)
print(res.json())req, _ := http.NewRequest("GET", "https://localhost:8080/v1/cluster/fleet/stream", nil)
req.Header.Set("Authorization", "Bearer " + os.Getenv("SPYD_TOKEN"))
resp, err := httpClient.Do(req)HttpRequest req = HttpRequest.newBuilder()
.uri(URI.create("https://localhost:8080/v1/cluster/fleet/stream"))
.header("Authorization", "Bearer " + System.getenv("SPYD_TOKEN"))
.method("GET", HttpRequest.BodyPublishers.noBody())
.build();
HttpResponse<String> res = client.send(req, HttpResponse.BodyHandlers.ofString());let res = reqwest_client
.request(reqwest::Method::GET, "https://localhost:8080/v1/cluster/fleet/stream")
.bearer_auth(std::env::var("SPYD_TOKEN")?)
.send().await?;
println!("{}", res.text().await?);Upgrades authenticated HTTP/1.1 connection onto the shared spyd-fleet async runtime when session user matches link inbound_user.
curl -sS --cacert tls/ca.crt -X GET "https://localhost:8080/v1/cluster/fleet/publish" \
-H "Authorization: Bearer $SPYD_TOKEN"const res = await fetch("https://localhost:8080/v1/cluster/fleet/publish", {
method: "GET",
headers: {
Authorization: `Bearer ${process.env.SPYD_TOKEN}`,
},
});
const data = await res.json();import os, httpx
with httpx.Client(verify="tls/ca.crt") as client:
res = client.request(
"GET",
"https://localhost:8080/v1/cluster/fleet/publish",
headers={"Authorization": f"Bearer {os.environ['SPYD_TOKEN']}"},
)
print(res.json())req, _ := http.NewRequest("GET", "https://localhost:8080/v1/cluster/fleet/publish", nil)
req.Header.Set("Authorization", "Bearer " + os.Getenv("SPYD_TOKEN"))
resp, err := httpClient.Do(req)HttpRequest req = HttpRequest.newBuilder()
.uri(URI.create("https://localhost:8080/v1/cluster/fleet/publish"))
.header("Authorization", "Bearer " + System.getenv("SPYD_TOKEN"))
.method("GET", HttpRequest.BodyPublishers.noBody())
.build();
HttpResponse<String> res = client.send(req, HttpResponse.BodyHandlers.ofString());let res = reqwest_client
.request(reqwest::Method::GET, "https://localhost:8080/v1/cluster/fleet/publish")
.bearer_auth(std::env::var("SPYD_TOKEN")?)
.send().await?;
println!("{}", res.text().await?);| Name | In | Required | Schema |
|---|---|---|---|
| X-Spyd-Cluster-Name | header | Yes | {"type":"string"} |
Returns SecuritySnapshot metadata for X-Spyd-Database; requires cluster administration.
curl -sS --cacert tls/ca.crt -X GET "https://localhost:8080/v1/cluster/security/state" \
-H "Authorization: Bearer $SPYD_TOKEN"const res = await fetch("https://localhost:8080/v1/cluster/security/state", {
method: "GET",
headers: {
Authorization: `Bearer ${process.env.SPYD_TOKEN}`,
},
});
const data = await res.json();import os, httpx
with httpx.Client(verify="tls/ca.crt") as client:
res = client.request(
"GET",
"https://localhost:8080/v1/cluster/security/state",
headers={"Authorization": f"Bearer {os.environ['SPYD_TOKEN']}"},
)
print(res.json())req, _ := http.NewRequest("GET", "https://localhost:8080/v1/cluster/security/state", nil)
req.Header.Set("Authorization", "Bearer " + os.Getenv("SPYD_TOKEN"))
resp, err := httpClient.Do(req)HttpRequest req = HttpRequest.newBuilder()
.uri(URI.create("https://localhost:8080/v1/cluster/security/state"))
.header("Authorization", "Bearer " + System.getenv("SPYD_TOKEN"))
.method("GET", HttpRequest.BodyPublishers.noBody())
.build();
HttpResponse<String> res = client.send(req, HttpResponse.BodyHandlers.ofString());let res = reqwest_client
.request(reqwest::Method::GET, "https://localhost:8080/v1/cluster/security/state")
.bearer_auth(std::env::var("SPYD_TOKEN")?)
.send().await?;
println!("{}", res.text().await?);{
"version": 19,
"updated_us": 1795843200000000,
"fingerprint": "9f8c...3a1b",
"local_node_id": "node-1",
"sync_enabled": true
}Installs snapshot if this node opted in and remote (version, updated_us, fingerprint) is newer; refuses with 409 security_sync_disabled otherwise.
curl -sS --cacert tls/ca.crt -X POST "https://localhost:8080/v1/cluster/security/apply" \
-H "Authorization: Bearer $SPYD_TOKEN" \
-H "Content-Type: application/json" \
-d '{"snapshot":{"version":19,"updated_us":1795843200000000,"roles":{},"policies":{},"rule_policies":{}}}'const res = await fetch("https://localhost:8080/v1/cluster/security/apply", {
method: "POST",
headers: {
Authorization: `Bearer ${process.env.SPYD_TOKEN}`,
"Content-Type": "application/json",
},
body: JSON.stringify({
"snapshot": {
"version": 19,
"updated_us": 1795843200000000,
"roles": {},
"policies": {},
"rule_policies": {}
}
}),
});
const data = await res.json();import os, httpx
with httpx.Client(verify="tls/ca.crt") as client:
res = client.request(
"POST",
"https://localhost:8080/v1/cluster/security/apply",
headers={"Authorization": f"Bearer {os.environ['SPYD_TOKEN']}"},
json={"snapshot":{"version":19,"updated_us":1795843200000000,"roles":{},"policies":{},"rule_policies":{}}},
)
print(res.json())req, _ := http.NewRequest("POST", "https://localhost:8080/v1/cluster/security/apply", strings.NewReader("{\"snapshot\":{\"version\":19,\"updated_us\":1795843200000000,\"roles\":{},\"policies\":{},\"rule_policies\":{}}}"))
req.Header.Set("Authorization", "Bearer " + os.Getenv("SPYD_TOKEN"))
req.Header.Set("Content-Type", "application/json")
resp, err := httpClient.Do(req)HttpRequest req = HttpRequest.newBuilder()
.uri(URI.create("https://localhost:8080/v1/cluster/security/apply"))
.header("Authorization", "Bearer " + System.getenv("SPYD_TOKEN"))
.header("Content-Type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\"snapshot\":{\"version\":19,\"updated_us\":1795843200000000,\"roles\":{},\"policies\":{},\"rule_policies\":{}}}"))
.build();
HttpResponse<String> res = client.send(req, HttpResponse.BodyHandlers.ofString());let res = reqwest_client
.request(reqwest::Method::POST, "https://localhost:8080/v1/cluster/security/apply")
.bearer_auth(std::env::var("SPYD_TOKEN")?)
.json(&serde_json::json!({"snapshot":{"version":19,"updated_us":1795843200000000,"roles":{},"policies":{},"rule_policies":{}}}))
.send().await?;
println!("{}", res.text().await?);{
"snapshot": {
"version": 19,
"updated_us": 1795843200000000,
"roles": {},
"policies": {},
"rule_policies": {}
}
}{
"installed": true,
"version": 19,
"fingerprint": "9f8c...3a1b"
}Lists local security state, node and link opt-in toggles, and latest peer push results for X-Spyd-Database.
curl -sS --cacert tls/ca.crt -X GET "https://localhost:8080/v1/cluster/security/sync" \
-H "Authorization: Bearer $SPYD_TOKEN"const res = await fetch("https://localhost:8080/v1/cluster/security/sync", {
method: "GET",
headers: {
Authorization: `Bearer ${process.env.SPYD_TOKEN}`,
},
});
const data = await res.json();import os, httpx
with httpx.Client(verify="tls/ca.crt") as client:
res = client.request(
"GET",
"https://localhost:8080/v1/cluster/security/sync",
headers={"Authorization": f"Bearer {os.environ['SPYD_TOKEN']}"},
)
print(res.json())req, _ := http.NewRequest("GET", "https://localhost:8080/v1/cluster/security/sync", nil)
req.Header.Set("Authorization", "Bearer " + os.Getenv("SPYD_TOKEN"))
resp, err := httpClient.Do(req)HttpRequest req = HttpRequest.newBuilder()
.uri(URI.create("https://localhost:8080/v1/cluster/security/sync"))
.header("Authorization", "Bearer " + System.getenv("SPYD_TOKEN"))
.method("GET", HttpRequest.BodyPublishers.noBody())
.build();
HttpResponse<String> res = client.send(req, HttpResponse.BodyHandlers.ofString());let res = reqwest_client
.request(reqwest::Method::GET, "https://localhost:8080/v1/cluster/security/sync")
.bearer_auth(std::env::var("SPYD_TOKEN")?)
.send().await?;
println!("{}", res.text().await?);{
"state": {
"version": 19,
"fingerprint": "9f8c...3a1b",
"sync_enabled": true,
"local_node_id": "node-1"
},
"nodes": [],
"links": [],
"peers": []
}Toggles security sync for node_id or link on X-Spyd-Database and immediately reconciles when enabled (refuses dial-in links).
curl -sS --cacert tls/ca.crt -X PUT "https://localhost:8080/v1/cluster/security/sync" \
-H "Authorization: Bearer $SPYD_TOKEN" \
-H "Content-Type: application/json" \
-d '{"link":"eu-west","enabled":true}'const res = await fetch("https://localhost:8080/v1/cluster/security/sync", {
method: "PUT",
headers: {
Authorization: `Bearer ${process.env.SPYD_TOKEN}`,
"Content-Type": "application/json",
},
body: JSON.stringify({
"link": "eu-west",
"enabled": true
}),
});
const data = await res.json();import os, httpx
with httpx.Client(verify="tls/ca.crt") as client:
res = client.request(
"PUT",
"https://localhost:8080/v1/cluster/security/sync",
headers={"Authorization": f"Bearer {os.environ['SPYD_TOKEN']}"},
json={"link":"eu-west","enabled":true},
)
print(res.json())req, _ := http.NewRequest("PUT", "https://localhost:8080/v1/cluster/security/sync", strings.NewReader("{\"link\":\"eu-west\",\"enabled\":true}"))
req.Header.Set("Authorization", "Bearer " + os.Getenv("SPYD_TOKEN"))
req.Header.Set("Content-Type", "application/json")
resp, err := httpClient.Do(req)HttpRequest req = HttpRequest.newBuilder()
.uri(URI.create("https://localhost:8080/v1/cluster/security/sync"))
.header("Authorization", "Bearer " + System.getenv("SPYD_TOKEN"))
.header("Content-Type", "application/json")
.method("PUT", HttpRequest.BodyPublishers.ofString("{\"link\":\"eu-west\",\"enabled\":true}"))
.build();
HttpResponse<String> res = client.send(req, HttpResponse.BodyHandlers.ofString());let res = reqwest_client
.request(reqwest::Method::PUT, "https://localhost:8080/v1/cluster/security/sync")
.bearer_auth(std::env::var("SPYD_TOKEN")?)
.json(&serde_json::json!({"link":"eu-west","enabled":true}))
.send().await?;
println!("{}", res.text().await?);{
"link": "eu-west",
"enabled": true
}{
"state": {
"version": 19,
"fingerprint": "9f8c...3a1b",
"sync_enabled": true,
"local_node_id": "node-1"
},
"nodes": [],
"links": [],
"peers": []
}Reports replica lag, lease TTL, and split-brain fencing epoch.
curl -sS --cacert tls/ca.crt -X GET "https://localhost:8080/v1/replication/status" \
-H "Authorization: Bearer $SPYD_TOKEN"const res = await fetch("https://localhost:8080/v1/replication/status", {
method: "GET",
headers: {
Authorization: `Bearer ${process.env.SPYD_TOKEN}`,
},
});
const data = await res.json();import os, httpx
with httpx.Client(verify="tls/ca.crt") as client:
res = client.request(
"GET",
"https://localhost:8080/v1/replication/status",
headers={"Authorization": f"Bearer {os.environ['SPYD_TOKEN']}"},
)
print(res.json())req, _ := http.NewRequest("GET", "https://localhost:8080/v1/replication/status", nil)
req.Header.Set("Authorization", "Bearer " + os.Getenv("SPYD_TOKEN"))
resp, err := httpClient.Do(req)HttpRequest req = HttpRequest.newBuilder()
.uri(URI.create("https://localhost:8080/v1/replication/status"))
.header("Authorization", "Bearer " + System.getenv("SPYD_TOKEN"))
.method("GET", HttpRequest.BodyPublishers.noBody())
.build();
HttpResponse<String> res = client.send(req, HttpResponse.BodyHandlers.ofString());let res = reqwest_client
.request(reqwest::Method::GET, "https://localhost:8080/v1/replication/status")
.bearer_auth(std::env::var("SPYD_TOKEN")?)
.send().await?;
println!("{}", res.text().await?);{
"role": "primary",
"head_lsn": 18420,
"fencing_epoch": 1
}Configures standby follower synchronization over HTTP/TLS.
curl -sS --cacert tls/ca.crt -X POST "https://localhost:8080/v1/replication/follow" \
-H "Authorization: Bearer $SPYD_TOKEN" \
-H "Content-Type: application/json" \
-d '{"primary_url":"https://primary.internal:8080","interval_ms":50}'const res = await fetch("https://localhost:8080/v1/replication/follow", {
method: "POST",
headers: {
Authorization: `Bearer ${process.env.SPYD_TOKEN}`,
"Content-Type": "application/json",
},
body: JSON.stringify({
"primary_url": "https://primary.internal:8080",
"interval_ms": 50
}),
});
const data = await res.json();import os, httpx
with httpx.Client(verify="tls/ca.crt") as client:
res = client.request(
"POST",
"https://localhost:8080/v1/replication/follow",
headers={"Authorization": f"Bearer {os.environ['SPYD_TOKEN']}"},
json={"primary_url":"https://primary.internal:8080","interval_ms":50},
)
print(res.json())req, _ := http.NewRequest("POST", "https://localhost:8080/v1/replication/follow", strings.NewReader("{\"primary_url\":\"https://primary.internal:8080\",\"interval_ms\":50}"))
req.Header.Set("Authorization", "Bearer " + os.Getenv("SPYD_TOKEN"))
req.Header.Set("Content-Type", "application/json")
resp, err := httpClient.Do(req)HttpRequest req = HttpRequest.newBuilder()
.uri(URI.create("https://localhost:8080/v1/replication/follow"))
.header("Authorization", "Bearer " + System.getenv("SPYD_TOKEN"))
.header("Content-Type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\"primary_url\":\"https://primary.internal:8080\",\"interval_ms\":50}"))
.build();
HttpResponse<String> res = client.send(req, HttpResponse.BodyHandlers.ofString());let res = reqwest_client
.request(reqwest::Method::POST, "https://localhost:8080/v1/replication/follow")
.bearer_auth(std::env::var("SPYD_TOKEN")?)
.json(&serde_json::json!({"primary_url":"https://primary.internal:8080","interval_ms":50}))
.send().await?;
println!("{}", res.text().await?);{
"primary_url": "https://primary.internal:8080",
"interval_ms": 50
}{
"following": true
}Bumps epoch on old primary first to eliminate split-brain writers.
curl -sS --cacert tls/ca.crt -X POST "https://localhost:8080/v1/replication/promote" \
-H "Authorization: Bearer $SPYD_TOKEN" \
-H "Content-Type: application/json" \
-d '{"primary_url":"https://primary.internal:8080","node_id":"standby-1","lease_ttl_ms":10000}'const res = await fetch("https://localhost:8080/v1/replication/promote", {
method: "POST",
headers: {
Authorization: `Bearer ${process.env.SPYD_TOKEN}`,
"Content-Type": "application/json",
},
body: JSON.stringify({
"primary_url": "https://primary.internal:8080",
"node_id": "standby-1",
"lease_ttl_ms": 10000
}),
});
const data = await res.json();import os, httpx
with httpx.Client(verify="tls/ca.crt") as client:
res = client.request(
"POST",
"https://localhost:8080/v1/replication/promote",
headers={"Authorization": f"Bearer {os.environ['SPYD_TOKEN']}"},
json={"primary_url":"https://primary.internal:8080","node_id":"standby-1","lease_ttl_ms":10000},
)
print(res.json())req, _ := http.NewRequest("POST", "https://localhost:8080/v1/replication/promote", strings.NewReader("{\"primary_url\":\"https://primary.internal:8080\",\"node_id\":\"standby-1\",\"lease_ttl_ms\":10000}"))
req.Header.Set("Authorization", "Bearer " + os.Getenv("SPYD_TOKEN"))
req.Header.Set("Content-Type", "application/json")
resp, err := httpClient.Do(req)HttpRequest req = HttpRequest.newBuilder()
.uri(URI.create("https://localhost:8080/v1/replication/promote"))
.header("Authorization", "Bearer " + System.getenv("SPYD_TOKEN"))
.header("Content-Type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\"primary_url\":\"https://primary.internal:8080\",\"node_id\":\"standby-1\",\"lease_ttl_ms\":10000}"))
.build();
HttpResponse<String> res = client.send(req, HttpResponse.BodyHandlers.ofString());let res = reqwest_client
.request(reqwest::Method::POST, "https://localhost:8080/v1/replication/promote")
.bearer_auth(std::env::var("SPYD_TOKEN")?)
.json(&serde_json::json!({"primary_url":"https://primary.internal:8080","node_id":"standby-1","lease_ttl_ms":10000}))
.send().await?;
println!("{}", res.text().await?);{
"primary_url": "https://primary.internal:8080",
"node_id": "standby-1",
"lease_ttl_ms": 10000
}{
"promoted": true
}Shows configured database names and the default database.
curl -sS --cacert tls/ca.crt -X GET "https://localhost:8080/v1/admin/databases" \
-H "Authorization: Bearer $SPYD_TOKEN"const res = await fetch("https://localhost:8080/v1/admin/databases", {
method: "GET",
headers: {
Authorization: `Bearer ${process.env.SPYD_TOKEN}`,
},
});
const data = await res.json();import os, httpx
with httpx.Client(verify="tls/ca.crt") as client:
res = client.request(
"GET",
"https://localhost:8080/v1/admin/databases",
headers={"Authorization": f"Bearer {os.environ['SPYD_TOKEN']}"},
)
print(res.json())req, _ := http.NewRequest("GET", "https://localhost:8080/v1/admin/databases", nil)
req.Header.Set("Authorization", "Bearer " + os.Getenv("SPYD_TOKEN"))
resp, err := httpClient.Do(req)HttpRequest req = HttpRequest.newBuilder()
.uri(URI.create("https://localhost:8080/v1/admin/databases"))
.header("Authorization", "Bearer " + System.getenv("SPYD_TOKEN"))
.method("GET", HttpRequest.BodyPublishers.noBody())
.build();
HttpResponse<String> res = client.send(req, HttpResponse.BodyHandlers.ofString());let res = reqwest_client
.request(reqwest::Method::GET, "https://localhost:8080/v1/admin/databases")
.bearer_auth(std::env::var("SPYD_TOKEN")?)
.send().await?;
println!("{}", res.text().await?);{
"default": "default",
"databases": [
"default",
"analytics"
]
}Creates a database and inherits the active database’s RBAC role layout.
curl -sS --cacert tls/ca.crt -X POST "https://localhost:8080/v1/admin/databases" \
-H "Authorization: Bearer $SPYD_TOKEN" \
-H "Content-Type: application/json" \
-d '{"name":"analytics"}'const res = await fetch("https://localhost:8080/v1/admin/databases", {
method: "POST",
headers: {
Authorization: `Bearer ${process.env.SPYD_TOKEN}`,
"Content-Type": "application/json",
},
body: JSON.stringify({
"name": "analytics"
}),
});
const data = await res.json();import os, httpx
with httpx.Client(verify="tls/ca.crt") as client:
res = client.request(
"POST",
"https://localhost:8080/v1/admin/databases",
headers={"Authorization": f"Bearer {os.environ['SPYD_TOKEN']}"},
json={"name":"analytics"},
)
print(res.json())req, _ := http.NewRequest("POST", "https://localhost:8080/v1/admin/databases", strings.NewReader("{\"name\":\"analytics\"}"))
req.Header.Set("Authorization", "Bearer " + os.Getenv("SPYD_TOKEN"))
req.Header.Set("Content-Type", "application/json")
resp, err := httpClient.Do(req)HttpRequest req = HttpRequest.newBuilder()
.uri(URI.create("https://localhost:8080/v1/admin/databases"))
.header("Authorization", "Bearer " + System.getenv("SPYD_TOKEN"))
.header("Content-Type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\"name\":\"analytics\"}"))
.build();
HttpResponse<String> res = client.send(req, HttpResponse.BodyHandlers.ofString());let res = reqwest_client
.request(reqwest::Method::POST, "https://localhost:8080/v1/admin/databases")
.bearer_auth(std::env::var("SPYD_TOKEN")?)
.json(&serde_json::json!({"name":"analytics"}))
.send().await?;
println!("{}", res.text().await?);{
"name": "analytics"
}{
"created": "analytics"
}Snapshots storage into backup_root/<name> without stopping live traffic.
curl -sS --cacert tls/ca.crt -X POST "https://localhost:8080/v1/admin/backups" \
-H "Authorization: Bearer $SPYD_TOKEN" \
-H "Content-Type: application/json" \
-d '{"name":"daily-2026-11-27"}'const res = await fetch("https://localhost:8080/v1/admin/backups", {
method: "POST",
headers: {
Authorization: `Bearer ${process.env.SPYD_TOKEN}`,
"Content-Type": "application/json",
},
body: JSON.stringify({
"name": "daily-2026-11-27"
}),
});
const data = await res.json();import os, httpx
with httpx.Client(verify="tls/ca.crt") as client:
res = client.request(
"POST",
"https://localhost:8080/v1/admin/backups",
headers={"Authorization": f"Bearer {os.environ['SPYD_TOKEN']}"},
json={"name":"daily-2026-11-27"},
)
print(res.json())req, _ := http.NewRequest("POST", "https://localhost:8080/v1/admin/backups", strings.NewReader("{\"name\":\"daily-2026-11-27\"}"))
req.Header.Set("Authorization", "Bearer " + os.Getenv("SPYD_TOKEN"))
req.Header.Set("Content-Type", "application/json")
resp, err := httpClient.Do(req)HttpRequest req = HttpRequest.newBuilder()
.uri(URI.create("https://localhost:8080/v1/admin/backups"))
.header("Authorization", "Bearer " + System.getenv("SPYD_TOKEN"))
.header("Content-Type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\"name\":\"daily-2026-11-27\"}"))
.build();
HttpResponse<String> res = client.send(req, HttpResponse.BodyHandlers.ofString());let res = reqwest_client
.request(reqwest::Method::POST, "https://localhost:8080/v1/admin/backups")
.bearer_auth(std::env::var("SPYD_TOKEN")?)
.json(&serde_json::json!({"name":"daily-2026-11-27"}))
.send().await?;
println!("{}", res.text().await?);{
"name": "daily-2026-11-27"
}{
"name": "daily-2026-11-27",
"lsn": 18420
}Validates checksums and decodes every row & segment read-only.
curl -sS --cacert tls/ca.crt -X POST "https://localhost:8080/v1/admin/backups/verify" \
-H "Authorization: Bearer $SPYD_TOKEN" \
-H "Content-Type: application/json" \
-d '{"name":"daily-2026-11-27"}'const res = await fetch("https://localhost:8080/v1/admin/backups/verify", {
method: "POST",
headers: {
Authorization: `Bearer ${process.env.SPYD_TOKEN}`,
"Content-Type": "application/json",
},
body: JSON.stringify({
"name": "daily-2026-11-27"
}),
});
const data = await res.json();import os, httpx
with httpx.Client(verify="tls/ca.crt") as client:
res = client.request(
"POST",
"https://localhost:8080/v1/admin/backups/verify",
headers={"Authorization": f"Bearer {os.environ['SPYD_TOKEN']}"},
json={"name":"daily-2026-11-27"},
)
print(res.json())req, _ := http.NewRequest("POST", "https://localhost:8080/v1/admin/backups/verify", strings.NewReader("{\"name\":\"daily-2026-11-27\"}"))
req.Header.Set("Authorization", "Bearer " + os.Getenv("SPYD_TOKEN"))
req.Header.Set("Content-Type", "application/json")
resp, err := httpClient.Do(req)HttpRequest req = HttpRequest.newBuilder()
.uri(URI.create("https://localhost:8080/v1/admin/backups/verify"))
.header("Authorization", "Bearer " + System.getenv("SPYD_TOKEN"))
.header("Content-Type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\"name\":\"daily-2026-11-27\"}"))
.build();
HttpResponse<String> res = client.send(req, HttpResponse.BodyHandlers.ofString());let res = reqwest_client
.request(reqwest::Method::POST, "https://localhost:8080/v1/admin/backups/verify")
.bearer_auth(std::env::var("SPYD_TOKEN")?)
.json(&serde_json::json!({"name":"daily-2026-11-27"}))
.send().await?;
println!("{}", res.text().await?);{
"name": "daily-2026-11-27"
}{
"verified": true,
"sequence": 920
}Copies WAL segments into backup_root/<name> for PITR replay.
curl -sS --cacert tls/ca.crt -X POST "https://localhost:8080/v1/admin/wal/archive" \
-H "Authorization: Bearer $SPYD_TOKEN" \
-H "Content-Type: application/json" \
-d '{"name":"wal-2026-11-27-21h"}'const res = await fetch("https://localhost:8080/v1/admin/wal/archive", {
method: "POST",
headers: {
Authorization: `Bearer ${process.env.SPYD_TOKEN}`,
"Content-Type": "application/json",
},
body: JSON.stringify({
"name": "wal-2026-11-27-21h"
}),
});
const data = await res.json();import os, httpx
with httpx.Client(verify="tls/ca.crt") as client:
res = client.request(
"POST",
"https://localhost:8080/v1/admin/wal/archive",
headers={"Authorization": f"Bearer {os.environ['SPYD_TOKEN']}"},
json={"name":"wal-2026-11-27-21h"},
)
print(res.json())req, _ := http.NewRequest("POST", "https://localhost:8080/v1/admin/wal/archive", strings.NewReader("{\"name\":\"wal-2026-11-27-21h\"}"))
req.Header.Set("Authorization", "Bearer " + os.Getenv("SPYD_TOKEN"))
req.Header.Set("Content-Type", "application/json")
resp, err := httpClient.Do(req)HttpRequest req = HttpRequest.newBuilder()
.uri(URI.create("https://localhost:8080/v1/admin/wal/archive"))
.header("Authorization", "Bearer " + System.getenv("SPYD_TOKEN"))
.header("Content-Type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\"name\":\"wal-2026-11-27-21h\"}"))
.build();
HttpResponse<String> res = client.send(req, HttpResponse.BodyHandlers.ofString());let res = reqwest_client
.request(reqwest::Method::POST, "https://localhost:8080/v1/admin/wal/archive")
.bearer_auth(std::env::var("SPYD_TOKEN")?)
.json(&serde_json::json!({"name":"wal-2026-11-27-21h"}))
.send().await?;
println!("{}", res.text().await?);{
"name": "wal-2026-11-27-21h"
}{
"last_lsn": 19010
}Non-destructively restores PITR state into a fresh database while production stays online.
curl -sS --cacert tls/ca.crt -X POST "https://localhost:8080/v1/admin/restore" \
-H "Authorization: Bearer $SPYD_TOKEN" \
-H "Content-Type: application/json" \
-d '{"backup":"daily-2026-11-27","wal_archive":"wal-2026-11-27-21h","lsn":18420,"database":"recovery_probe"}'const res = await fetch("https://localhost:8080/v1/admin/restore", {
method: "POST",
headers: {
Authorization: `Bearer ${process.env.SPYD_TOKEN}`,
"Content-Type": "application/json",
},
body: JSON.stringify({
"backup": "daily-2026-11-27",
"wal_archive": "wal-2026-11-27-21h",
"lsn": 18420,
"database": "recovery_probe"
}),
});
const data = await res.json();import os, httpx
with httpx.Client(verify="tls/ca.crt") as client:
res = client.request(
"POST",
"https://localhost:8080/v1/admin/restore",
headers={"Authorization": f"Bearer {os.environ['SPYD_TOKEN']}"},
json={"backup":"daily-2026-11-27","wal_archive":"wal-2026-11-27-21h","lsn":18420,"database":"recovery_probe"},
)
print(res.json())req, _ := http.NewRequest("POST", "https://localhost:8080/v1/admin/restore", strings.NewReader("{\"backup\":\"daily-2026-11-27\",\"wal_archive\":\"wal-2026-11-27-21h\",\"lsn\":18420,\"database\":\"recovery_probe\"}"))
req.Header.Set("Authorization", "Bearer " + os.Getenv("SPYD_TOKEN"))
req.Header.Set("Content-Type", "application/json")
resp, err := httpClient.Do(req)HttpRequest req = HttpRequest.newBuilder()
.uri(URI.create("https://localhost:8080/v1/admin/restore"))
.header("Authorization", "Bearer " + System.getenv("SPYD_TOKEN"))
.header("Content-Type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\"backup\":\"daily-2026-11-27\",\"wal_archive\":\"wal-2026-11-27-21h\",\"lsn\":18420,\"database\":\"recovery_probe\"}"))
.build();
HttpResponse<String> res = client.send(req, HttpResponse.BodyHandlers.ofString());let res = reqwest_client
.request(reqwest::Method::POST, "https://localhost:8080/v1/admin/restore")
.bearer_auth(std::env::var("SPYD_TOKEN")?)
.json(&serde_json::json!({"backup":"daily-2026-11-27","wal_archive":"wal-2026-11-27-21h","lsn":18420,"database":"recovery_probe"}))
.send().await?;
println!("{}", res.text().await?);{
"backup": "daily-2026-11-27",
"wal_archive": "wal-2026-11-27-21h",
"lsn": 18420,
"database": "recovery_probe"
}{
"restored": true,
"database": "recovery_probe"
}Reads manifest, sealed segments, joins, and active segment to detect any tampering.
curl -sS --cacert tls/ca.crt -X GET "https://localhost:8080/v1/admin/audit/verify" \
-H "Authorization: Bearer $SPYD_TOKEN"const res = await fetch("https://localhost:8080/v1/admin/audit/verify", {
method: "GET",
headers: {
Authorization: `Bearer ${process.env.SPYD_TOKEN}`,
},
});
const data = await res.json();import os, httpx
with httpx.Client(verify="tls/ca.crt") as client:
res = client.request(
"GET",
"https://localhost:8080/v1/admin/audit/verify",
headers={"Authorization": f"Bearer {os.environ['SPYD_TOKEN']}"},
)
print(res.json())req, _ := http.NewRequest("GET", "https://localhost:8080/v1/admin/audit/verify", nil)
req.Header.Set("Authorization", "Bearer " + os.Getenv("SPYD_TOKEN"))
resp, err := httpClient.Do(req)HttpRequest req = HttpRequest.newBuilder()
.uri(URI.create("https://localhost:8080/v1/admin/audit/verify"))
.header("Authorization", "Bearer " + System.getenv("SPYD_TOKEN"))
.method("GET", HttpRequest.BodyPublishers.noBody())
.build();
HttpResponse<String> res = client.send(req, HttpResponse.BodyHandlers.ofString());let res = reqwest_client
.request(reqwest::Method::GET, "https://localhost:8080/v1/admin/audit/verify")
.bearer_auth(std::env::var("SPYD_TOKEN")?)
.send().await?;
println!("{}", res.text().await?);{
"verified": true,
"chain": {
"segments": 3,
"events": 14820
}
}Returns recent audited DDL/DML and security access records.
curl -sS --cacert tls/ca.crt -X GET "https://localhost:8080/v1/admin/audit/events" \
-H "Authorization: Bearer $SPYD_TOKEN"const res = await fetch("https://localhost:8080/v1/admin/audit/events", {
method: "GET",
headers: {
Authorization: `Bearer ${process.env.SPYD_TOKEN}`,
},
});
const data = await res.json();import os, httpx
with httpx.Client(verify="tls/ca.crt") as client:
res = client.request(
"GET",
"https://localhost:8080/v1/admin/audit/events",
headers={"Authorization": f"Bearer {os.environ['SPYD_TOKEN']}"},
)
print(res.json())req, _ := http.NewRequest("GET", "https://localhost:8080/v1/admin/audit/events", nil)
req.Header.Set("Authorization", "Bearer " + os.Getenv("SPYD_TOKEN"))
resp, err := httpClient.Do(req)HttpRequest req = HttpRequest.newBuilder()
.uri(URI.create("https://localhost:8080/v1/admin/audit/events"))
.header("Authorization", "Bearer " + System.getenv("SPYD_TOKEN"))
.method("GET", HttpRequest.BodyPublishers.noBody())
.build();
HttpResponse<String> res = client.send(req, HttpResponse.BodyHandlers.ofString());let res = reqwest_client
.request(reqwest::Method::GET, "https://localhost:8080/v1/admin/audit/events")
.bearer_auth(std::env::var("SPYD_TOKEN")?)
.send().await?;
println!("{}", res.text().await?);{
"events": []
}Activates a fresh AES-256-GCM-SIV column key and re-encrypts stored fields cleanly.
curl -sS --cacert tls/ca.crt -X POST "https://localhost:8080/v1/admin/keys/column/rotate" \
-H "Authorization: Bearer $SPYD_TOKEN" \
-H "Content-Type: application/json" \
-d '{}'const res = await fetch("https://localhost:8080/v1/admin/keys/column/rotate", {
method: "POST",
headers: {
Authorization: `Bearer ${process.env.SPYD_TOKEN}`,
"Content-Type": "application/json",
},
body: JSON.stringify({}),
});
const data = await res.json();import os, httpx
with httpx.Client(verify="tls/ca.crt") as client:
res = client.request(
"POST",
"https://localhost:8080/v1/admin/keys/column/rotate",
headers={"Authorization": f"Bearer {os.environ['SPYD_TOKEN']}"},
json={},
)
print(res.json())req, _ := http.NewRequest("POST", "https://localhost:8080/v1/admin/keys/column/rotate", strings.NewReader("{}"))
req.Header.Set("Authorization", "Bearer " + os.Getenv("SPYD_TOKEN"))
req.Header.Set("Content-Type", "application/json")
resp, err := httpClient.Do(req)HttpRequest req = HttpRequest.newBuilder()
.uri(URI.create("https://localhost:8080/v1/admin/keys/column/rotate"))
.header("Authorization", "Bearer " + System.getenv("SPYD_TOKEN"))
.header("Content-Type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{}"))
.build();
HttpResponse<String> res = client.send(req, HttpResponse.BodyHandlers.ofString());let res = reqwest_client
.request(reqwest::Method::POST, "https://localhost:8080/v1/admin/keys/column/rotate")
.bearer_auth(std::env::var("SPYD_TOKEN")?)
.json(&serde_json::json!({}))
.send().await?;
println!("{}", res.text().await?);{
"rotated": true
}Re-encrypts every page atomically through the double-write staging area.
curl -sS --cacert tls/ca.crt -X POST "https://localhost:8080/v1/admin/keys/storage/rotate" \
-H "Authorization: Bearer $SPYD_TOKEN" \
-H "Content-Type: application/json" \
-d '{"key_file":"storage-v2.key"}'const res = await fetch("https://localhost:8080/v1/admin/keys/storage/rotate", {
method: "POST",
headers: {
Authorization: `Bearer ${process.env.SPYD_TOKEN}`,
"Content-Type": "application/json",
},
body: JSON.stringify({
"key_file": "storage-v2.key"
}),
});
const data = await res.json();import os, httpx
with httpx.Client(verify="tls/ca.crt") as client:
res = client.request(
"POST",
"https://localhost:8080/v1/admin/keys/storage/rotate",
headers={"Authorization": f"Bearer {os.environ['SPYD_TOKEN']}"},
json={"key_file":"storage-v2.key"},
)
print(res.json())req, _ := http.NewRequest("POST", "https://localhost:8080/v1/admin/keys/storage/rotate", strings.NewReader("{\"key_file\":\"storage-v2.key\"}"))
req.Header.Set("Authorization", "Bearer " + os.Getenv("SPYD_TOKEN"))
req.Header.Set("Content-Type", "application/json")
resp, err := httpClient.Do(req)HttpRequest req = HttpRequest.newBuilder()
.uri(URI.create("https://localhost:8080/v1/admin/keys/storage/rotate"))
.header("Authorization", "Bearer " + System.getenv("SPYD_TOKEN"))
.header("Content-Type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\"key_file\":\"storage-v2.key\"}"))
.build();
HttpResponse<String> res = client.send(req, HttpResponse.BodyHandlers.ofString());let res = reqwest_client
.request(reqwest::Method::POST, "https://localhost:8080/v1/admin/keys/storage/rotate")
.bearer_auth(std::env::var("SPYD_TOKEN")?)
.json(&serde_json::json!({"key_file":"storage-v2.key"}))
.send().await?;
println!("{}", res.text().await?);{
"key_file": "storage-v2.key"
}{
"rotated": true
}Returns installed .spydext extension metadata, SHA-256 digests, exported SQL signatures, resource limits, and whether each extension is currently permitted (requires manage database(extensions)).
curl -sS --cacert tls/ca.crt -X GET "https://localhost:8080/v1/admin/extensions" \
-H "Authorization: Bearer $SPYD_TOKEN"const res = await fetch("https://localhost:8080/v1/admin/extensions", {
method: "GET",
headers: {
Authorization: `Bearer ${process.env.SPYD_TOKEN}`,
},
});
const data = await res.json();import os, httpx
with httpx.Client(verify="tls/ca.crt") as client:
res = client.request(
"GET",
"https://localhost:8080/v1/admin/extensions",
headers={"Authorization": f"Bearer {os.environ['SPYD_TOKEN']}"},
)
print(res.json())req, _ := http.NewRequest("GET", "https://localhost:8080/v1/admin/extensions", nil)
req.Header.Set("Authorization", "Bearer " + os.Getenv("SPYD_TOKEN"))
resp, err := httpClient.Do(req)HttpRequest req = HttpRequest.newBuilder()
.uri(URI.create("https://localhost:8080/v1/admin/extensions"))
.header("Authorization", "Bearer " + System.getenv("SPYD_TOKEN"))
.method("GET", HttpRequest.BodyPublishers.noBody())
.build();
HttpResponse<String> res = client.send(req, HttpResponse.BodyHandlers.ofString());let res = reqwest_client
.request(reqwest::Method::GET, "https://localhost:8080/v1/admin/extensions")
.bearer_auth(std::env::var("SPYD_TOKEN")?)
.send().await?;
println!("{}", res.text().await?);{
"extensions": [
{
"name": "geo_ext",
"version": "1.0.0",
"abi_version": 1,
"min_engine_version": "1.0.0",
"wasm_sha256": "e3b0c442...",
"manifest_sha256": "9f86d081...",
"signer": "platform-releng",
"deterministic": true,
"max_memory_pages": 16,
"max_fuel": 1000000,
"installed_us": 1735689600000000,
"allowed_by_policy": true,
"exports": [
{
"sql_name": "clamp_discount",
"symbol": "clamp_discount",
"params": [
"i32",
"i32"
],
"returns": "i32"
}
]
}
]
}Verifies Ed25519 signature, policy trust, ABI version, and exports before installing or upgrading the extension (requires manage database(extensions)).
curl -sS --cacert tls/ca.crt -X POST "https://localhost:8080/v1/admin/extensions" \
-H "Authorization: Bearer $SPYD_TOKEN" \
-H "Content-Type: application/json" \
-d '{"bundle_base64":"UEsDBBQAAAAIA...","update":false,"if_not_exists":false,"allow_downgrade":false}'const res = await fetch("https://localhost:8080/v1/admin/extensions", {
method: "POST",
headers: {
Authorization: `Bearer ${process.env.SPYD_TOKEN}`,
"Content-Type": "application/json",
},
body: JSON.stringify({
"bundle_base64": "UEsDBBQAAAAIA...",
"update": false,
"if_not_exists": false,
"allow_downgrade": false
}),
});
const data = await res.json();import os, httpx
with httpx.Client(verify="tls/ca.crt") as client:
res = client.request(
"POST",
"https://localhost:8080/v1/admin/extensions",
headers={"Authorization": f"Bearer {os.environ['SPYD_TOKEN']}"},
json={"bundle_base64":"UEsDBBQAAAAIA...","update":false,"if_not_exists":false,"allow_downgrade":false},
)
print(res.json())req, _ := http.NewRequest("POST", "https://localhost:8080/v1/admin/extensions", strings.NewReader("{\"bundle_base64\":\"UEsDBBQAAAAIA...\",\"update\":false,\"if_not_exists\":false,\"allow_downgrade\":false}"))
req.Header.Set("Authorization", "Bearer " + os.Getenv("SPYD_TOKEN"))
req.Header.Set("Content-Type", "application/json")
resp, err := httpClient.Do(req)HttpRequest req = HttpRequest.newBuilder()
.uri(URI.create("https://localhost:8080/v1/admin/extensions"))
.header("Authorization", "Bearer " + System.getenv("SPYD_TOKEN"))
.header("Content-Type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\"bundle_base64\":\"UEsDBBQAAAAIA...\",\"update\":false,\"if_not_exists\":false,\"allow_downgrade\":false}"))
.build();
HttpResponse<String> res = client.send(req, HttpResponse.BodyHandlers.ofString());let res = reqwest_client
.request(reqwest::Method::POST, "https://localhost:8080/v1/admin/extensions")
.bearer_auth(std::env::var("SPYD_TOKEN")?)
.json(&serde_json::json!({"bundle_base64":"UEsDBBQAAAAIA...","update":false,"if_not_exists":false,"allow_downgrade":false}))
.send().await?;
println!("{}", res.text().await?);{
"bundle_base64": "UEsDBBQAAAAIA...",
"update": false,
"if_not_exists": false,
"allow_downgrade": false
}{
"installed": true,
"extension": {
"name": "geo_ext",
"version": "1.0.0",
"allowed_by_policy": true
}
}Removes the named extension from the active database. Supports ?cascade=bool and ?if_exists=bool query parameters (requires manage database(extensions)).
curl -sS --cacert tls/ca.crt -X DELETE "https://localhost:8080/v1/admin/extensions/<name>" \
-H "Authorization: Bearer $SPYD_TOKEN"const res = await fetch("https://localhost:8080/v1/admin/extensions/<name>", {
method: "DELETE",
headers: {
Authorization: `Bearer ${process.env.SPYD_TOKEN}`,
},
});
const data = await res.json();import os, httpx
with httpx.Client(verify="tls/ca.crt") as client:
res = client.request(
"DELETE",
"https://localhost:8080/v1/admin/extensions/<name>",
headers={"Authorization": f"Bearer {os.environ['SPYD_TOKEN']}"},
)
print(res.json())req, _ := http.NewRequest("DELETE", "https://localhost:8080/v1/admin/extensions/<name>", nil)
req.Header.Set("Authorization", "Bearer " + os.Getenv("SPYD_TOKEN"))
resp, err := httpClient.Do(req)HttpRequest req = HttpRequest.newBuilder()
.uri(URI.create("https://localhost:8080/v1/admin/extensions/<name>"))
.header("Authorization", "Bearer " + System.getenv("SPYD_TOKEN"))
.method("DELETE", HttpRequest.BodyPublishers.noBody())
.build();
HttpResponse<String> res = client.send(req, HttpResponse.BodyHandlers.ofString());let res = reqwest_client
.request(reqwest::Method::DELETE, "https://localhost:8080/v1/admin/extensions/<name>")
.bearer_auth(std::env::var("SPYD_TOKEN")?)
.send().await?;
println!("{}", res.text().await?);{
"name": "geo_ext",
"dropped": true
}{
"type": "object",
"required": [
"status",
"draining",
"storage",
"version"
],
"properties": {
"status": {
"type": "string",
"enum": [
"ok",
"draining",
"failed"
]
},
"draining": {
"type": "boolean"
},
"storage": {
"type": "string",
"enum": [
"ok",
"failed"
]
},
"version": {
"type": "string"
}
}
}{
"type": "object",
"additionalProperties": false,
"required": [
"sql"
],
"properties": {
"sql": {
"type": "string",
"description": "One SpydQL statement.",
"maxLength": 1048576
},
"parameters": {
"type": "array",
"description": "Positional values for `$1`, `$2`, and so on.",
"items": {
"$ref": "#/components/schemas/Value"
}
},
"query_id": {
"type": "integer",
"format": "uint64",
"minimum": 1,
"description": "A client-chosen identifier, usable with the cancel route while the\nstatement runs. The server assigns one when it is absent.\n"
}
}
}{
"type": "object",
"additionalProperties": false,
"required": [
"sql"
],
"properties": {
"sql": {
"type": "string",
"description": "One SpydQL statement.",
"maxLength": 1048576
}
}
}{
"type": "object",
"required": [
"statement_id",
"read_only",
"parameters",
"columns"
],
"properties": {
"statement_id": {
"type": "integer",
"format": "int64",
"minimum": 1,
"description": "Positive 63-bit identifier for the execute and close routes."
},
"read_only": {
"type": "boolean",
"description": "Whether the analyzed plan is cached and reused."
},
"parameters": {
"type": "object",
"required": [
"positional",
"named",
"types"
],
"properties": {
"positional": {
"type": "integer",
"minimum": 0
},
"named": {
"type": "array",
"items": {
"type": "string"
}
},
"types": {
"type": "array",
"items": {
"type": [
"string",
"null"
]
}
}
}
},
"columns": {
"type": "array",
"items": {
"$ref": "#/components/schemas/Column"
}
}
}
}{
"type": "object",
"additionalProperties": false,
"required": [
"statement_id"
],
"properties": {
"statement_id": {
"type": "integer",
"format": "int64",
"minimum": 1
},
"parameters": {
"type": "array",
"description": "Positional values for `$1`, `$2`, and so on.",
"items": {
"$ref": "#/components/schemas/Value"
}
},
"query_id": {
"type": "integer",
"format": "uint64",
"minimum": 1,
"description": "A client-chosen identifier, usable with the cancel route while the\nstatement runs.\n"
}
}
}{
"type": "object",
"required": [
"query_id",
"columns",
"rows",
"affected",
"message",
"elapsed_ms"
],
"properties": {
"query_id": {
"type": "integer",
"format": "uint64"
},
"columns": {
"type": "array",
"items": {
"$ref": "#/components/schemas/Column"
}
},
"rows": {
"type": "array",
"items": {
"type": "array",
"items": {
"$ref": "#/components/schemas/Value"
}
}
},
"affected": {
"type": "integer",
"format": "uint64"
},
"message": {
"type": [
"string",
"null"
]
},
"elapsed_ms": {
"type": "integer",
"format": "uint64"
}
}
}{
"type": "object",
"required": [
"name",
"data_type"
],
"properties": {
"name": {
"type": "string"
},
"data_type": {
"type": "string",
"description": "Rust `Debug` rendering of the column type.",
"examples": [
"U64",
"String { max_len: Some(40) }"
]
}
}
}{
"type": "object",
"required": [
"query_id",
"cancelled"
],
"properties": {
"query_id": {
"type": "integer",
"format": "uint64"
},
"cancelled": {
"type": "boolean"
}
}
}{
"type": "object",
"required": [
"error"
],
"properties": {
"error": {
"type": "object",
"required": [
"code",
"message"
],
"properties": {
"code": {
"type": "string",
"examples": [
"permission_denied",
"invalid_json",
"resource_limited"
]
},
"message": {
"type": "string"
}
}
},
"request_id": {
"type": "string"
},
"query_id": {
"type": "integer",
"format": "uint64"
}
}
}{
"description": "A tagged value. The tag is the variant name; a null is the string\n\"Null\" and every other variant is an object with one member.\n",
"oneOf": [
{
"const": "Null"
},
{
"type": "object",
"required": [
"Bool"
],
"properties": {
"Bool": {
"type": "boolean"
}
}
},
{
"type": "object",
"required": [
"U8"
],
"properties": {
"U8": {
"type": "integer",
"minimum": 0,
"maximum": 255
}
}
},
{
"type": "object",
"required": [
"U16"
],
"properties": {
"U16": {
"type": "integer",
"minimum": 0,
"maximum": 65535
}
}
},
{
"type": "object",
"required": [
"U32"
],
"properties": {
"U32": {
"type": "integer",
"minimum": 0,
"maximum": 4294967295
}
}
},
{
"type": "object",
"required": [
"U64"
],
"properties": {
"U64": {
"type": "integer",
"minimum": 0
}
}
},
{
"type": "object",
"required": [
"I8"
],
"properties": {
"I8": {
"type": "integer",
"minimum": -128,
"maximum": 127
}
}
},
{
"type": "object",
"required": [
"I16"
],
"properties": {
"I16": {
"type": "integer",
"minimum": -32768,
"maximum": 32767
}
}
},
{
"type": "object",
"required": [
"I32"
],
"properties": {
"I32": {
"type": "integer"
}
}
},
{
"type": "object",
"required": [
"I64"
],
"properties": {
"I64": {
"type": "integer"
}
}
},
{
"type": "object",
"required": [
"F32"
],
"properties": {
"F32": {
"type": "number"
}
}
},
{
"type": "object",
"required": [
"F64"
],
"properties": {
"F64": {
"type": "number"
}
}
},
{
"type": "object",
"required": [
"Decimal"
],
"properties": {
"Decimal": {
"type": "object",
"required": [
"mantissa",
"scale"
],
"properties": {
"mantissa": {
"type": "integer"
},
"scale": {
"type": "integer",
"minimum": 0,
"maximum": 255
}
}
}
}
},
{
"type": "object",
"required": [
"String"
],
"properties": {
"String": {
"type": "string"
}
}
},
{
"type": "object",
"required": [
"Text"
],
"properties": {
"Text": {
"type": "string"
}
}
},
{
"type": "object",
"required": [
"Bytes"
],
"properties": {
"Bytes": {
"type": "array",
"items": {
"type": "integer",
"minimum": 0,
"maximum": 255
}
}
}
},
{
"type": "object",
"required": [
"Timestamp"
],
"properties": {
"Timestamp": {
"type": "integer",
"description": "Microseconds since the Unix epoch."
}
}
},
{
"type": "object",
"required": [
"Date"
],
"properties": {
"Date": {
"type": "integer",
"description": "Days since the Unix epoch."
}
}
},
{
"type": "object",
"required": [
"Json"
],
"properties": {
"Json": {}
}
},
{
"type": "object",
"required": [
"Vector"
],
"properties": {
"Vector": {
"type": "array",
"items": {
"type": "number"
}
}
}
},
{
"type": "object",
"required": [
"GeoPoint"
],
"properties": {
"GeoPoint": {
"type": "object",
"required": [
"lat",
"lng"
],
"properties": {
"lat": {
"type": "number"
},
"lng": {
"type": "number"
}
}
}
}
},
{
"type": "object",
"required": [
"Enum"
],
"properties": {
"Enum": {
"type": "integer",
"minimum": 0
}
}
}
]
}