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:
| Key | Prefix | Use it for |
|---|---|---|
| Live secret key | live_sk_ | Server-side calls to this API, with real data and billing |
| Sandbox secret key | test_sk_ | Server-side calls while you build. Free, with sample data |
| Live public key | live_pk_ | Starting the web and mobile SDKs in production |
| Sandbox public key | test_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 status | Message | What to do |
|---|---|---|
401 | Authentication credentials were not provided | Add the X-API-Key header |
401 | Invalid API key or inactive organisation | Check you copied the whole secret key |
403 | Invalid API key or inactive organisation | Your organisation has been deactivated. Contact support |
403 | Your account is not verified… | Live keys need a verified organisation. Use your sandbox key until verification is complete |
403 | Access denied. IP address … is not whitelisted | Call 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.