token header — there is no OAuth handshake, no session cookie, and no bearer prefix. Possession of the key is authority, so keeping it server-side and out of client code is the single most important security step you can take.
Credential types
Youverify issues two distinct credentials per workspace environment. They serve different purposes and must never be swapped.API Secret Key
Used for all server-to-server API calls. Pass it in the
token header. Never expose this key in a browser, mobile app, or public repository — anyone who holds it can act on your workspace.Public Merchant Key
Safe to embed in web and mobile SDKs or hosted flows. Scoped only to starting liveness and document-capture sessions. It cannot create entities, retrieve profiles, or trigger verifications.
The token header
Pass your secret key as the value of the token header on every server-to-server request. There is no Bearer prefix — the value is the raw key string.
Environments
Youverify operates two completely independent environments. Each has its own base URL and its own set of API credentials. A key from one environment is rejected by the other.
Use sandbox throughout development and integration testing. Switch to production only when you are ready to process real subjects.
Where to find your keys
Your API keys live in your Youverify workspace settings:1
Open your workspace
Log in at cowork.youverify.co.
2
Navigate to Settings → API Keys
In the sidebar, go to Settings, then select the API Keys tab.
3
Select the correct environment
Use the environment selector at the top of the page to toggle between Sandbox and Production. Each environment shows its own distinct key pair.
4
Copy and store securely
Click Copy next to the API Secret Key and store it in a secrets manager,
.env file (excluded from source control), or your deployment platform’s environment variables.Authenticated request examples
Authentication errors
When authentication fails, the API returns a standard error envelope with a machine-readablename field. The two most common authentication-related errors are:
403 Forbidden — insufficient scope
403 Forbidden — insufficient scope
Your key is valid, but it does not have permission to perform the requested action. This typically happens when a Public Merchant Key is used on an endpoint that requires a secret key.Fix: Ensure you are using the API Secret Key (not the Public Merchant Key) for server-side operations. If you have multiple roles or restricted workspace permissions, contact your workspace admin.
Security best practices
- Rotate keys regularly. Generate a new key in workspace settings and update your deployment before retiring the old one.
- Use environment variables. Never commit keys to Git, even in private repositories.
- Scope access. Use the Public Merchant Key for any client-facing flow. Reserve the secret key exclusively for your backend.
- Monitor usage. Review API activity logs in your workspace dashboard to detect unexpected usage patterns early.