Getting Started
Make your first Naiza fraud detection API call, authenticate, and verify ALLOW, REVIEW, or BLOCK decisions in your integration.
Getting Started
This guide will help you make your first API call and verify your integration.
Prerequisites
- A Naiza account with an active subscription
- An API key (see Authentication)
- Basic knowledge of REST APIs and JSON
Step 1: Get Your API Key
- Log in to the Naiza Dashboard
- Navigate to Settings → API Keys
- Click Create API Key
- Copy and securely store your API key (format:
naiza_api_sk_live_...)
⚠️ Important: API keys are only shown once. Store them securely.
Step 2: Make Your First Call
Let's evaluate a transaction to get a decision.
curl -X POST https://api.naiza.ai/api/v1/decisions/evaluate \
-H "x-api-key: naiza_api_sk_live_YOUR_KEY_HERE" \
-H "Content-Type: application/json" \
-d '{
"eventName": "payment.attempt",
"customer": {
"externalId": "cust_test_123",
"email": "test@example.com"
},
"ip": "203.0.113.42"
}'Step 3: Understand the Response
A successful response looks like this:
{
"decision": "approve",
"riskScore": 25,
"riskLevel": "low",
"reasonCodes": [
{
"code": "NO_RISK_INDICATORS",
"explanation": "No risk indicators detected"
}
],
"correlationIds": {
"requestId": "req_abc123xyz",
"eventId": "evt_ckm9876543210",
"customerId": "cus_test_123"
},
"ruleVersion": {
"version": "v1.0.0"
},
"evaluatedAt": "2025-01-15T14:30:00.000Z"
}Key fields:
decision:approve,deny, orreview(lowercase; Events API uses uppercase ALLOW/BLOCK/REVIEW)riskScore: 0-100 (higher = more risky)riskLevel:low,medium,high, orcriticalcorrelationIds.eventId: Use this to query decision details later
Step 4: Verify Webhook Signature (Optional)
If you've set up webhooks, verify the signature:
const crypto = require("crypto");
function verifySignature(payload, signature, secret) {
const expected = crypto
.createHmac("sha256", secret)
.update(JSON.stringify(payload))
.digest("hex");
const provided = signature.replace("sha256=", "");
return crypto.timingSafeEqual(Buffer.from(expected), Buffer.from(provided));
}
// In your webhook handler
const signature = req.headers["x-webhook-signature"];
const isValid = verifySignature(
req.body,
signature,
process.env.WEBHOOK_SECRET,
);Step 5: Query a Decision
Use the eventId from the correlation IDs to query decision details:
curl -X GET "https://api.naiza.ai/api/v1/decisions/evt_ckm9876543210" \ -H "x-api-key: naiza_api_sk_live_YOUR_KEY_HERE"
Next Steps
- Read the Quick Start Guide for common operations
- Review Integration Examples for code patterns
- Explore the API Reference for complete documentation
Troubleshooting
"Invalid API key" error
- Verify the key format:
naiza_api_sk_live_<32-chars> - Check for extra spaces or newlines
- Ensure the key hasn't been revoked
"Validation failed" error
- Review required fields in the API documentation
- Check field types and formats
- Ensure JSON is properly formatted
Need Help?
- Check the Error Handling guide
- Review the API Reference
- Contact support with your API key (sanitized) and error details