Skip to main content
Version: 2023-10-04

Create User

You can create a user using our API. In order to create an account, you need to provide the following information:

Endpoint Url

EnvironmentUrl
Sandboxhttps://partners-sandbox.ftmtapi.com/users/create
Prodhttps://partners.ftmtapi.com/users/create

Request

FieldTypeDescriptionRequiredFormat
emailstringThe email address of the user (unique ID).Yes
firstnamestringThe firstname of the user.Yes
lastnamestringThe lastname of the user.Yes
phonenumberstringThe phone number of the user.Yes
dateOfBirthdateThe date of birth of the user.YesYYYY-MM-DD
genderstringThe gender at birth of the user.Nomale / female DEPRECATED
sexstringThe gender at birth of the user.Yesmale / female / intersex
heightstringThe height in ft and inches of the user.Yesfield format: Xft Yin eg: 6ft 1in
pregnantbooleanIs the user pregnant?Notrue/false will be false by default
diabetesnumberInformation if the patient has diabetesYes0 if not diabete
2 for Type-1
3 for Type-2
glp1drugsbooleanIs the patient taking GLP-1 drugsYestrue/false
paymentPlannumberPeriodicity of the planYes1, 6 or 12
planStartDatedateWhen is the program supposed to startYesYYYY-MM-DD
medicalClearancestringConfirm medical clearance for exerciseYesfull or low or nutrition
medicalClearanceDescriptionstringA description of the medical clearanceNoeg. Yes, provided medical clearance
currentWeightstringPatient current weight in LbsYesReplacing weight
desiredWeightstringPatient desired weight in LbsNo
allergiesstringList of allergiesNo
nutritionPreferencesstringList of preferencesNo
religiousDietaryRestrictionsstringList of restrictionsNo
doctorFullnamestringFullname of the DoctorNo
metadataobjectAdditional information about the user.No{key: value}

Payload example

const payload = {
email: 'jane@doe.com',
firstname: 'jane',
lastname: 'doe',
phonenumber: '1234567890',
dateOfBirth: '1990-12-23',
gender: 'female',
height: '5ft 6in',
pregnant: false,
diabetes: 0,
glp1drugs: false,
paymentPlan: 1,
planStartDate: '2023-10-30',
medicalClearance: "full",
medicalClearanceDescription: "Yes, provided medical clearance",
currentWeight: 130,
desiredWeight: 110,
allergies: "no allergies",
nutritionPreferences: "vegan, gluten free",
religiousDietaryRestrictions: "no pork",
doctorFullname: "Dr. Mike Smith",
metadata: {
key: 'value',
...
},
}

Response

Response is always in JSON format.

{
"message": "User created successfully",
"email": "jane@doe.com",
"identifier": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
}

Full example of a call made with axios

const axios = require('axios');

const res = await axios({
url: 'https://partners.ftmtapi.com/users/create',
method: 'post',
data: {
email: 'jane@doe.com',
firstname: 'jane',
lastname: 'doe',
phonenumber: '1234567890',
dateOfBirth: '1990-12-23',
gender: 'female',
height: '5ft 6in',
weight: 130,
pregnant: false,
diabetes: 0,
glp1drugs: false,
paymentPlan: 1,
planStartDate: '2023-10-30',
medicalClearance: "full",
medicalClearanceDescription: "Yes, provided medical clearance",
currentWeight: 130,
desiredWeight: 110,
allergies: "no allergies",
nutritionPreferences: "vegan, gluten free",
religiousDietaryRestrictions: "no pork",
doctorFullname: "Dr. Mike Smith",
metadata: {
glp1Dosage: '10mg',
}
},
headers: {
Authorization: 'Bearer <YOUR_API_KEY>',
'Fitmate-Version': '2023-10-04',
}
});

Errors

The API offers some check and returns errors in the following scenario

Error codeBody Response
409Email already exists
400Invalid email address
409Phone number already exists
400Invalid phone number

We will update this list as we grow our API.

Emails trigger

Once an account is created via the API, an email is automatically sent to the customer with a magic link to log into our App.

We may allow in the future to turn off this email.