REST Endpoints
Full reference for the Bithaven REST API. All endpoints are prefixed with /api/v1.
Auth
/api/v1/authAuth: None (public)
| Method | Path | Description |
|---|---|---|
| POST | /signup | Create account. Returns user + JWT. |
| POST | /login | Authenticate. Returns user + JWT. |
| POST | /logout | Invalidate JWT session. |
| GET | /me | Get current user. |
Master Wallet
/api/v1/walletAuth: JWT
| Method | Path | Description |
|---|---|---|
| GET | / | Get master wallet (address, balance). |
| GET | /balance | Get balance only. |
| GET | /deposits | Paginated deposit history. Query: page, limit. |
Agent Wallets
/api/v1/agent-walletsAuth: JWT
| Method | Path | Description |
|---|---|---|
| POST | / | Create agent wallet. Body: { "label": "My Agent" } |
| GET | / | List all agent wallets for user. |
| GET | /:id | Get single agent wallet. |
| PATCH | /:id | Update label. Body: { "label": "New Name" } |
| POST | /:id/fund | Transfer from master. Body: { "amount": "50.00" } |
| POST | /:id/withdraw | Transfer to master. Body: { "amount": "25.00" } |
| POST | /:id/freeze | Freeze wallet. Blocks all agent transactions. |
| POST | /:id/unfreeze | Unfreeze wallet. |
API Keys
/api/v1/agent-wallets/:walletId/keysAuth: JWT
| Method | Path | Description |
|---|---|---|
| POST | / | Create API key. Body: { "label": "prod-key", "scopes": ["read","write"] } |
| GET | / | List keys for wallet (prefix + metadata only). |
| POST | /:keyId/revoke | Revoke a key immediately. |
Policies
/api/v1/agent-wallets/:walletId/policiesAuth: JWT
| Method | Path | Description |
|---|---|---|
| POST | / | Create policy. Body: { "type": "spend_cap_daily", "params": { "limit": "50.00" } } |
| GET | / | List policies for wallet. |
| PATCH | /policies/:id | Update policy params or active status. |
| DELETE | /policies/:id | Delete policy. |
Transactions
/api/v1/agent-wallets/:walletId/transactionsAuth: JWT
| Method | Path | Description |
|---|---|---|
| GET | / | List transactions for wallet. |
| GET | /pending | List transactions awaiting approval. |
| POST | /transactions/:id/approve | Approve a pending transaction. |
| POST | /transactions/:id/reject | Reject. Body: { "reason": "..." } |
Notifications
/api/v1/notificationsAuth: JWT
| Method | Path | Description |
|---|---|---|
| GET | /preferences | Get notification preferences. |
| PATCH | /preferences | Update notification preferences. |
Dashboard
/api/v1/dashboardAuth: JWT
| Method | Path | Description |
|---|---|---|
| GET | /stats | Overview stats (total balance, agents, pending txs). |
| GET | /activity | Unified activity feed. Query: page, limit, type. |
Waitlist
/api/v1/waitlistAuth: None
| Method | Path | Description |
|---|---|---|
| POST | / | Join waitlist. Body: { "email": "..." } |