Skip to main content

API Keys Management

API keys authenticate requests to the Zyphe API (https://api.zyphe.com). They are not used against the documentation site. See Environment setup for hosts.

Key Types​

Zyphe provides two distinct types of API keys, each designed for specific use cases and security requirements:

Publishable Keys​

  • Prefix: zyphe_pk_
  • Use Case: Client-side code only, primarily the Browser SDK in a web app with restricted Allowed Origins (CORS).
  • Security: Limited permissions. Never sufficient as a substitute for a secret key on your backend.

Secret Keys​

  • Prefix: zyphe_sk_
  • Use Case: All backend / server-side calls, including:
    • POST /sdk/flow/{flowId}/vr/create (session creation)
    • Step completion, next-step, flow results, AML, KYB helpers
    • Direct HTTP integrations without the npm SDK (Backend API integration)
    • Node SDK / @zyphe-sdk/core on a server
    • The Export API (secret keys only)
  • Security: Secret keys grant broad access to your organization's API resources. They must never be embedded in mobile apps, browser bundles, or public repositories.
Call siteKey type
Your backend (any language)Secret zyphe_sk_…
Browser SDK in the pagePublishable zyphe_pk_…
Mobile app binaryNeither: call your backend, which uses a secret key
Backend integrations

If you are not using the Browser SDK in a web page, generate a secret key. A very common 401 invalid_api_key cause is sending a publishable key to vr/create from a server.

Managing API Keys​

API keys live on the API keys tab of Developers (sidebar → Organization → Developers → API keys), available to Admins and Developers. Keys belong to one environment: the page lists the keys of the environment the dashboard is switched to, so generate your sandbox keys in sandbox and your production keys in production.

Generate a key​

  1. Open the Zyphe Dashboard and switch to the environment the key is for.
  2. Open Developers, then API keys, and click Generate API Key.
  3. Enter a Name and a Description, choose the Type (SECRET or PUBLISHABLE), and for a publishable key list its Allowed Origins. A publishable key with no origins is allowed on every origin. For a secret key, also choose its Scope: All areas, or Only these areas and tick the parts of the API it may use. A publishable key can only start verifications, so it has no scope to choose.
  4. Click Submit.

The API key created dialog shows the new key:

  • A secret key is shown only once. Copy it now and store it somewhere safe. If you lose it, delete it and generate a new one.
  • A publishable key can be copied again from the list at any time.

The key list​

The list shows each key's name, key, type, allowed origins, scope and when it was last used.

  • A secret key shows only its hint, its prefix and last four characters (for example zyphe_sk_…a1b2): Zyphe keeps only a hash of the rest.
  • A publishable key is shown in full, with a copy button.
Older secret keys

Secret keys created before keys were stored as hashes are still shown in full, and the page tells you so, until you retire them. Rotate each one: generate a new key, update your integration, then delete the old key.

From a key's action menu:

  • Edit changes its name, description, allowed origins or scope. The type can't be changed.
  • Rotate gives the key a new secret, shown once. The current secret stops working at once, so update your integration right after; the key keeps its name, scope and allowed origins.
  • Delete revokes it: requests with it fail at once.
Calling the organization API with a role

API keys authenticate the SDK and session endpoints. To let your server call the organization API (results, KYB cases, configuration) with a role and its own audit identity, create an API credential (sk_live_… / sk_test_…) on the Agents tab of Developers instead. See Agents and API credentials.

Troubleshooting invalid_api_key​

HTTP 401 with body like:

{ "code": 10201, "errorTag": "invalid_api_key" }
CauseWhat to check
Wrong key typeBackend must use zyphe_sk_…, not zyphe_pk_…
Wrong API hostBase URL must be https://api.zyphe.com (not docs.zyphe.com)
Truncated / reformatted keyNo spaces, quotes, or line breaks in the header value
Key deleted or rotatedGenerate a new secret key in the dashboard
Key from the other environmentKeys belong to the environment they were generated in: generate one in the environment you call
Sandbox vs production mix-upsandbox / isSandbox must match the dashboard mode. See Sandbox mode

Full error catalog: API errors.

Security Best Practices​

  • Protect Secret Keys: Always store secret keys securely using environment variables or secret management services.
  • Restrict Origins: For publishable keys, always configure the "Allowed Origins" setting to ensure the key can only be used from your authorized domains.
  • Rotate Keys: Periodically rotate your API keys to minimize the impact of a potential credential leak.
  • Principle of Least Privilege: Use different keys for different applications or environments to isolate access.