List All Assets
const url = 'https://indepai.app/api/v1/assets?summary=false&type=stock&sort=value&order=asc';const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request GET \ --url 'https://indepai.app/api/v1/assets?summary=false&type=stock&sort=value&order=asc' \ --header 'Authorization: Bearer <token>'Get all assets in the authenticated user’s portfolio
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Query Parameters
Section titled “Query Parameters”Responses
Section titled “Responses”List of assets
object
object
Asset ID
Owner user ID
Owning portfolio ID
Type of financial asset
Willingness to sell this asset to fund living costs
How the bond’s coupon rate is determined after year 1
How bond interest is capitalized or paid out
object
Timestamp in ISO 8601 format
Unique identifier (UUID v4)
Timestamp in ISO 8601 format
Timestamp in ISO 8601 format
Timestamp in ISO 8601 format
Included when summary=true
object
Total portfolio value in original currencies
Total portfolio value in EUR
Total cost basis
Total profit/loss
Total profit/loss percentage
Number of assets in portfolio
Diversification score (0-100)
object
Timestamp in ISO 8601 format
Example
{ "success": true, "data": [ { "id": "550e8400-e29b-41d4-a716-446655440000", "userId": "550e8400-e29b-41d4-a716-446655440000", "portfolioId": "550e8400-e29b-41d4-a716-446655440000", "assetType": "stock", "mortgageType": "fixed", "sellWillingnessTier": "gladly_sell", "bondRateType": "fixed", "bondCapitalization": "annual_compound", "marketQuote": { "asOf": "2024-01-15T10:30:00Z", "status": "fresh" }, "categoryId": "550e8400-e29b-41d4-a716-446655440000", "lastUpdated": "2024-01-15T10:30:00Z", "createdAt": "2024-01-15T10:30:00Z", "updatedAt": "2024-01-15T10:30:00Z" } ], "summary": { "totalValue": 135000, "totalValueEur": 135000, "totalCost": 100000, "totalProfitLoss": 35000, "totalProfitLossPercent": 35, "assetCount": 5, "diversificationScore": 75 }, "meta": { "timestamp": "2024-01-15T10:30:00Z" }}Unauthorized
object
Always false for error responses
Error type
Machine-readable error code
Detailed validation errors
object
Path to the invalid field
Error message
Example
{ "success": false, "error": "Validation error", "code": "VALIDATION_ERROR", "details": [ { "path": "currentAge", "message": "Must be between 18 and 100" } ]}