API Reference
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/v2Authentication
All API requests require authentication using your secret API key.
Security note
Never expose your secret API key in client-side code. Only use it in your backend services.Required Header
x-api-key: YOUR_SECRET_API_KEYEndpoints
Track user registration events and get real-time fraud analysis.
/eventRegistration Attempt Event
Track registration attempts before they complete. This helps you spot suspicious activity early and prevent unwanted accounts from cluttering your database.
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",
},
}
);/eventRegistration Success Event
Track successful user registrations with complete user data. Returns risk scores and fraud signals for completed registrations.
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.
HTTP Status Codes
400Bad Request - Invalid request format or missing required fields401Unauthorized - Invalid or missing API key429Too Many Requests - Rate limit or quota exceeded500Internal Server Error - Something went wrong on our endSupport
Need help with integration?
Check out our quick start guide or reach out to our support team for assistance with implementing the Event API.