Skip to main content

Migrating to Bearer API Keys (API and Lens)

Migrate to Bearer Keys smoothly

Overview

Veryfi is moving from Standard (legacy) API keys to Bearer API keys. Standard keys are still fully supported; there is no cutoff date, and both key types can be live on the same account at the same time.

Both methods send the same CLIENT-ID header. The only difference is the credential in the Authorization header.

Standard API key (legacy)

Bearer API key (recommended)

Authorization header

apikey USERNAME:API_KEY

Bearer YOUR_API_KEY

CLIENT-ID header

Required

Required

Belongs to

One user

The account (client-scoped)

Username needed

Yes

No

Access

Full

Full access, or scoped to selected routes

Key format

Plain key

Starts with vrfk_

Lens SDK support

All SDK versions

Recent SDK versions only (see Lens section)

Full reference: API authentication, Bearer API keys and Lens mobile authentication. Jump to API-only integrations or Lens SDK integrations for the steps that fit your setup.


General questions (API and Lens)

Do we have to migrate to Bearer keys now?

No. Standard keys are still fully supported and there is no cutoff.

Do I rotate my standard API Key?

You have two options for a key rotation:

  1. Rotate your Standard key. Create one more Standard key, move your integration to it, then delete the first key once the move is complete. Nothing else changes, and both keys work during the transition. See Veryfi API Keys.

  2. Move to Bearer keys (recommended). Switch to the new auth method. Your Standard key keeps working while you switch.

Step-by-step help for each option: API Keys Management for Standard keys, and Bearer API key management for creating, scoping and revoking Bearer keys.

Can a Standard key and a Bearer key work at the same time?

Yes. Both can be live on the account at the same time, which is what makes a migration without downtime possible.

Can we send a Bearer key in the old header, or a Standard key as Bearer?

No. A Bearer secret will not work in the apikey USERNAME:API_KEY header, and a Standard key will not work as Bearer. Each key only works in its own header format.

What is the difference between a full access and a scoped Bearer key?

A full access key can call every route your account has. A scoped key can only call the routes you select when you create it. A call to any other route returns 403 This action is not allowed. Presets, such as Lens SDK, select a ready-made set of routes for you.

Either type can also have an optional expiry date. To check what a key can do before you switch to it, call the veryfi endpoint (/api/v1/partner/settings/api-keys/veryfi). It confirms the key works and lists the routes, presets and expiry it grants. See Key types and Veryfi a key.

Do we still need a username?

Not for Bearer keys. The username is only part of the Standard key header.

Can we have more than one Bearer key?

Yes. Bearer keys belong to the account, so you can create several and scope each one to what it needs. Give each key a clear name, such as "Lens iOS, Nov 2026" or "Backend prod", so you can tell them apart when you rotate or revoke one.

Who can create keys?

Admins with API key access, in the Keys section of the Veryfi portal. Keys can only be granted to other Admins.

The account owner always has access. On a Bearer key you can also assign managers: account users who can view, edit and delete that key in the Hub. See API Keys Management and Manage keys in the Hub.

API-only integrations

For an API-only integration, the key lives on your own servers, so the migration is a configuration change you fully control. You create a Bearer key, switch the header, confirm traffic has moved, then revoke the old key. There are no users on old app versions to wait for, so the overlap can be as short as one deploy.

What changes in our requests?

Only the Authorization header. Keep sending CLIENT-ID, and keep any optional signature headers as they are.

Before (Standard key):

CLIENT-ID: YOUR_CLIENT_ID
Authorization: apikey USERNAME:API_KEY

After (Bearer key):

CLIENT-ID: YOUR_CLIENT_ID
Authorization: Bearer vrfk_YOUR_API_KEY

See Authorization header for the full format, and What is CLIENT_SECRET? If you also send request signatures.

How do we migrate without downtime?

  1. Create a Bearer key in the Keys section: full access, or scoped to the routes you call.

  2. Check it with the veryfi endpoint before switching any traffic.

  3. Update your integration to send the Bearer header. If you have a sandbox or dev environment, switch it first, then production.

  4. Confirm traffic has moved by checking the Standard key's last-used date.

  5. Revoke the Standard key once it is no longer used.

Because the key lives on your server, you decide when every request switches. There are no old app versions in the field, so the overlap can be short.

This is the same zero-downtime pattern described in Rotating a key.

Which routes should a scoped key include?

Every endpoint your integration calls, for example POST /api/v8/partner/documents or POST /api/v8/partner/checks. If you add a new document type later (for example, check processing), add that route to the key before you go live, or those calls will return 403.

Should we use one key or several?

One key per service or environment is easier to manage. You can then rotate or revoke one without touching the others.

Can each key send results to its own webhook?

Yes. A Bearer key can have its own webhook URL, which overrides the account webhook for async requests made with that key. If it is not set, the account webhook is used. See Per-key webhook URL.

Can we automate key creation and rotation?

Yes. Bearer keys can be created, updated and revoked through the partner API as well as in the Hub, so rotation can be scripted. See Manage keys with the partner API.


Migrating Lens SDK integrations to Bearer keys

For Lens, the key travels inside your mobile app, so the migration has to cover every app version your users still have installed, not just the latest release.

The safe pattern is: upgrade the SDK, give the Bearer key to new app versions, and keep the Standard key alive for older versions until they are retired. How smoothly this goes depends mostly on how your app gets its credentials, so read How should our app get the Lens credentials? before you start.

Which Lens SDK versions support Bearer keys?

Platform

Minimum SDK version for Bearer keys

Android

2.6.0.13+

iOS

3.0.11.5+

React Native, Flutter, Capacitor, .NET (Xamarin and MAUI)

2.0.58+

Cordova

2.6.58+

On earlier SDK versions, use a Standard key.

Source: Using a client-scoped API key in the Lens docs.

Do we need to change our Lens configuration code?

No. You configure the SDK the same way for both key types, and Lens detects the key type automatically.

Which scope should our Lens key have?

Create a scoped key and select the Lens SDK preset. It grants all the routes Lens uses, including the upload routes for each document type, so you do not need to pick routes yourself. A Bearer full access key also works. If you do not see the Lens SDK preset, Lens may not be enabled on your account, so contact your Veryfi representative.

If you plan to add another Lens flow later, such as check deposits, use the preset or a full access key rather than hand-picking routes, so the key keeps working when you add it.

Why do we need the old and new keys working at the same time?

Authentication is handled by the SDK version built into each release of your app. Users who have not updated your app are still running the older SDK with the old key. Until those users update, both keys must keep working.

How should our app get the Lens credentials?

We recommend serving them from your own backend after the user signs in, instead of building the key into the app. This means:

  • You can rotate keys without shipping an app update.

  • Old and new app versions can each receive the right key.

  • A leaked key can be replaced without waiting for users to update.

Hardcoding the key in the app is a no-go. It ties every installed version to that key, so every rotation becomes a forced app update, and the key can be extracted from the app binary.

Where should the app store the credentials on the device?

  • iOS: the Keychain. Keychain items are not synced to iCloud unless the app sets kSecAttrSynchronizable, so leave it off.

  • Android: EncryptedSharedPreferences.

  • Never write credentials to logs, analytics or plain-text files.

  • When a request returns 401, re-fetch the credentials from your API. The credential fetch can be re-run at any time, so the app picks up a rotated key without a new release.

How are the credentials protected on the way to the app?

When the app is installed, it generates a key pair that is kept in the Android Keystore or iOS Keychain. Only the public key is sent to the API, which uses it to encrypt the Veryfi credentials. Only the app's private key can decrypt them, so anyone intercepting the traffic cannot read them.

On iOS, SSL pinning adds another layer against man-in-the-middle attacks. Implement it carefully: a faulty setup can break the app, and you need a fallback plan for future certificate changes. See Store Veryfi Lens credentials securely.

What are the steps to move a Lens app from Standard to Bearer?

  1. Upgrade the Lens SDK in your app to a version that supports Bearer keys (table above).

  2. Create a Bearer key with the Lens SDK preset.

  3. Deliver the new key to the new app version. If your backend serves the credentials, send the Bearer key only to app versions with a supported SDK and keep sending the Standard key to older versions. If the key is built into the app, ship it in the new release.

  4. Ask or require users to update, and set a deprecation date for old app versions.

  5. Watch the Standard key's last-used date and revoke it only once usage has stopped.

Before revoking anything, read Rotating keys: do's and don'ts below and Rotating Veryfi Lens API keys in the Lens docs.

Are Lens SDK access keys the same as API keys?

No. Lens SDK access keys (the download username and password) give you access to the Lens SDKs and their repositories. They are separate from the API keys the SDK uses to call Veryfi, so changing one set does not affect the other. Lens SDK access keys are valid for 12 months. When they expire, repository access and builds that use them are blocked, but your running app keeps working. See Veryfi Lens Keys Generation.


Rotating keys: do's and don'ts

These rules apply to every key type and to both API-only and Lens setups. The one thing to remember: a new key never switches off the old one by itself, and an old key should only be revoked once nothing is using it. Sources: Rotating Veryfi Lens API keys, Rotating a key (zero downtime) and API Keys Management.

What does "rotate" mean in the Veryfi portal?

Rotating means duplicating your existing key (Standard, scoped or full access). The new key is created alongside the old one with the same type and permissions, and the old key is not revoked automatically.

Do

  • Duplicate the current key to create its replacement.

  • Keep the old key active until every app version or service that uses it has moved off it.

  • Update your app or backend to use the new key, then release it.

  • Check the old key's last-used date and revoke it only after it stops being used.

  • Plan for slow adopters: users on old app versions keep calling Veryfi with the old key until they update.

  • Give each key a clear name, such as "Lens iOS, Nov 2026".

  • Use the right key type for your SDK version: Bearer (vrfk_) keys need a recent Lens SDK, older SDKs need a Standard key.

Don't

  • Don't revoke the old key as soon as the new one exists. Old app versions still in use will start failing with 401.

  • Don't use the API's rotate action while old app versions are live. It replaces the secret and the previous value stops working immediately. Duplicate instead.

  • Don't set a short expiry on the old key. An expired key stops working just like a revoked one.

  • Don't switch key types mid-rotation (for example Standard to Bearer) without confirming every app version in the field supports the new type.

  • Don't leave old keys active forever. Once usage drops to zero, revoke them.

Troubleshooting

Symptom

Likely cause

Fix

403 This action is not allowed

Scoped key does not include the route being called

Add the route to the key. For Lens, use the Lens SDK preset or a full access key.

401 right after a rotation

Old key was revoked, expired or replaced with the rotate action while still in use

Serve the new key to that app version or service. For Lens, have the app re-fetch credentials on 401.

401 with a new Bearer key

Key sent in the apikey USERNAME:API_KEY header, or CLIENT-ID missing

Send Authorization: Bearer YOUR_API_KEY and keep CLIENT-ID.

Lens fails only on older app versions after migrating

SDK in that version is older than the Bearer minimum, or its Standard key was revoked

Keep a Standard key live for those versions until they are retired.

Lens SDK preset is not listed

Lens is not enabled on the account

Contact your Veryfi representative, or use a full access Bearer key.

For Bearer keys, 401 means the key is missing, revoked or expired, and 403 means the key is valid but not allowed on that route. Full list of error codes: Veryfi HTTP API Error Responses. To check whether an outage is on our side, see the Veryfi status page.

Sources

Veryfi docs

Veryfi FAQ

Did this answer your question?