Check if user already exists
/api/v1/check-userChecks whether a user exists in the system by email or phone number. Returns the user's creation date and whether they belong to the current organization.
https://api.care360-next.carevalidate.com/api/v1/check-userhttps://api-staging.care360-next.carevalidate.com/api/v1/check-userEither email or phone number must be provided. If both are provided, email takes priority. Special characters in email and phone-number must be url-encoded. For example, pass %2b instead of + in the phone number.
Headers
cv-api-keystringrequiredYour unique API key for authentication.
Query Parameters
emailstringoptionalThe user's email address. Required if phone-number is not provided.
john@example.comphone-numberstringoptionalThe user's phone number. Required if email is not provided.
%2b11111111111You must provide at least one of the query parameters (email or phone-number). If both are provided, email takes priority.
The existsInCurrentOrganization field will be true if the user belongs to the organization associated with the cv-api-key, and false otherwise.
Example Request
- cURL
- JavaScript
- Python
curl --location '<BASE_URL>/api/v1/check-user?email=john@example.com&phone-number=%2b11111111111' \
--header 'cv-api-key: <redacted>'
const response = await fetch(
'<BASE_URL>/api/v1/check-user?email=john@example.com&phone-number=%2b11111111111',
{
method: 'GET',
headers: {
'cv-api-key': '<redacted>',
},
}
);
const data = await response.json();
console.log(data);
import requests
response = requests.get(
'<BASE_URL>/api/v1/check-user',
headers={
'cv-api-key': '<redacted>',
},
params={
'email': 'john@example.com',
'phone-number': '%2b11111111111',
},
)
print(response.json())
Responses
▶200User found by emailReturned if a user is found with the provided email.
{
"status": 200,
"success": true,
"message": "Email already exists",
"data": {
"createdAt": "2024-09-04T12:00:00.000Z",
"existsInCurrentOrganization": true,
"code": "EMAIL_EXISTS"
}
}
▶200User found by phone numberReturned if a user is found with the provided phone-number.
{
"status": 200,
"success": true,
"message": "Phone number already exists",
"data": {
"createdAt": "2024-09-04T12:00:00.000Z",
"existsInCurrentOrganization": false,
"code": "PHONE_NUMBER_EXISTS"
}
}
▶200User not foundReturned if the user does not exist in the system.
{
"status": 200,
"success": false,
"message": "User does not exist",
"data": {
"code": "USER_NOT_FOUND"
}
}
▶400Missing parametersReturned if both email and phone-number query parameters are missing.
{
"status": 400,
"success": false,
"message": "Email or phone number is required."
}
▶401Invalid API keyReturned if the cv-api-key is missing or invalid.
{
"status": 401,
"error": "Invalid request"
}