UI Inspect
API Reference

Auth & API Keys

Authentication endpoints for session management and API key operations.

Auth

auth.getSession

Get the current user's session.

TypeQuery
AuthPublic
InputNone

Response:

{
  user: {
    id: string;
    name: string;
    email: string;
    image?: string;
  };
  session: {
    id: string;
    expiresAt: string;
  };
} | null

API Keys

apiKey.list

List all API keys for the authenticated user.

TypeQuery
AuthProtected
InputNone

Response:

Array<{
  id: string;
  name: string;
  prefix: string; // First 8 chars for identification
  createdAt: string;
  lastUsedAt: string | null;
}>;

apiKey.create

Create a new API key. The full key is only returned once.

TypeMutation
AuthProtected

Input:

{
  name: string; // Descriptive name (e.g., "CI Pipeline")
}

Response:

{
  id: string;
  name: string;
  prefix: string;
  fullKey: string; // "uii_<64-char-hex>" — save this immediately
  createdAt: string;
}

apiKey.revoke

Immediately revoke an API key.

TypeMutation
AuthProtected

Input:

{
  id: string; // UUID of the key to revoke
}

On this page