curl --request POST \
--url https://api.example.com/api/v1/auth/verify-user{
"success": true,
"exists": true,
"message": "User verified and exists in database"
}
Verify that a user exists in the database or create them if missing
curl --request POST \
--url https://api.example.com/api/v1/auth/verify-user{
"success": true,
"exists": true,
"message": "User verified and exists in database"
}
Verifies whether the authenticated user exists in the database. If the user is not found, this endpoint will initiate user creation in the Engine and Database Storage services.Documentation Index
Fetch the complete documentation index at: https://mintlify.com/lakshay-goyal/Exness/llms.txt
Use this file to discover all available pages before exploring further.
Authorization: Bearer <your_jwt_token>
curl -X POST "http://localhost:8000/api/v1/auth/verify-user" \
-H "Authorization: Bearer YOUR_JWT_TOKEN"
{
"success": true,
"exists": true,
"message": "User verified and exists in database"
}
{
"error": "User not found in database and creation is in progress.",
"exists": false
}
{
"error": "No token provided."
}
{
"error": "Invalid or expired token."
}
{
"error": "Invalid token payload."
}
const ensureDashboardAccess = async (token) => {
try {
const result = await fetch('http://localhost:8000/api/v1/auth/verify-user', {
method: 'POST',
headers: { 'Authorization': `Bearer ${token}` }
});
const data = await result.json();
if (data.success && data.exists) {
// User exists, proceed to dashboard
return { canAccess: true };
} else if (!data.exists) {
// User creation in progress, retry or show loading
return { canAccess: false, reason: 'User creation in progress' };
}
} catch (error) {
return { canAccess: false, reason: error.message };
}
};