API Documentation - Developer Integration Guide
Complete REST API documentation for integrating with CDAO Platform programmatically
API Documentation - Developer Integration Guide
Welcome to the CDAO Platform API documentation. Our RESTful API provides programmatic access to investment opportunities, user management, KYC verification, escrow operations, and investment groups. Build powerful integrations with our comprehensive API suite.
π API Capabilities
- β Investment Management: Create, update, and track investments
- β User & KYC Operations: Manage user accounts and verification
- β Deal Management: CRUD operations for investment opportunities
- β Investment Groups: Create and manage exclusive investor communities
- β Escrow System: Secure fund management and compliance
- β Analytics & Reporting: Access platform metrics and insights
π Authentication & Authorization
API Authentication Methods
π Security-First Approach
CDAO Platform API uses multiple authentication methods:
Most API endpoints use JWT tokens obtained via login or OAuth flow.
For server-to-server integrations and webhooks.
Authentication Pattern Implementation
βοΈ Standard Authentication Pattern
All protected endpoints follow this pattern:
Key Points:
- Use - NOT
- The auth result contains directly
- Always check if result is NextResponse (auth failure)
- userId is a string - Convert to number if needed
ποΈ API Architecture
Base URL & Versioning
π Endpoint Structure
- Base URL:
- API Version: Included in URL path ()
- Environment: Separate URLs for staging and production
- Rate Limiting: 1000 requests per hour per API key
Request & Response Format
π Standard Format
Request Headers:
Response Format:
π€ User Management API
User Endpoints
π₯ User Operations
KYC Verification Endpoints
π Verification API
- GET /api/kyc/status - Get verification status
- POST /api/kyc/initiate - Start KYC process
- POST /api/kyc/documents - Upload verification documents
- PUT /api/kyc/personal-info - Update personal information
- GET /api/kyc/requirements - Get verification requirements
πΌ Investment Management API
Investment Operations
π° Investment Endpoints
Investment Groups API
π₯ Group Management
Public Group Discovery:
- GET /api/groups - Public group discovery (excludes user's own groups)
- GET /api/groups/my-groups - Groups where user is a member
- GET /api/groups/applications - User's group applications
- GET /api/groups/{id} - Public group details
- POST /api/groups/{id}/apply - Submit group application
- GET /api/groups/{id}/dashboard - Member-only dashboard
Issuer Group Management:
- GET /api/issuer/groups - Issuer's groups (max 1)
- POST /api/issuer/groups - Create new group (blocked if exists)
- PUT /api/issuer/groups/{id} - Update group settings
- GET /api/issuer/groups/{id}/manage - Group management dashboard
- POST /api/issuer/groups/{id}/deals - Add deals to group
- GET /api/issuer/groups/{id}/applications - Review applications
π’ Deal Management API
Deal CRUD Operations
π Deal Endpoints
Deal Visibility Logic
π Member-Exclusive Access
Important: Group deals are member-exclusive
π Escrow System API
Escrow Management
π¦ Escrow Operations
- POST /api/escrow/create - Create escrow contract
- POST /api/escrow/{id}/fund - Fund escrow contract
- POST /api/escrow/{id}/approve - Approve and release funds
- POST /api/escrow/{id}/refund - Initiate refund
- GET /api/escrow/{id}/status - Get escrow status
- GET /api/escrow - List user's escrows
Escrow Status Response:
π Analytics & Reporting API
Platform Analytics
π Insights & Metrics
- GET /api/analytics/dashboard - User dashboard metrics
- GET /api/analytics/investments - Investment performance
- GET /api/analytics/deals - Deal statistics
- GET /api/analytics/groups - Group performance metrics
- GET /api/analytics/platform - Platform-wide statistics
Example Dashboard Response:
β‘ Webhooks
Event Notifications
π Real-time Events
Supported Event Types:
- investment.created - New investment made
- investment.completed - Investment completed
- kyc.status_changed - KYC verification status update
- escrow.funded - Escrow contract funded
- escrow.released - Escrow funds released
- group.application_received - New group application
- deal.funding_completed - Deal funding target reached
Webhook Configuration:
- POST /api/webhooks - Create webhook endpoint
- GET /api/webhooks - List configured webhooks
- PUT /api/webhooks/{id} - Update webhook
- DELETE /api/webhooks/{id} - Delete webhook
Webhook Payload Format
β Error Handling
Standard Error Responses
π¨ Error Format
Common HTTP Status Codes:
- 400 - Bad Request (validation errors)
- 401 - Unauthorized (authentication required)
- 403 - Forbidden (insufficient permissions)
- 404 - Not Found (resource doesn't exist)
- 429 - Too Many Requests (rate limiting)
- 500 - Internal Server Error
π§ SDKs & Client Libraries
Official SDKs
π¦ Available Libraries
Quick Start Example
π§ͺ Testing & Sandbox
Development Environment
π¬ Sandbox Features
- Test API Keys: Separate keys for development
- Mock Data: Realistic test data for development
- Webhook Testing: Test webhook delivery and handling
- Rate Limit Testing: Test rate limiting behavior
- Error Simulation: Simulate various error conditions
π Additional Resources
Developer Resources
- OpenAPI Specification: Download complete API spec
- Postman Collection: Ready-to-use API collection
- Code Examples: Working examples in multiple languages
- Integration Guides: Step-by-step integration tutorials
- Best Practices: Recommended patterns and practices
π API Support
π Developer Support
Need help with API integration?
- API Support: api@support@cdao.vc
- Developer Relations: developers@support@cdao.vc
- Technical Documentation: http://companydao.org/support/api
- Developer Community: Discord channel for developers
- GitHub Issues: Report bugs and request features
π Ready to Build?
The CDAO Platform API provides everything you need to build powerful investment applications. From user management to complex escrow operations, our comprehensive API suite supports all your integration needs.
Get your API keys and start building today!
π― Next Steps
- π Get API Keys for development and production
- π Follow Quick Start Guide
- π§ͺ Explore Sandbox Environment
- π¦ Download Official SDKs
- π¬ Join Developer Community