This document provides API documentation for the One Universal Identity (OUI) system. Note: The current implementation uses mock services for development and testing. Many endpoints return simulated data and are not connected to live blockchain networks.
⚠️ Development Status: This API is in active development. Endpoints marked as "Mock Implementation" return simulated data. See Development Roadmap for production readiness timeline.
Development: http://localhost:3001/api
Staging: https://api-staging.oui.com/v1 (Planned)
Production: https://api.oui.com/v1 (Planned)
| Endpoint Category | Status | Notes |
|---|---|---|
| Identity Management | ✅ Working | Core endpoints fully implemented with comprehensive testing |
| DAO Governance | ✅ Mock | Framework ready, uses simulated data with full API structure |
| Asset Watermarking | ✅ Mock | Framework ready, uses simulated data with complete endpoints |
| AI Threat Detection | ✅ Mock | Framework ready, uses simulated analysis with realistic responses |
| Analytics & Monitoring | ✅ Mock | Framework ready, uses simulated data with dashboard endpoints |
| Cross-Chain Operations | ✅ Mock | Framework ready, uses simulated data with bridge simulation |
Note: All endpoints are fully functional with realistic test data. Mock implementations provide complete API structure for development and testing. The system is ready for integration with real services.
All API requests require authentication using JWT tokens or API keys.
Authorization: Bearer <jwt_token>
X-API-Key: <api_key>
Content-Type: application/json✅ Fully Implemented: These endpoints are functional with comprehensive testing, error handling, and realistic data responses.
Register a new universal identity for a user.
POST /identity/registerRequest Body:
{
"did": "did:ethr:0x742d35Cc6634C0532925a3b844Bc454e4438f44e",
"owner": "0x742d35Cc6634C0532925a3b844Bc454e4438f44e",
"signature": "0x...",
"metadata": {
"name": "John Doe",
"email": "john@example.com"
}
}Response (200 OK):
{
"success": true,
"identity": {
"did": "did:ethr:0x742d35Cc6634C0532925a3b844Bc454e4438f44e",
"owner": "0x742d35Cc6634C0532925a3b844Bc454e4438f44e",
"status": "active",
"createdAt": "2024-01-15T10:30:00Z",
"updatedAt": "2024-01-15T10:30:00Z"
},
"message": "Identity registered successfully"
}Retrieve identity information by DID.
GET /identity/{did}Response (200 OK):
{
"did": "did:ethr:0x742d35Cc6634C0532925a3b844Bc454e4438f44e",
"identity": {
"owner": "0x742d35Cc6634C0532925a3b844Bc454e4438f44e",
"status": "active",
"createdAt": "2024-01-15T10:30:00Z",
"uvts": ["0xabc123...", "0xdef456..."]
},
"retrievedAt": "2024-01-15T10:35:00Z"
}Update existing identity information.
PUT /identity/updateRequest Body:
{
"did": "did:ethr:0x742d35Cc6634C0532925a3b844Bc454e4438f44e",
"newDid": "did:ethr:0x742d35Cc6634C0532925a3b844Bc454e4438f44f",
"signature": "0x...",
"metadata": {
"name": "John Smith"
}
}Issue a Universal Verification Token.
POST /identity/issue-uvtRequest Body:
{
"credentialId": "kyc-verification-001",
"expiresAt": 1705123200,
"owner": "0x742d35Cc6634C0532925a3b844Bc454e4438f44e",
"metadata": {
"type": "kyc",
"level": "standard",
"issuer": "compliant-kyc-provider"
}
}Response (200 OK):
{
"success": true,
"uvt": {
"tokenId": "0xabc123def456...",
"credentialId": "kyc-verification-001",
"issuedAt": "2024-01-15T10:30:00Z",
"expiresAt": "2025-01-15T10:30:00Z",
"valid": true,
"issuer": "0x742d35Cc6634C0532925a3b844Bc454e4438f44e"
}
}Verify the validity of a UVT.
GET /identity/uvt/{tokenId}Response (200 OK):
{
"tokenId": "0xabc123def456...",
"isValid": true,
"checkedAt": "2024-01-15T10:35:00Z",
"expiresAt": "2025-01-15T10:30:00Z",
"timeRemaining": 31536000
}✅ Mock Implementation: These endpoints are functional but return simulated data for development purposes.
Create a new DAO governance proposal.
POST /dao/proposalRequest Body:
{
"description": "Upgrade AI detection module to version 2.1",
"duration": 604800,
"proposer": "0x742d35Cc6634C0532925a3b844Bc454e4438f44e",
"metadata": {
"category": "technical",
"priority": "high",
"estimatedCost": "50000"
}
}Response (200 OK):
{
"success": true,
"proposal": {
"id": 123,
"description": "Upgrade AI detection module to version 2.1",
"proposer": "0x742d35Cc6634C0532925a3b844Bc454e4438f44e",
"voteCount": 0,
"startTime": "2024-01-15T10:30:00Z",
"endTime": "2024-01-22T10:30:00Z",
"status": "active"
}
}Cast a vote on an active proposal.
POST /dao/voteRequest Body:
{
"proposalId": 123,
"voter": "0x742d35Cc6634C0532925a3b844Bc454e4438f44e",
"vote": "yes",
"signature": "0x..."
}Retrieve proposal details.
GET /dao/proposal/{proposalId}Response (200 OK):
{
"proposal": {
"id": 123,
"proposer": "0x742d35Cc6634C0532925a3b844Bc454e4438f44e",
"description": "Upgrade AI detection module to version 2.1",
"voteCount": 45,
"startTime": "2024-01-15T10:30:00Z",
"endTime": "2024-01-22T10:30:00Z",
"executed": false,
"status": "active"
}
}✅ Mock Implementation: These endpoints are functional but return simulated data for development purposes.
Apply watermark to a digital asset.
POST /watermarkRequest Body:
{
"assetId": "0x1234567890abcdef...",
"assetType": "image",
"ouiDid": "did:ethr:0x742d35Cc6634C0532925a3b844Bc454e4438f44e",
"metadata": {
"title": "Digital Artwork",
"creator": "Artist Name",
"license": "CC-BY-SA",
"creationDate": "2024-01-15"
},
"contentHash": "0xabcdef123456...",
"signature": "0x..."
}Verify the authenticity of a watermarked asset.
POST /watermark/verifyRequest Body:
{
"assetId": "0x1234567890abcdef...",
"contentHash": "0xabcdef123456...",
"validationMethod": "cryptographic"
}Response (200 OK):
{
"success": true,
"verification": {
"assetId": "0x1234567890abcdef...",
"isAuthentic": true,
"isTampered": false,
"confidenceScore": 98.5,
"validationMethod": "cryptographic",
"verifiedAt": "2024-01-15T10:35:00Z"
}
}✅ Mock Implementation: These endpoints are functional but return simulated analysis data for development purposes.
Perform comprehensive threat analysis on user data.
POST /ai/analyze-threatRequest Body:
{
"userId": "0x742d35Cc6634C0532925a3b844Bc454e4438f44e",
"behaviorData": {
"loginPatterns": [
{
"timestamp": 1705123200,
"ipAddress": "192.168.1.1",
"success": true,
"location": "New York, US"
}
],
"deviceInfo": {
"fingerprint": "device-abc123",
"os": "iOS",
"browser": "Safari"
}
},
"biometricData": {
"facialFeatures": "base64-encoded-data",
"voicePatterns": "base64-encoded-data"
},
"transactionData": {
"amount": 1000,
"frequency": 5,
"location": "New York, US"
}
}Response (200 OK):
{
"success": true,
"userId": "0x742d35Cc6634C0532925a3b844Bc454e4438f44e",
"analysis": {
"overallRisk": "low",
"threatScore": 15.2,
"detectedThreats": [
{
"modelName": "behavior_analysis",
"threatType": "anomaly",
"confidence": 0.12,
"riskLevel": "low",
"details": "Minor behavioral anomaly detected"
}
],
"recommendations": [
"Continue monitoring user activity"
],
"processingTime": 145,
"timestamp": "2024-01-15T10:35:00Z"
}
}Specialized fraud detection endpoint.
POST /ai/detect-fraudVerify user biometric data.
POST /ai/verify-biometricDetect deepfake content.
POST /ai/detect-deepfake✅ Mock Implementation: These endpoints are functional but return simulated analytics data for development purposes.
Retrieve comprehensive system analytics.
GET /analytics/dashboardResponse (200 OK):
{
"systemHealth": {
"status": "healthy",
"uptime": 99.9,
"performance": 95.2
},
"securityStatus": {
"threatLevel": "low",
"compliance": 98.5,
"incidents": 3
},
"usageStats": {
"activeUsers": 1250,
"growth": 8.5,
"efficiency": 92.3
},
"keyMetrics": {
"totalIdentities": 15420,
"totalUVTs": 8750,
"networkLoad": 45000,
"avgResponseTime": 145
}
}Retrieve security-related metrics.
GET /analytics/securityRetrieve user activity and usage metrics.
GET /analytics/usage✅ Mock Implementation: These endpoints are functional but return simulated bridge data for development purposes.
Transfer identity or assets across chains.
POST /cross-chain/bridgeRequest Body:
{
"userAddress": "0x742d35Cc6634C0532925a3b844Bc454e4438f44e",
"dstChainId": 137,
"identityId": "0xabc123...",
"amount": "1.5",
"adapterParams": "0x..."
}Get estimated fee for cross-chain transfer.
GET /cross-chain/estimate-fee?dstChainId=137&amount=1.5Response (200 OK):
{
"estimatedFee": "0.005",
"dstChainId": 137,
"amount": "1.5",
"estimatedTime": 300
}Check status of bridge transaction.
GET /cross-chain/status/{txHash}?srcChainId=1Retrieve list of supported blockchain networks.
GET /cross-chain/chainsAll API endpoints follow consistent error response format:
{
"error": "Error message description",
"code": "ERROR_CODE",
"details": "Additional error details",
"timestamp": "2024-01-15T10:35:00Z"
}VALIDATION_ERROR: Invalid request dataAUTHENTICATION_ERROR: Authentication failedAUTHORIZATION_ERROR: Insufficient permissionsNOT_FOUND: Resource not foundRATE_LIMITED: Too many requestsINTERNAL_ERROR: Server error
API endpoints have rate limits to ensure fair usage:
- Identity endpoints: 100 requests/minute
- DAO endpoints: 50 requests/minute
- Analytics endpoints: 200 requests/minute
- AI endpoints: 30 requests/minute
- Cross-chain endpoints: 20 requests/minute
Rate limit headers are included in responses:
X-RateLimit-Limit: 100
X-RateLimit-Remaining: 95
X-RateLimit-Reset: 1705123800Real-time updates via WebSocket connection.
const ws = new WebSocket('wss://api.oui.com/v1/ws');
ws.onmessage = (event) => {
const data = JSON.parse(event.data);
console.log('Received:', data);
};identity.updated: Identity information changeduvt.issued: New UVT issuedproposal.created: New DAO proposalvote.cast: Vote cast on proposalasset.watermarked: Asset watermarkedthreat.detected: Security threat detectedbridge.completed: Cross-chain transfer completed
import { createOUIClient } from '@oui/sdk';
const client = createOUIClient('https://api.oui.com/v1', 'mainnet');
// Connect wallet
await client.connectWallet(window.ethereum);
// Register identity
const identity = await client.createIdentity('did:ethr:0x...');
// Issue UVT
const uvt = await client.issueUVT('kyc-001', 365);
// Analyze threats
const analysis = await client.analyzeIdentityRisk();import OUIClient from '@oui/mobile-sdk';
const client = new OUIClient({
apiBaseUrl: 'https://api.oui.com/v1',
network: 'mainnet'
});
// Initialize
await client.initialize();
// Use SDK methods
const identity = await client.createIdentity(did);- Initial API release
- Core identity management
- UVT issuance and verification
- DAO governance
- Digital asset watermarking
- AI threat detection
- Cross-chain operations
- Analytics and monitoring
For more detailed examples and advanced usage, see the Examples Documentation.