Skip to main contentCertyo Developer Portal

Code Samples

Ready-to-paste examples in 5 languages for the core API flows. No SDK installation required — just the HTTP client of your choice.

No official SDKs yet
We're working on first-class SDKs for JavaScript, Python, Go, and .NET. For now, the HTTP examples below are production-ready.

Ingest a record

Submit a single record for blockchain anchoring. All examples assume CERTYO_API_KEY is set in your environment.

curl -X POST https://www.certyos.com/api/v1/records \
  -H "X-API-Key: $CERTYO_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "tenantId": "acme-corp",
    "database": "production",
    "collection": "orders",
    "recordId": "order-12345",
    "recordPayload": { "amount": 299.99, "currency": "USD" }
  }'

Verify a record

After ~60 seconds (to allow batch accumulation and on-chain confirmation), verify the record by sending the original payload.

curl -X POST https://www.certyos.com/api/v1/verify/record \
  -H "X-API-Key: $CERTYO_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "tenantId": "acme-corp",
    "database": "production",
    "collection": "orders",
    "recordId": "order-12345",
    "payload": { "amount": 299.99, "currency": "USD" }
  }'

Poll for anchoring

Wait for a record to transition from Batched to Anchored before verifying.

# Loop until anchored, max 2 minutes
for i in $(seq 1 24); do
  STATUS=$(curl -s "https://www.certyos.com/api/v1/snapshots?tenantId=acme-corp&recordId=order-12345" \
    -H "X-API-Key: $CERTYO_API_KEY" \
    | jq -r '.items[0].status')
  echo "Attempt $i: status=$STATUS"
  if [ "$STATUS" = "Anchored" ]; then
    echo "Anchored!"
    break
  fi
  sleep 5
done