Skip to main content
Your partner portal’s Administrators create your API keys. Each works in one environment, does only what its scopes allow and, in live, works only from the addresses you register.

API keys

After the prefix, a key has 43 characters generated from 32 random bytes. Send it in the Authorization header as Bearer and the key. A key sent to the wrong environment’s host returns 401 unauthorized, with a message that says so.

How keys are created

An Administrator creates keys on the API keys page of your partner portal, choosing the key’s scopes and, for a live key, the IP addresses it works from. A key works in the environment you create it in, sandbox or live. The portal asks the Administrator to verify their identity again before it creates or rotates a key. No API creates a key. The portal shows the key once. We store only a hash of it, so neither the portal nor we can show it again or recover it. If you lose a key, create a new one and revoke the old one. Keep keys on your servers, in a secrets manager, and never in an app or web page your customers download. The portal creates a key, or rotates one with an overlap, only while your company holds fewer than 10 working keys. Revoked and expired keys don’t count. A rotation with no overlap adds no key, so it’s never refused for this. If no one at your company can sign in to the partner portal, ask us for a key. We send it once, through a one-time link to your technical contact. A key works until it’s revoked, or until the overlap after a rotation ends.

Scopes

A key can do what its scopes allow. Choose them when you create the key. Give each of your services a key with only the scopes it needs: a reporting service needs read alone. A key that tries something outside its scopes gets 403 insufficient_scope, naming the scope it lacks, and nothing is done. We record when each key was last used, to the minute, so we can tell you whether a key is still in use before we retire it.

Rotate a key

Rotate a key in your partner portal. The new key has the same IP addresses and scopes, and the portal shows it once. The old key keeps working for an overlap you choose, up to 7 days, then expires.
  1. Rotate the key, with an overlap long enough to switch your servers.
  2. Switch your servers to the new key within the overlap.
  3. Revoke the old key once you’ve switched, or let it expire.
An expired key returns 401 unauthorized, the same response as a revoked or unknown key. With no overlap, the old key stops as the new one starts.

Revoke a key

Revoke a key in your partner portal; it stops working on its next request. If a key leaks, revoke it at once: in the portal, or yourself with POST /v1/keys/revoke, sending the key in the Authorization header. Any key can revoke itself, whatever its scopes, from any address, even one a live key isn’t registered for. Then create a new key. Don’t rotate a leaked key: rotation keeps it working through the overlap. See If a key leaks. Hold a second live key in reserve, for the same addresses and scopes, so revoking one never stops your trading.

Live keys and IP addresses

A live key works only from the addresses registered with it: each address or range your servers send requests from, given when the key is created and fixed then. New addresses mean a new key: create one with them, switch your servers to it, then revoke the old one. Each entry is a single address, such as 203.0.113.10, or a range, such as 203.0.113.0/29: both documentation addresses, which a live key refuses, so use your servers’ own. We read the address from the connection itself, never from a header such as X-Forwarded-For. A request from an address that isn’t registered returns 401 unauthorized, the same response as an invalid key, so it never confirms to someone holding a stolen key that the key is valid. If your live requests start failing with 401, check whether your servers’ outbound addresses have changed.

Connections

The API is served over HTTPS with TLS 1.2 or later. Over TLS 1.2 we negotiate only these cipher suites: A host negotiates the three that match its certificate’s key, ECDSA or RSA. The sandbox’s certificate is ECDSA. If your client limits its cipher suites, allow all six, so a new certificate never stops your connection. The sandbox is HTTPS only, like live: a request to http:// and the host gets no response and times out. Our responses carry these headers:

Your customers’ data

When you apply for an account, we hold your customer’s identity details and four documents only while we open the account: each sealed under a key kept apart from our data, in a file we never back up. We erase them once the account opens or the application ends. If we haven’t asked the depository to open the account within 7 days of when you sent the application, or the application becomes uncertain before we have, we erase them then. We send them only where opening the account needs them: the BVN, the NIN and the bank account to the identity registries and the customer’s bank, the customer’s details to the depository (CSCS), and the details and documents to the broker. For an application we keep only:
  • its state, the reason for it, and the field at fault if one was named,
  • our reference for the account at the broker,
  • the account number, once the account opens,
  • your client_reference and Idempotency-Key,
  • a keyed hash of the application, so we can tell a retry from a different application, and a keyed hash of the BVN, so each person has one account, and for 24 hours after the identity checks reject it, so we can count rejected checks. The key for these hashes isn’t stored with our data,
  • for each document you send, its type, its size, whether it’s a JPEG or a PNG, whether we hold it, and a keyed hash of the file, so we can tell the same file sent again.
We never log a customer’s name, date of birth, BVN, NIN, phone number, email address, home address, next of kin or bank details, and we keep none of them once the application ends. An error names the field at fault in param and never repeats its value. Balances, positions, trades and contract notes are read from the broker each time you ask, and we don’t store them. We do store your orders, allocations and wallet ledger, and a record of each message we exchange with the broker about them. These carry account codes but no names. We also store your payout account’s bank details, which your partner portal shows by their last four digits, and a note of each call we made to confirm them: whom we called, on which number, and when. Our logs record the route a request used, not its path, so account codes in a path aren’t logged.

Webhooks

Every event we send is signed. Verify each one before you act on it. See Webhooks.