API Reference
Complete REST API documentation for integrating OAS into your applications.
Base URL
https://api.omniasset.io/v1
All API requests must be made over HTTPS.
Authentication
API Key Authentication
Include your API key in the request headers:
curl https://api.omniasset.io/v1/assets \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json"
OAuth 2.0
For user-authenticated requests, use OAuth 2.0 flow:
// Authorization URL
const authUrl = 'https://auth.omniasset.io/oauth/authorize?' +
'client_id=YOUR_CLIENT_ID&' +
'redirect_uri=YOUR_REDIRECT_URI&' +
'response_type=code&' +
'scope=read:assets write:assets';
// Exchange code for token
const tokenResponse = await fetch('https://auth.omniasset.io/oauth/token', {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({
grant_type: 'authorization_code',
client_id: 'YOUR_CLIENT_ID',
client_secret: 'YOUR_CLIENT_SECRET',
code: 'AUTHORIZATION_CODE',
redirect_uri: 'YOUR_REDIRECT_URI'
})
});
Assets
/assets
Create Asset
Creates a new tokenized asset.
Request Body
{
"name": "Luxury Apartment NYC",
"symbol": "APT-NYC-001",
"type": "real_estate",
"totalSupply": 1000000,
"pricePerToken": 100,
"metadata": {
"location": "Manhattan, New York",
"sqft": 2500,
"bedrooms": 3
},
"compliance": {
"kycRequired": true,
"jurisdictions": ["US", "UK"]
}
}
Response
{
"id": "asset_1234567890",
"tokenAddress": "0x742d35Cc6634C0532925a3b844Bc9e7595f0bEb8",
"name": "Luxury Apartment NYC",
"symbol": "APT-NYC-001",
"totalSupply": 1000000,
"availableSupply": 1000000,
"pricePerToken": 100,
"status": "active",
"createdAt": "2024-01-15T10:00:00Z"
}
/assets/:id
Get Asset
Retrieves details of a specific asset.
Path Parameters
id
- The asset ID or token address
Response
{
"id": "asset_1234567890",
"tokenAddress": "0x742d35Cc6634C0532925a3b844Bc9e7595f0bEb8",
"name": "Luxury Apartment NYC",
"symbol": "APT-NYC-001",
"type": "real_estate",
"totalSupply": 1000000,
"circulatingSupply": 750000,
"holders": 234,
"pricePerToken": 102.50,
"marketCap": 102500000,
"status": "active",
"metadata": {
"location": "Manhattan, New York",
"sqft": 2500,
"bedrooms": 3,
"lastValuation": "2024-01-01",
"documents": ["deed.pdf", "appraisal.pdf"]
}
}
/assets
List Assets
Returns a paginated list of assets.
Query Parameters
type
- Filter by asset type (real_estate, bond, invoice, etc.)
status
- Filter by status (active, paused, completed)
limit
- Number of results (default: 20, max: 100)
offset
- Pagination offset
Response
{
"data": [
{
"id": "asset_1234567890",
"name": "Luxury Apartment NYC",
"symbol": "APT-NYC-001",
"type": "real_estate",
"pricePerToken": 102.50,
"marketCap": 102500000
}
],
"pagination": {
"total": 156,
"limit": 20,
"offset": 0,
"hasMore": true
}
}
/assets/:id
Update Asset
Updates asset metadata and settings.
Request Body
{
"pricePerToken": 105,
"metadata": {
"lastRenovation": "2024-01-01",
"newAmenities": ["gym", "pool"]
},
"compliance": {
"jurisdictions": ["US", "UK", "EU"]
}
}
Transactions
/transactions/transfer
Transfer Tokens
Transfer tokens between addresses.
Request Body
{
"assetId": "asset_1234567890",
"from": "0x123...",
"to": "0x456...",
"amount": 100,
"memo": "Investment transfer"
}
Response
{
"transactionId": "tx_9876543210",
"hash": "0xabc123...",
"status": "pending",
"confirmations": 0,
"gasUsed": 45000,
"timestamp": "2024-01-15T10:00:00Z"
}
/transactions/mint
Mint Tokens
Mint new tokens (requires admin permissions).
{
"assetId": "asset_1234567890",
"to": "0x456...",
"amount": 10000,
"reason": "Additional capital raise"
}
/transactions/burn
Burn Tokens
Permanently remove tokens from circulation.
{
"assetId": "asset_1234567890",
"from": "0x123...",
"amount": 1000,
"reason": "Buyback and burn"
}
/transactions/dividends
Distribute Dividends
Distribute dividends to token holders.
{
"assetId": "asset_1234567890",
"amount": 100000,
"currency": "USDC",
"period": "Q1-2024",
"paymentDate": "2024-04-15",
"snapshotDate": "2024-03-31"
}
Webhooks
Webhook Setup
Configure webhooks to receive real-time event notifications:
// Register webhook endpoint
const webhook = await oas.webhooks.create({
url: 'https://your-app.com/webhooks/oas',
events: [
'asset.created',
'asset.updated',
'transaction.completed',
'dividend.distributed'
],
secret: 'your-webhook-secret'
});
// Verify webhook signature
const isValid = oas.webhooks.verify(
payload,
headers['x-oas-signature'],
'your-webhook-secret'
);
Webhook Events
Available webhook event types:
Asset Events
asset.created
- New asset tokenizedasset.updated
- Asset metadata updatedasset.paused
- Trading pausedasset.resumed
- Trading resumed
Transaction Events
transaction.pending
- Transaction submittedtransaction.completed
- Transaction confirmedtransaction.failed
- Transaction faileddividend.distributed
- Dividend payment complete
Compliance Events
kyc.approved
- KYC verification approvedkyc.rejected
- KYC verification rejectedcompliance.alert
- Compliance issue detected
Event Payload Example
{
"event": "asset.created",
"timestamp": "2024-01-15T10:00:00Z",
"data": {
"assetId": "asset_1234567890",
"tokenAddress": "0x742d35Cc...",
"name": "Luxury Apartment NYC",
"totalSupply": 1000000
}
}
Rate Limits
API rate limits vary by plan:
Developer
100
requests/minute
Professional
1,000
requests/minute
Enterprise
Unlimited
Custom limits
Rate limit information is included in response headers:
X-RateLimit-Limit: 100
X-RateLimit-Remaining: 95
X-RateLimit-Reset: 1642248000
Error Codes
200
OK
201
Created
400
Bad Request
401
Unauthorized
403
Forbidden
404
Not Found
429
Too Many Requests
500
Internal Server Error
Error Response Format
{
"error": {
"code": "invalid_parameter",
"message": "The 'amount' field must be a positive number",
"field": "amount",
"requestId": "req_abc123"
}
}