Manage your Africa Railways API credentials
Security Warning: These API keys are sensitive credentials. Never share them publicly, commit them to git, or expose them in client-side code.
Generate a new set of API keys for your application. Old keys will remain active for 7 days after generating new ones.
Keys are generated securely and encrypted
You haven't generated any API keys yet.
Click "Generate New API Keys" above to create your first keys.
Add your API keys to these locations:
Settings → Secrets → ActionsRAILWAYS_API_KEY with your key valueAFRICOIN_API_KEY with your key valuegh secret list --repo mpolobe/africa-railways
Settings → Environment Variables# Test Railways API key
curl -H "Authorization: Bearer YOUR_RAILWAYS_KEY" \
https://africarailways.com/api/health
# Test Africoin API key
curl -H "Authorization: Bearer YOUR_AFRICOIN_KEY" \
https://africarailways.com/api/health
Valid keys return 200 OK. Invalid keys return 401 Unauthorized.
| ✅ Do | ❌ Don't |
|---|---|
| Keep keys in environment variables | Commit keys to git |
| Rotate keys every 90 days | Share keys publicly |
| Use HTTPS only | Log keys in backend |
| Monitor API usage | Hardcode keys in source |