Aggregate federation key + capability health
GET /admin/federation/key-health
Admin observability surface. One round-trip feeds the /admin/federation/key-health dashboard’s five tiles: users without keypair (I-b backfill gap), remote actors missing encryption keys (I-c cache miss), peers without capabilities (I-d negotiation miss), retained keys near expiry (sweeper preview), and the total approved-user count for denominator context. Drill-down rows for “users missing keypair” + “recent rotations” ride along so the page renders without separate calls.
Authorizations
Section titled “Authorizations ”Responses
Section titled “ Responses ”Aggregate health counts + drill-downs.
Aggregate counts feeding the /admin/federation/key-health dashboard. Five counts in one round-trip; drill-down endpoints ( ListUsersMissingKeypair, ListRecentRotations) cover the per-row detail when the operator follows a tile.
object
Total approved users on this instance.
Approved users with no current federation_user_keys row. Healthy steady state = 0; non-zero surfaces the I-b boot backfill gap.
Federation_remote_actors rows whose encryption_public_key is NULL. Pre-I-c peers OR a peer who hasn’t yet emitted an inbound activity carrying their key.
Federation_peers rows that haven’t completed I-d capability negotiation. Surfaces the “needs re-pair” cohort.
Retained federation_user_keys rows whose retained_until trips in the next 7 days. Preview of what the sweeper will reap soon.
Last 50 rotations across all users; ordered newest first. Surfaced inline so the dashboard renders without a separate round-trip.
Audit-style projection of a single rotation. Pulled from federation_user_keys.rotated_at + rotated_by_user_ref so the dashboard renders without joining audit_events.
object
User.ref of whoever triggered the rotation. NULL when the original triggering admin has since been deleted (the FK is ON DELETE SET NULL). Equals user_ref for self-rotation; differs for admin-initiated recovery.
Per-user drill-down on the “users missing keypair” tile. Up to 100 rows; oldest-account-first so the operator can prioritise long-standing gaps.
Drill-down row for the “users missing keypair” tile on the admin federation health dashboard.
object
When the user record was created. Old creation date + no keypair = the I-b boot backfill missed them across reboots.
Authentication required, missing, or invalid
object
Human-readable error summary
Example
the request could not be completedExample
{ "error": "authentication required: sign in and retry with a valid session or API token"}Authenticated but missing required capabilities
object
Human-readable error summary
Example
the request could not be completed