Skip to content

API keys

API keys let you authenticate with the admin API without going through the OAuth flow. Use them for CI/CD pipelines and any other automation that manages your instance.

Each API key is a 35-character token with the format hv_ followed by 32 random hex characters:

hv_a1b2c3d4e5f6a1b2c3d4e5f6a1b2c3d4

When you create a key, HappyView shows the full token once. After that, only the prefix (hv_a1b2c3d4) is stored for display, and the key itself is SHA-256 hashed before being saved to the database, so nobody (including you) can retrieve the full key after creation.

Each API key has its own set of scoped permissions, chosen when you create it. A key never has more access than the operator who created it; API key permissions explains how the two combine.

  1. Go to Access > API Keys in the dashboard sidebar
  2. Click Create API Key
  3. Enter a descriptive name (e.g., “CI Deploy”, “Monitoring Script”)
  4. Select the permissions the key should have
  5. Copy the full key from the confirmation dialog, because you won’t see it again

Pass the key as a Bearer token in the Authorization header:

const TOKEN = "hv_a1b2c3d4e5f6a1b2c3d4e5f6a1b2c3d4";
const response = await fetch("http://127.0.0.1:3000/admin/lexicons", {
headers: { Authorization: `Bearer ${TOKEN}` },
});
interface LexiconSummary {
id: string;
revision: number;
lexicon_type: string;
}
const data: LexiconSummary[] = await response.json();

This works for all admin API endpoints that the key has permissions for. A dashboard sign-in carries the operator’s full permissions, but an API key is limited to the permissions assigned at creation.

  1. Go to Access > API Keys
  2. Click Revoke next to the key
  3. Confirm in the dialog

Revoked keys are soft-deleted: they remain visible in the table (with a strikethrough) for audit purposes but can no longer authenticate. Any service using the key will immediately receive 401 Unauthorized responses.

The Last Used column in the API Keys table shows when each key was last used to authenticate a request. Keys that have never been used show “Never”.

  • Anyone holding a key can access your instance with that key’s permissions, so store it like a password.
  • Grant only the permissions the key needs. A key that deploys a project from CI needs only project:deploy.
  • Name each key after the service that uses it.
  • Revoke keys you no longer use, and revoke a compromised key at once.
  • Keep keys out of version control. Use environment variables or a secret manager.