WealthGuard API

Access personal finance data, investment portfolios, and transaction history programmatically. Our RESTful API is designed for developers building financial applications, dashboards, and automation tools.

Base URL: https://api.wealthguard.com/v1
All requests must be made over HTTPS. Calls made over plain HTTP will fail. API requests without authentication will also fail.

Authentication

WealthGuard uses Bearer Token authentication. Include your API key in the Authorization header of every request.

bash
curl https://api.wealthguard.com/v1/users/me \
  -H "Authorization: Bearer wg_live_sk_your_api_key_here" \
  -H "Content-Type: application/json"

Generate your API keys in the Developer Dashboard. Keep your secret keys secure. Never expose them in client-side code or public repositories.

Rate Limiting

To ensure platform stability, API requests are limited based on your plan:

PlanRequests / MinuteRequests / Day
Starter605,000
Professional30050,000
Elite1,000Unlimited

Rate limit headers are included in every response:

headers
X-RateLimit-Limit: 300
X-RateLimit-Remaining: 287
X-RateLimit-Reset: 1718456320

Core Endpoints

GET /users/me

Retrieves the authenticated user's profile and account settings.

Response (200 OK)
{
  "id": "usr_9f8a7b6c5d4e",
  "name": "Alex Morgan",
  "email": "alex@example.com",
  "tier": "professional",
  "created_at": "2024-01-15T08:30:00Z",
  "settings": {
    "currency": "USD",
    "timezone": "America/New_York"
  }
}
GET /accounts

Lists all linked financial accounts with balances and metadata.

Response (200 OK)
{
  "data": [
    {
      "id": "acc_123",
      "type": "checking",
      "institution": "Chase Bank",
      "mask": "•••• 4829",
      "balance": 12450.50,
      "currency": "USD",
      "updated_at": "2024-06-15T10:00:00Z"
    }
  ]
}
POST /transactions

Records a new financial transaction or syncs batch data.

ParameterTypeDescription
account_idRequiredstringTarget account identifier
amountRequirednumberTransaction amount (negative for expenses)
categorystringOptional categorization tag
datestringISO 8601 date of transaction
Request Body
{
  "account_id": "acc_123",
  "amount": -145.20,
  "category": "groceries",
  "date": "2024-06-14"
}
GET /portfolio

Returns current investment holdings, performance metrics, and asset allocation.

Response (200 OK)
{
  "total_value": 284592.40,
  "total_gain": 34592.40,
  "gain_percentage": 13.84,
  "holdings": [
    {
      "symbol": "VTI",
      "name": "Vanguard Total Stock Market ETF",
      "shares": 45.2,
      "current_price": 245.80,
      "value": 11110.16,
      "allocation": 39.04
    }
  ]
}
POST /reports/cashflow

Generates a cash flow analysis report for a specified period.

Request Body
{
  "start_date": "2024-01-01",
  "end_date": "2024-06-30",
  "group_by": "category",
  "format": "json"
}

Webhooks

Receive real-time notifications for account updates, large transactions, and portfolio milestones. Configure endpoints in your dashboard.

Security: All webhook payloads are signed using HMAC-SHA256. Verify the X-WG-Signature header before processing.
Event: transaction.created
{
  "id": "evt_8f7g6h5j",
  "type": "transaction.created",
  "timestamp": "2024-06-15T14:22:00Z",
  "data": {
    "transaction_id": "txn_abc123",
    "account_id": "acc_123",
    "amount": -89.50,
    "merchant": "Whole Foods Market"
  }
}

Error Handling

WealthGuard uses conventional HTTP response codes to indicate success or failure. Codes in the 2xx range indicate success. Codes in the 4xx range indicate client errors. Codes in the 5xx range indicate server errors.

CodeMeaningDescription
400Bad RequestInvalid syntax or missing parameters
401UnauthorizedMissing or invalid API key
403ForbiddenInsufficient permissions for resource
404Not FoundResource does not exist
429Too Many RequestsRate limit exceeded
500Server ErrorInternal processing failure

Error responses follow a consistent JSON format:

Error Response
{
  "error": {
    "code": "INVALID_API_KEY",
    "message": "The provided API key is expired or revoked.",
    "request_id": "req_8f7g6h5j4k3l",
    "documentation_url": "https://docs.wealthguard.com/errors#invalid_api_key"
  }
}

API Support

Need help integrating? Our developer support team is available Mon-Fri, 9am-6pm EST.