v1.0.0 — Algorand-powered consent management
curl -X POST https://civitas-api.civitasv.workers.dev/v1/register \
-H "Content-Type: application/json" \
-d '{
"name": "Your Org",
"email": "dev@yourorg.com",
"algorandAddress": "YOUR_ALGORAND_ADDRESS..."
}'
{
"apiKey": "cv_live_abc123...",
"algorandAddress": "YOUR_ALGORAND_ADDRESS...",
"message": "Save your API key securely..."
}
cv_live_ and is only shown once. Store it securely. If lost, you'll need to register a new account./v1/consent/request to build unsigned transactions. The API returns base64-encoded transactions for you to sign.curl -X POST https://civitas-api.civitasv.workers.dev/v1/consent/request \
-H "Authorization: Bearer cv_live_abc123..." \
-H "Content-Type: application/json" \
-d '{
"userAddress": "ALGO_USER_ADDRESS...",
"docType": 0,
"reason": "KYC verification",
"durationHours": 24
}'
{
"transactions": ["base64_txn_1...", "base64_txn_2..."],
"groupId": "base64_group_id...",
"requestId": 1,
"message": "Sign these transactions..."
}
curl -X POST https://civitas-api.civitasv.workers.dev/v1/consent/submit \
-H "Authorization: Bearer cv_live_abc123..." \
-H "Content-Type: application/json" \
-d '{
"signedTransactions": ["base64_signed_txn_1...", "base64_signed_txn_2..."]
}'
{
"txId": "ALGO_TX_ID...",
"status": "submitted"
}
algosdk to decode, sign, and re-encode the transactions:import algosdk from 'algosdk';
// 1. Get unsigned transactions from the API
const res = await fetch('/v1/consent/request', { ... });
const { transactions } = await res.json();
// 2. Decode and sign each transaction
const account = algosdk.mnemonicToSecretKey('your mnemonic...');
const signedTxns = transactions.map(txnB64 => {
const txnBytes = Buffer.from(txnB64, 'base64');
const txn = algosdk.decodeUnsignedTransaction(txnBytes);
const signed = txn.signTxn(account.sk);
return Buffer.from(signed).toString('base64');
});
// 3. Submit signed transactions
await fetch('/v1/consent/submit', {
method: 'POST',
headers: {
'Authorization': 'Bearer cv_live_...',
'Content-Type': 'application/json'
},
body: JSON.stringify({ signedTransactions: signedTxns })
});
Authorization: Bearer cv_live_...https://civitas-api.civitasv.workers.devapplication/json for all POST requests.
name, email, algorandAddress. Returns API key (shown once).userAddress, docType, reason, durationHours.signedTransactions (array of base64 signed txns).