API ReferenceAuthentication

Authentication

The Prembly API authenticates requests with an API key, sent in the X-API-Key header. There is no username, password, or token exchange.

curl https://api.prembly.com/api/v1/verification/api/bvn/ \
  -H "X-API-Key: live_sk_..." \
  -H "Content-Type: application/json" \
  -d '{ "number": "54651333604" }'

Your keys

Find your keys in the dashboard under Integrations & API. Every organisation has four:

KeyPrefixUse it for
Live secret keylive_sk_Server-side calls to this API, with real data and billing
Sandbox secret keytest_sk_Server-side calls while you build. Free, with sample data
Live public keylive_pk_Starting the web and mobile SDKs in production
Sandbox public keytest_pk_Starting the SDKs while you build

Only a secret key works in the X-API-Key header. Public keys are for the SDKs and are rejected by this API.

A secret key has full access to your organisation's verifications and wallet. Keep it on your server. Never put it in a browser, a mobile app, or a repository.

When a request is rejected

HTTP statusMessageWhat to do
401Authentication credentials were not providedAdd the X-API-Key header
401Invalid API key or inactive organisationCheck you copied the whole secret key
403Invalid API key or inactive organisationYour organisation has been deactivated. Contact support
403Your account is not verified…Live keys need a verified organisation. Use your sandbox key until verification is complete
403Access denied. IP address … is not whitelistedCall from a whitelisted IP, or add this one in the dashboard

IP whitelisting

You can limit your keys to a list of server IP addresses from the dashboard. Once the list has at least one active entry, requests from any other address get a 403, even with a valid key. With no entries, every address is allowed.

On this page

Prembly Slack Community

Join our developer Slack channel for real-time integration support, engineering updates, and direct Q&A with the Prembly team.

Join Slack Channel