API Documentation
Build complete dApps and private blockchains with no code required
Introduction
Welcome to the Cerulea API documentation. Cerulea is a production-grade, no-code blockchain infrastructure platform that enables developers and enterprises to build fully functional decentralized applications (dApps) and private blockchain networks without writing a single line of blockchain code.
Complete dApps
Build full-stack dApps with smart contracts, tokens, and frontends
Private Blockchains
Deploy custom blockchain networks with configurable consensus
Validator Management
Manage validators, governance, and network parameters
Modular Architecture
Configure modules for DeFi, NFTs, DAOs, and more
Real-time Monitoring
Monitor and analyze blockchain performance in real-time
CI/CD Integration
Automated deployments with GitHub integration
API Architecture
The Cerulea API follows a hybrid architecture combining RESTful endpoints for resource management and JSON-RPC for blockchain interactions. This provides intuitive REST APIs for infrastructure management and powerful RPC methods for blockchain operations.
Authentication & Authorization
Cerulea uses a dual authentication system for maximum security and flexibility:
API Key Authentication
For server-to-server communication and automated workflows.
/auth/api-keysCreate a new API key with custom scopes and expiration
curl -X POST https://api.cerulea.app/v1/auth/api-keys \
-H "Authorization: Bearer <your_oauth_token>" \
-H "Content-Type: application/json" \
-d '{
"name": "Production API Key",
"scopes": ["workspace:read", "workspace:write", "blockchain:deploy"],
"expiresIn": "90d"
}'X-API-Key header for all requests. Never expose API keys in client-side code.curl -X GET https://api.cerulea.app/v1/workspaces \
-H "X-API-Key: crla_live_xxxxxxxxxxxxxxxxxxx"OAuth 2.0
For user-facing applications and third-party integrations.
# Step 1: Redirect user to authorization endpoint
https://api.cerulea.app/v1/oauth/authorize?
client_id=YOUR_CLIENT_ID&
redirect_uri=YOUR_CALLBACK_URL&
response_type=code&
scope=workspace:read blockchain:write&
state=RANDOM_STATE_STRING
# Step 2: Exchange code for access token
curl -X POST https://api.cerulea.app/v1/oauth/token \
-H "Content-Type: application/x-www-form-urlencoded" \
-d "grant_type=authorization_code" \
-d "code=AUTHORIZATION_CODE" \
-d "redirect_uri=YOUR_CALLBACK_URL" \
-d "client_id=YOUR_CLIENT_ID" \
-d "client_secret=YOUR_CLIENT_SECRET"Available Scopes
| Scope | Description |
|---|---|
workspace:read | Read workspace data |
workspace:write | Create/modify workspaces |
blockchain:read | Query blockchain data |
blockchain:write | Deploy/manage blockchains |
blockchain:deploy | Deploy smart contracts |
validator:read | View validators |
validator:write | Manage validators |
governance:read | View proposals |
governance:write | Create/vote on proposals |
admin | Full administrative access |
Core REST API
Standard Response Format
{
"success": true,
"data": { /* resource data */ },
"meta": {
"requestId": "req_xxxxxxxx",
"timestamp": "2025-02-25T10:30:00Z"
}
}Pagination
/resources?page=1&limit=50&sort=created_at:descList resources with pagination and sorting
{
"success": true,
"data": [...],
"pagination": {
"page": 1,
"limit": 50,
"total": 250,
"totalPages": 5,
"hasNext": true,
"hasPrev": false
}
}Health Check
/healthCheck API health and service status
{
"status": "operational",
"version": "1.0.0",
"uptime": 99.99,
"services": {
"database": "healthy",
"blockchain": "healthy",
"storage": "healthy"
}
}RPC Methods
JSON-RPC 2.0 endpoint for direct blockchain interactions
/rpcExecute JSON-RPC methods
{
"jsonrpc": "2.0",
"method": "blockchain.getBlock",
"params": {
"blockchainId": "bc_xxxxxxxx",
"blockNumber": "latest"
},
"id": 1
}Available Methods
blockchain.getBlock- Get block by number or hashblockchain.getTransaction- Get transaction detailsblockchain.getBalance- Get account balancetransaction.send- Send signed transactiontransaction.simulate- Simulate transaction executioncontract.call- Read-only contract callcontract.execute- Execute contract method
Webhooks
Receive real-time notifications when events occur in your blockchain infrastructure
/webhooksCreate a new webhook
{
"url": "https://your-domain.com/webhook",
"events": [
"blockchain.block.created",
"blockchain.transaction.confirmed",
"contract.event.emitted",
"validator.status.changed"
],
"secret": "whsec_xxxxxxxxxxxxxxxx",
"enabled": true,
"filters": {
"blockchainId": "bc_abc123"
}
}Webhook Events
| Event Type | Description |
|---|---|
blockchain.block.created | New block mined |
blockchain.transaction.confirmed | Transaction confirmed |
contract.deployed | Smart contract deployed |
contract.event.emitted | Contract event emitted |
validator.status.changed | Validator status changed |
governance.proposal.created | New proposal created |
Webhook Signature Verification
const crypto = require('crypto');
function verifyWebhook(payload, signature, secret) {
const hmac = crypto.createHmac('sha256', secret);
const digest = hmac.update(payload).digest('hex');
return crypto.timingSafeEqual(
Buffer.from(signature),
Buffer.from(digest)
);
}Workspace & Project Management
Organize your blockchain infrastructure into workspaces and projects
/workspacesCreate a new workspace
{
"name": "Production Environment",
"description": "Production blockchain infrastructure",
"settings": {
"defaultNetwork": "mainnet",
"billingPlan": "enterprise"
},
"members": [
{
"email": "admin@company.com",
"role": "admin"
}
]
}/workspaces/:workspaceId/projectsCreate a new project within a workspace
{
"name": "DeFi Exchange",
"type": "dapp",
"description": "Decentralized exchange platform",
"template": "defi-dex",
"config": {
"blockchain": "ethereum",
"network": "mainnet",
"features": ["swap", "liquidity-pools", "staking"]
}
}dApp Builder API
Build complete decentralized applications with no code required
/dappsCreate a new dApp
{
"name": "MyDeFi Platform",
"workspaceId": "ws_xxxxxxxx",
"template": "defi-platform",
"components": [
{
"type": "token",
"config": {
"name": "Platform Token",
"symbol": "PLAT",
"totalSupply": "1000000000",
"decimals": 18,
"features": ["burnable", "mintable", "pausable"]
}
},
{
"type": "staking",
"config": {
"stakingToken": "PLAT",
"rewardRate": "5",
"lockPeriod": "30d"
}
},
{
"type": "governance",
"config": {
"votingToken": "PLAT",
"proposalThreshold": "100000",
"votingPeriod": "7d"
}
}
],
"frontend": {
"theme": "modern-dark",
"customDomain": "mydefi.com"
}
}Available Components
| Component | Description |
|---|---|
token | Fungible or non-fungible tokens |
staking | Token staking mechanism |
liquidity-pool | DEX liquidity pools |
lending | Lending/borrowing protocol |
governance | DAO governance system |
nft-marketplace | NFT marketplace |
auction | Auction mechanism |
multisig | Multi-signature wallet |
Private Blockchain Networks
Deploy and manage custom private blockchain networks with full control
/blockchainsCreate a new private blockchain
{
"name": "Enterprise Blockchain",
"type": "private",
"consensus": "proof-of-authority",
"chainId": 12345,
"config": {
"blockTime": "5s",
"blockGasLimit": "30000000",
"nativeToken": {
"name": "Enterprise Coin",
"symbol": "ENT",
"premine": "1000000000"
}
},
"validators": [
{
"address": "0x1234...",
"name": "Validator Node 1"
}
],
"features": ["smart-contracts", "permissions", "privacy"]
}Consensus Mechanisms
proof-of-authority (PoA)- Permissioned validatorsproof-of-stake (PoS)- Stake-based validationdelegated-proof-of-stake (DPoS)- Elected validatorspbft- Practical Byzantine Fault Toleranceraft- Raft consensus for private networks
Smart Contract Management
/contracts/deployDeploy a smart contract from template
{
"blockchainId": "bc_abc123",
"template": "erc20-token",
"params": {
"name": "My Token",
"symbol": "MTK",
"totalSupply": "1000000",
"decimals": 18
},
"from": "0x1234...",
"gasLimit": "2000000"
}Contract Templates
| Template | Description |
|---|---|
erc20-token | Standard fungible token |
erc721-nft | Non-fungible token |
erc1155-multi | Multi-token standard |
governance-dao | DAO with voting |
staking-pool | Staking rewards |
marketplace | NFT marketplace |
Validator Management
/blockchains/:blockchainId/validatorsAdd a new validator to the network
{
"address": "0xabcdef123456...",
"name": "Node-US-East-1",
"stake": "100000",
"commission": "5",
"metadata": {
"location": "US-East",
"provider": "AWS"
}
}Validator Operations
GET /validators/:id/status- Get validator statusPUT /validators/:id/stake- Update stake amountPOST /validators/:id/slash- Slash validator (penalty)DELETE /validators/:id- Remove validator
Governance Proposals
/governance/proposalsCreate a new governance proposal
{
"blockchainId": "bc_abc123",
"title": "Increase Block Size",
"description": "Proposal to increase block size from 2MB to 4MB",
"type": "parameter-change",
"changes": {
"blockSize": "4MB"
},
"votingPeriod": "7d",
"quorum": "50",
"threshold": "66.67"
}/governance/proposals/:proposalId/voteVote on a proposal
{
"vote": "yes",
"weight": "1000000",
"reason": "This change will improve network throughput"
}Module Configuration
Enable and configure blockchain modules for specific functionality
/blockchains/:blockchainId/modulesEnable a module on your blockchain
{
"module": "defi",
"config": {
"features": ["dex", "lending", "staking"],
"swapFee": "0.3",
"liquidationThreshold": "75"
}
}Available Modules
| Module | Features |
|---|---|
defi | DeFi protocols (DEX, lending, staking) |
nft | NFT minting and marketplace |
dao | DAO governance and voting |
bridge | Cross-chain bridge functionality |
oracle | Price oracle integration |
identity | Decentralized identity (DID) |
privacy | Zero-knowledge proofs |
storage | Decentralized storage (IPFS) |
Token Management
/tokensCreate a new token
{
"blockchainId": "bc_abc123",
"standard": "ERC20",
"name": "Platform Token",
"symbol": "PLAT",
"decimals": 18,
"totalSupply": "1000000000",
"features": {
"mintable": true,
"burnable": true,
"pausable": true
},
"distribution": [
{
"address": "0x1234...",
"amount": "500000000",
"vesting": {
"duration": "24m",
"cliff": "6m"
}
}
]
}Token Standards
ERC20- Fungible tokensERC721- Non-fungible tokens (NFTs)ERC1155- Multi-token standardERC4626- Tokenized vaults
Monitoring & Analytics
/blockchains/:blockchainId/metricsGet real-time blockchain metrics
{
"currentBlock": 123456,
"blockTime": 5.2,
"transactionsPerSecond": 150,
"activeValidators": 21,
"totalTransactions": 5000000,
"networkHashrate": "500 TH/s",
"averageGasPrice": "25 gwei"
}/analytics/timeseriesQuery historical data
Example: ?blockchainId=bc_abc123&metric=transactions&from=2025-02-01&to=2025-02-25&granularity=1h
Error Handling
Error Response Format
{
"success": false,
"error": {
"code": "INSUFFICIENT_BALANCE",
"message": "Insufficient balance to complete transaction",
"details": {
"required": "1000000000000000000",
"available": "500000000000000000"
},
"requestId": "req_abc123",
"timestamp": "2025-02-25T10:30:00Z"
}
}Common Error Codes
| HTTP Code | Error Code | Description |
|---|---|---|
| 400 | BAD_REQUEST | Invalid request parameters |
| 401 | UNAUTHORIZED | Invalid or missing authentication |
| 403 | FORBIDDEN | Insufficient permissions |
| 404 | NOT_FOUND | Resource not found |
| 422 | VALIDATION_ERROR | Validation failed |
| 429 | RATE_LIMITED | Rate limit exceeded |
| 500 | INTERNAL_ERROR | Internal server error |
Support & Resources
API Reference
Documentation
Whitepaper
Examples
Support Email
support@cerulea.app