Event API Reference
Track user registration events and get real-time fraud analysis
Base URL
All API requests should be made to the following base URL
https://api.trueguard.io/v2
Authentication
All API requests require authentication using your secret API key
Required Header
x-api-key: YOUR_SECRET_API_KEY
Endpoints
Track user registration events and get real-time fraud analysis
Registration Attempt Event
Track registration attempts before they complete. This helps you spot suspicious activity early and prevent unwanted accounts from cluttering your database.
Registration Attempt Request
import axios from 'axios';
const response = await axios.post(
"https://api.trueguard.io/v2/event",
{
action: "register",
status: "attempt",
verificationId: "550e8400-e29b-41d4-a716-446655440000",
context: {
ip: "192.168.1.1",
email: "user@example.com",
phone: "+1234567890",
},
metadata: {
source: "web",
referrer: "https://example.com",
},
},
{
headers: {
"x-api-key": "YOUR_SECRET_API_KEY",
},
}
);
Registration Success Event
Track successful user registrations with complete user data. Returns risk scores and fraud signals for completed registrations.
Successful Registration Request
import axios from 'axios';
const response = await axios.post(
"https://api.trueguard.io/v2/event",
{
action: "register",
status: "success",
verificationId: "550e8400-e29b-41d4-a716-446655440000",
context: {
ip: "192.168.1.1",
email: "user@example.com",
phone: "+1234567890",
},
user: {
id: "user123",
email: "user@example.com",
metadata: {
firstName: "John",
lastName: "Doe",
},
attachAttemptEvents: true,
},
metadata: {
source: "web",
type: "password",
},
},
{
headers: {
"x-api-key": "YOUR_SECRET_API_KEY",
},
}
);
Error Handling
Understanding and handling API error responses