API Reference
Complete REST API documentation for AGI-CAD Portfolio
https://www.agi-hive.com/api/v1Authentication
Most API endpoints require authentication. Include your Firebase ID token in the Authorization header:
Portfolio
Endpoints for managing and retrieving portfolio data
/api/portfolio🔒 Auth RequiredGet current portfolio holdings and total value
Response
Portfolio object with holdings array and total value
Alerts
Endpoints for creating and managing price alerts
/api/alerts🔒 Auth RequiredCreate a new price alert
Request Body
| Field | Type | Required | Description |
|---|---|---|---|
symbol | string | Yes | Cryptocurrency symbol (e.g., BTC) |
targetPrice | number | Yes | Target price in USD |
direction | string | Yes | Alert direction: "above" or "below" |
notifyVia | string[] | Yes | Notification channels |
Response
Created alert object
/api/alerts🔒 Auth RequiredList all price alerts
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
status | string | No | Filter by status: "active", "triggered", "expired" |
Response
Array of alert objects
/api/alerts/:id🔒 Auth RequiredDelete a price alert
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
id | string | Yes | Alert ID |
Response
Success message
Prices
Endpoints for retrieving cryptocurrency price data
/api/prices/:symbolGet current price for a cryptocurrency
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
symbol | string | Yes | Cryptocurrency symbol |
Response
Price data object
Exchanges
Endpoints for connecting and managing exchange integrations
/api/exchanges/connect🔒 Auth RequiredConnect an exchange account
Request Body
| Field | Type | Required | Description |
|---|---|---|---|
exchange | string | Yes | Exchange name (coinbase, binance, etc.) |
apiKey | string | Yes | Exchange API key |
apiSecret | string | Yes | Exchange API secret |
Response
Connection status
Rate Limits
Rate limit headers are included in all responses:X-RateLimit-Limit,X-RateLimit-Remaining
Error Codes
| Code | Message | Description |
|---|---|---|
200 | OK | Request successful |
400 | Bad Request | Invalid request parameters |
401 | Unauthorized | Missing or invalid auth token |
403 | Forbidden | Insufficient permissions for resource |
404 | Not Found | Resource does not exist |
429 | Too Many Requests | Rate limit exceeded |
500 | Internal Server Error | Server error occurred |