Skip to content
POST/api/v1/compliance/ledger-keys

Rotate or revoke the organization's evidence-ledger signing key

Replaces the organization's active Ed25519 evidence-signing key, or revokes a key that is already out of service. ROTATION IS ATOMIC. The outgoing key is retired and the replacement installed in ONE database transaction. Split into two calls there is a window with no active key, during which a concurrent evidence append auto-provisions a third one, and a failure between them leaves the tenant with none. NOTHING HISTORICAL IS INVALIDATED, AND NOTHING IS RE-SIGNED. Every key stays in the trust anchor forever and every record ever signed by this organization keeps verifying. What changes is which key signs from now on, plus a published disposition an auditor can weigh. Re-signing historical records would destroy the hash chain's meaning and is never done. REVOKING THE LIVE KEY IS A ROTATION. `action: "revoke"` deliberately refuses the currently-active key: revoking it without minting a replacement in the same transaction would leave the tenant keyless and the lazy provisioner would then silently mint one nobody decided to create. For a compromised live key use `action: "rotate"` with `compromised: true`, which installs a fresh key and marks the outgoing one REVOKED rather than RETIRED. Owner/admin only: an editor who can author evidence must not be able to change the key that vouches for it. Not plan-gated — replacing a key you believe is leaked is a security control, not an upsell.

Authentication

Send Authorization: Bearer YOUR_API_KEY on every request. Generate API keys at /dashboard/settings/api-keys.

Parameters

orgId in queryrequired

Organization whose signing keys to return, and which your credential must be scoped to. Must be a UUID; 400 INVALID_ORG_ID otherwise.

string

Request body required

Schema
{
  "application/json": {
    "schema": {
      "oneOf": [
        {
          "type": "object",
          "properties": {
            "action": {
              "type": "string",
              "enum": [
                "rotate"
              ]
            },
            "compromised": {
              "type": "boolean"
            },
            "reason": {
              "type": "string",
              "enum": [
                "superseded",
                "compromise",
                "operator-request",
                "offboarding"
              ]
            }
          },
          "required": [
            "action"
          ],
          "additionalProperties": false
        },
        {
          "type": "object",
          "properties": {
            "action": {
              "type": "string",
              "enum": [
                "revoke"
              ]
            },
            "keyId": {
              "type": "string",
              "minLength": 1,
              "maxLength": 128
            },
            "reason": {
              "type": "string",
              "enum": [
                "superseded",
                "compromise",
                "operator-request",
                "offboarding"
              ]
            }
          },
          "required": [
            "action",
            "keyId",
            "reason"
          ],
          "additionalProperties": false
        }
      ]
    }
  }
}

Response

All status codes

200The rotation or revocation was applied.
400`INVALID_ORG_ID` or `VALIDATION_ERROR` — malformed body.
401`UNAUTHORIZED` — no credential supplied.
403`FORBIDDEN` — owner/admin role required. `NOT_ORG_MEMBER` / `KEY_ORG_MISMATCH` — credential not scoped to this organization.
409`LEDGER_KEY_LIFECYCLE_REFUSED` — the database refused the transition. The common cases: the named key is the ACTIVE one (rotate with `compromised: true` instead), the key does not exist for this organization, or the requested status transition is not permitted (nothing ever returns to `active`).
429Rate limit exceeded (5/min).
500`LEDGER_KEY_OPERATION_FAILED` — the operation could not be completed. No partial rotation is possible; the transaction either applied or did not.

Code samples

cURL

curl -X POST \
  https://evalguard.ai/api/v1/compliance/ledger-keys \
  -H "Authorization: Bearer $EVALGUARD_API_KEY"

TypeScript

// The TypeScript SDK (@evalguard/sdk) exposes TYPED methods — runEval,
// getEval, runSecurityScan, checkFirewall, … — not a generic request().
// For an arbitrary endpoint, call it directly:

const res = await fetch("https://evalguard.ai/api/v1/compliance/ledger-keys", {
  method: "POST",
  headers: { Authorization: `Bearer ${process.env.EVALGUARD_API_KEY}` },
});
console.log(res.status, await res.json());

Python

# The Python SDK (pip install evalguardai) exposes TYPED methods on
# EvalGuardClient — run_eval, get_eval, … — not a generic request().
# For an arbitrary endpoint, call it directly:

import os
import requests

headers = {"Authorization": f"Bearer {os.environ['EVALGUARD_API_KEY']}"}

response = requests.request("POST", "https://evalguard.ai/api/v1/compliance/ledger-keys", headers=headers)
print(response.status_code, response.json())

Go

package main

import (
	"context"
	"fmt"
	"net/http"
	"os"
)

func main() {
	req, _ := http.NewRequestWithContext(context.Background(), "POST", "https://evalguard.ai/api/v1/compliance/ledger-keys", nil)
	req.Header.Set("Authorization", "Bearer "+os.Getenv("EVALGUARD_API_KEY"))
	resp, err := http.DefaultClient.Do(req)
	if err != nil { panic(err) }
	defer resp.Body.Close()
	fmt.Println(resp.Status)
}

Errors

400401403409429500

Other Compliance endpoints