DEVELOPER REFERENCE V1.0

EFGAIHUB REST API

Build mobile apps, trading bots, dashboards or integrations on top of the EFGAIHUB platform. Every endpoint returns JSON.

๐ŸŒ Base URL

All endpoints below are relative to:

https://efgaihub.com/api/v1

๐Ÿ” Authentication

Most endpoints require a Bearer token. Generate keys from your API Access page after signing in.

Send your public key via either:

Authorization: Bearer efg_pk_xxxxxxxxxxxxxxxx
# or as a header
X-API-Key: efg_pk_xxxxxxxxxxxxxxxx
# or as a query param (less safe)
?api_key=efg_pk_xxxxxxxxxxxxxxxx

โš ๏ธ Never share your secret_key publicly. The secret is shown only once on creation; we cannot recover it.

๐Ÿ›ฃ๏ธ Endpoint Reference

Auth column legend: PUBLIC ยท USER ยท ADMIN

GET PUBLIC /health Service status & version. Useful for uptime checks.
GET PUBLIC /plans List all investment plans available on the platform.
GET USER /me Authenticated user profile, balance, KYC and trust score.
GET USER /balance Current wallet balance (โ‚ฆ) and currency code.
GET USER /transactions?limit=25 Recent wallet entries (credits & debits). limit defaults to 25, max 100.
GET USER /p2p/requests Your last 50 P2P deposit / withdrawal requests with status.
GET USER /referrals Up to 100 of your direct referred users (emails masked).
GET USER /tasks Active tasks you have not yet submitted.
GET USER /notifications Your last 50 notifications.
POST USER /withdraw Submit a withdrawal request. Body: { "amount": number }. Requires a bank account on file. Minimum amount 10.
GET ADMIN /admin/stats Admin-only: platform totals (users, liquidity, pending volumes, tickets).
GET ADMIN /admin/users?limit=50 Admin-only: paginated user listing with balances.

๐Ÿ“ฆ Examples

Health check (no auth):

curl https://efgaihub.com/api/v1/health

Get your account info:

curl -H "Authorization: Bearer efg_pk_xxxxxxxxxx" \
  https://efgaihub.com/api/v1/me

Recent transactions:

curl -H "Authorization: Bearer efg_pk_xxxxxxxxxx" \
  https://efgaihub.com/api/v1/transactions?limit=10

Submit a withdrawal:

curl -X POST -H "Authorization: Bearer efg_pk_xxxxxxxxxx" \
  -H "Content-Type: application/json" \
  -d '{"amount": 250}' \
  https://efgaihub.com/api/v1/withdraw

๐Ÿ“ Response Schema

Every response is JSON. Successful responses carry ok: true; errors carry ok: false plus a human error and short code.

Success:

{
  "ok": true,
  "data": {
    "wallet_balance": 5748.56,
    "currency": "โ‚ฆ"
  }
}

Error:

{
  "ok": false,
  "error": "Insufficient balance.",
  "code": "insufficient_funds"
}

โฑ๏ธ Rate Limits

Authenticated requests: 60 per minute per API key.
Public endpoints: 120 per minute per IP.

Over-limit responses return HTTP 429 with a Retry-After header. All requests are logged for security auditing.