The Email Validation API uses a generic proxy pattern to route requests to IBEX Safe. The IBEx.Fi API provides a transparent proxy endpoint that forwards requests to the IBEX Safe API, which handles the actual email validation and storage.
The proxy endpoints are:
:verb is validateEmail, confirmEmail, userdata, etc.)For email validation, you call:
/validateEmail/confirmEmailThe Email Validation API allows you to securely validate and store user email addresses in IBEX Safe's GDPR-compliant storage. This process involves two steps:
To start the email validation process, send a verification code to the user's email address. This routes through the generic proxy to IBEX Safe's /validateEmail endpoint.
Endpoint : POST /v1.1/ibexsafe/validateEmail (via generic proxy POST /v1.1/ibexsafe/:verb)
Headers :
Authorization: Bearer <access_token> (required)Content-Type: application/json (required)Request Body :
email (string, required) : Email address to validateexternalUserId (string, required) : The external user identifier (your internal user ID)Request Example :
POST /v1.1/ibexsafe/validateEmail
Authorization: Bearer <access_token>
Content-Type: application/json
{
"email": "jane.doe@foo.domain",
"externalUserId": "ext_user_123"
}
Response (200 OK) :
{
"success": true,
"message": "Verification code sent to email"
}
After the user receives the verification code, confirm the email by submitting the code. You can optionally store the confirmed email in userData for future use. This routes through the generic proxy to IBEX Safe's /confirmEmail endpoint.
Endpoint : POST /v1.1/ibexsafe/confirmEmail (via generic proxy POST /v1.1/ibexsafe/:verb)
Headers :
Authorization: Bearer <access_token> (required)Content-Type: application/json (required)Request Body :
email (string, required) : Email address to confirm (must match the email used in validateEmail)code (string, required) : Verification code received via emailexternalUserId (string, required) : The external user identifieruserDataName (string, optional) : Key name to store the confirmed email in userData (default: "marketing.email")optinNews (boolean, optional) : Opt-in for news updates (stored in userData as "optin.newsletter")optinNotifications (boolean, optional) : Opt-in for notifications (stored in userData as "optin.walletAlerts")Request Example :
POST /v1.1/ibexsafe/confirmEmail
Authorization: Bearer <access_token>
Content-Type: application/json
{
"email": "jane.doe@foo.domain",
"code": "123456",
"externalUserId": "ext_user_123",
"userDataName": "marketing.email",
"optinNews": true,
"optinNotifications": false
}
Response (200 OK) :
{
"success": true,
"message": "Email confirmed and stored"
}
userDataName is provided, the confirmed email is automatically stored in userData under that key. You can retrieve it later using GET /v1.1/ibexsafe/userdata/external/:externalUserId.
After confirming the email, you can retrieve it from userData using the standard userData retrieval endpoint.
Endpoint : GET /v1.1/ibexsafe/userdata/external/:externalUserId
Request Example :
GET /v1.1/ibexsafe/userdata/external/ext_user_123 Authorization: Bearer <access_token>
Response (200 OK) :
{
"data": {
"marketing.email": "jane.doe@foo.domain",
"optin.newsletter": true,
"optin.walletAlerts": false
}
}
Here's a complete example of the email validation flow:
// Step 1: Request email validation
const validateResponse = await fetch('https://api.ibex.fi/v1.1/ibexsafe/validateEmail', {
method: 'POST',
headers: {
'Authorization': `Bearer ${accessToken}`,
'Content-Type': 'application/json'
},
body: JSON.stringify({
email: 'jane.doe@foo.domain',
externalUserId: 'ext_user_123'
})
});
const validateResult = await validateResponse.json();
// { success: true, message: "Verification code sent to email" }
// Step 2: User enters code from email
const code = '123456'; // User input
// Step 3: Confirm email
const confirmResponse = await fetch('https://api.ibex.fi/v1.1/ibexsafe/confirmEmail', {
method: 'POST',
headers: {
'Authorization': `Bearer ${accessToken}`,
'Content-Type': 'application/json'
},
body: JSON.stringify({
email: 'jane.doe@foo.domain',
code: code,
externalUserId: 'ext_user_123',
userDataName: 'marketing.email',
optinNews: true,
optinNotifications: false
})
});
const confirmResult = await confirmResponse.json();
// { success: true, message: "Email confirmed and stored" }
// Step 4: Retrieve stored email (optional)
const userDataResponse = await fetch('https://api.ibex.fi/v1.1/ibexsafe/userdata/external/ext_user_123', {
headers: {
'Authorization': `Bearer ${accessToken}`
}
});
const userData = await userDataResponse.json();
// { data: { "marketing.email": "jane.doe@foo.domain", "optin.newsletter": true } }
externalUserId securely and use it consistently across requestsvalidateEmail againThis section provides detailed technical information for AI systems integrating the IBEX email validation flow, including architecture patterns, data models, and implementation details.
Generic Proxy Pattern
POST /v1.1/ibexsafe/:verb and GET /v1.1/ibexsafe/:verb:verb is validateEmail or confirmEmail, so you call POST /v1.1/ibexsafe/validateEmail or POST /v1.1/ibexsafe/confirmEmailPOST /v1.1/ibexsafe/validateEmail
POST /v1.1/ibexsafe/:verb with verb=validateEmailPOST /validateEmailPOST /v1.1/ibexsafe/confirmEmail
POST /v1.1/ibexsafe/:verb with verb=confirmEmailPOST /confirmEmailoptin.newsletter, optin.walletAlerts) - handled by IBEX SafeEmail Validation Request:
{
"email": "string (valid email format)",
"externalUserId": "string (your internal user ID)"
}
Email Confirmation Request:
{
"email": "string (must match validateEmail email)",
"code": "string (6-digit verification code)",
"externalUserId": "string (must match validateEmail externalUserId)",
"userDataName": "string (optional, default: 'marketing.email')",
"optinNews": "boolean (optional)",
"optinNotifications": "boolean (optional)"
}
UserData Storage (after confirmation):
{
"data": {
"marketing.email": "jane.doe@foo.domain",
"optin.newsletter": true,
"optin.walletAlerts": false
}
}
UserData Integration:
userDataNameoptin.newsletter and optin.walletAlertsGET /v1.1/ibexsafe/userdata/external/:externalUserIdPOST /v1.1/ibexsafe/userdataGDPR Compliance:
src/routes/v1.1/ibexsafe.ts : Generic proxy endpoints (POST /v1.1/ibexsafe/:verb, POST /v1.1/ibexsafe/:verb)src/clients/IBEXSafe.ts : IBEX Safe API client (handles actual IBEX Safe communication)docs/WIDGET_BACKEND_TO_IBEXFIAPI_ENDPOINTS.md : Complete endpoint documentationPOST /v1.1/ibexsafe/validateEmail with email and externalUserIdPOST /v1.1/ibexsafe/confirmEmail with email, code, and externalUserIduserDataName provided, IBEX Safe stores email in userDataGET /v1.1/ibexsafe/userdata/external/:externalUserId