ApiKeyCreated

Shape returned when an ApiKey is first created.

Definition

TypeScript
interface ApiKeyCreated {
  id: string;
  name: string;
  key: string;
  keyHint: string;
  type: "private" | "public";
  expiresAt: string | null;
  scopes?:
    | {
        operations?: Array<string> | undefined;
        entityIds?: Array<string> | undefined;
      }
    | null
    | undefined;
}

Fields

FieldTypeNotes
idstringreadonly required
namestringrequired — Human-readable label for the key.
keystringrequired — Full plaintext key value — returned only once at creation time.
keyHintstringrequired — Last few characters of the key, safe to display for identification.
type"private" | "public"required — Key type — 'private' for server-side use, 'public' for clients.
expiresAtstring | nullrequired — ISO-8601 timestamp after which the key is rejected; null = no expiry.
scopes{ operations?: Array<string> | undefined; entityIds?: Array<string> | undefined; } | null | undefinedoptional — Restricts what this key may do; null/empty means full access within its key type.