Skip to main content
This API reference is powered by OpenAPI specs. Use the sections below to explore endpoints and interactive examples.

API Sections

Authentication

All API endpoints require authentication using OAuth 2.0 bearer tokens. To make authenticated requests:

Step 1: Obtain an access token

Use the Authentication API to obtain a bearer token via the OAuth 2.0 client credentials flow:
curl -X POST "<auth-endpoint-url>" \
  -H "Content-Type: application/json" \
  -d '{
    "grant_type": "client_credentials",
    "audience": "<audience>",
    "client_id": "<your-client-id>",
    "client_secret": "<your-client-secret>"
  }'
Contact [email protected] to receive your client_id and client_secret.

Step 2: Include the bearer token in requests

Add the access token to the Authorization header of all API requests:
Authorization: Bearer <access_token>

Step 3: Include user identification header

Most endpoints require an additional header to identify the user whose data you’re accessing. The header name varies by API:
  • x-user-id
The following APIs use the x-user-id header:
  • Investment Orders API - Submit and manage investment orders
  • Portfolios API - Access portfolio holdings and returns
  • Cash API - Retrieve user cash balances
  • Investment Products API (some endpoints) - Asset-specific data with user context
x-user-id: <user-identifier>
The user identifier must match a valid user in the Wealthyhood platform. See the Users API for user creation. Always check the specific endpoint documentation for the exact header requirement.

Complete request example

curl -X GET "https://api.sandbox.wealthyhood.com/cash" \
  -H "Authorization: Bearer eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9..." \
  -H "x-user-id: user-12345"