API Endpoints

Complete reference for all ILAL API endpoints.

Base URL
https://ilalapi-production.up.railway.app/api/v1
Authorization: Bearer TOKENX-API-Key: YOUR_KEY

Health

GET/healthNo Auth

Service health check — database connectivity status.

Response
{ status: "ok", database: "connected" }

Authentication

POST/auth/registerNo Auth

Register a new user account.

Request Body
emailstring
passwordstring (min 8 chars)
namestring (optional)
Response
{ user, accessToken, refreshToken }
POST/auth/loginNo Auth

Login with email and password.

Request Body
emailstring
passwordstring
Response
{ user, accessToken, refreshToken }
POST/auth/refreshNo Auth

Refresh an expired access token.

Request Body
refreshTokenstring
Response
{ accessToken: string }
GET/auth/meJWT Required

Get the currently authenticated user profile.

Response
{ user: { id, email, name, plan, walletAddress } }

API Key Management

GET/apikeysJWT Required

List all your API keys (hashed for security).

Response
{ apiKeys: [...], limits: { maxApiKeys, remaining } }
POST/apikeysJWT Required

Create a new API key. The raw key is only shown once — store it immediately.

Request Body
namestring
permissionsstring[] (optional)
rateLimitnumber (optional)
Response
{ apiKey: "ilal_live_...", keyPrefix, id }
PATCH/apikeys/:idJWT Required

Update an API key name or rate limit.

Request Body
namestring (optional)
rateLimitnumber (optional)
Response
{ success: true, key: {...} }
DELETE/apikeys/:idJWT Required

Revoke and permanently delete an API key.

Response
{ success: true }

DeFi — Transaction Builder

POST/defi/swapAPI Key (X-API-Key)

Build an unsigned Uniswap V4 swap transaction. Returns calldata for the caller to sign and broadcast with their own wallet.

Request Body
tokenInaddress — token to sell
tokenOutaddress — token to buy
amountstring — amount in wei (exact input)
zeroForOneboolean — true if tokenIn < tokenOut by address
userAddressaddress — caller's wallet address (for ComplianceHook)
Response
{ success, transaction: { to, data, value, chainId, gas }, instructions, params }
POST/defi/liquidityAPI Key (X-API-Key)

Build an unsigned Uniswap V4 liquidity mint transaction. Returns calldata for the caller to sign and broadcast.

Request Body
token0address (must be < token1)
token1address (must be > token0)
amount0string — liquidity amount (uint128)
amount1string — secondary amount (informational)
tickLowernumber — optional, default -600
tickUppernumber — optional, default 600
userAddressaddress — caller's wallet address
Response
{ success, transaction: { to, data, value, chainId, gas }, instructions, params }

Usage & Billing

GET/usage/statsJWT or API Key

Get API usage statistics for the current period.

Response
{ totalCalls, successRate, callsThisMonth, limit }
GET/billing/plansNo Auth

List available subscription plans and their limits.

Response
{ plans: [{ id, name, price, features }] }

HTTP Status Codes

200 OK
Request succeeded
201 Created
Resource created successfully
400 Bad Request
Invalid or missing parameters
401 Unauthorized
Missing or invalid API key / JWT
403 Forbidden
Insufficient permissions or plan limit
404 Not Found
Resource does not exist
429 Too Many Requests
Rate limit exceeded
500 Internal Server Error
Unexpected server error