I Am Alive API

API reference and test bench

Endpoints marked 🔒 take an encrypted payload. The reference below documents the real model inside the payload, not { "payload": "" }, and Try it out encrypts it for you. Tokens returned by VerifyOtp and admin-verify-2fa are applied to Authorize automatically. Endpoints with an Organisations note can also be called with an organisation's API key.

How an encrypted request is built

  1. Serialise the model to JSON.
  2. Encrypt that text with AES-CBC and PKCS7 padding, using the UTF-8 bytes of the server's AES_KEY and AES_IV.
  3. Base64 the ciphertext and send { "payload": "<base64>" }.

That's how the I Am Alive apps encrypt. Organisations use their own key, below. Responses are plain JSON.

Retiree verification flow

  1. POST /api/Retirees/requestOtp sends the OTP for a pension ID.
  2. POST /api/Retirees/VerifyOtp returns the bearer token.
  3. GET /api/Retirees/contact-details returns the address and next of kin to review.
  4. POST /api/Retirees/Update saves changes. Blank fields keep what's on record.
  5. POST /api/Retirees/Validate runs the selfie and BVN/NIN check.

Validate answers a check that ran with responseCode "0" (face matched) or "-11" (it didn't), each with a reference number. A failed check can be repeated with the same token, up to the limit of failed checks for the verification period.

Organisation API

Calling as an organisation

  1. Send the organisation's API key in X-Api-Key on requestOtp, VerifyOtp and Validate. Validate also needs the retiree token from VerifyOtp.
  2. Encrypt each payload with the organisation's Encryption Key: AES-256-CBC with PKCS7 padding, using the SHA-256 hash of the key as the AES key.
  3. Send base64 of a random 16-byte IV followed by the ciphertext as payload.

Only the organisation's own pensioners can be reached. Calls are charged to the organisation's wallet, and verification results also go to its webhook. The overview at the top of the reference below lists the billed services and webhook events.

Testing as an organisation

  1. Click Authorize and enter the API key under ApiKey.
  2. Enter the organisation's Encryption Key in the Encryption panel below.
  3. Use Try it out on requestOtp, VerifyOtp, then Validate. Requests that carry the API key are encrypted with the organisation's key.

In the I Am Alive admin portal, the organisation's Manager generates the keys under API Access and sets the webhook under Webhooks. The wallet balance, transactions and prices are under Wallet & Billing.

Encryption

Encrypt and decrypt with

The Encryption Key never leaves this browser. Requests sent with an API key are always encrypted with it.