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
| Environment | Url |
|---|---|
| Sandbox | https://partners-sandbox.ftmtapi.com/users/create |
| Prod | https://partners.ftmtapi.com/users/create |
Request
| Field | Type | Description | Required | Format |
|---|---|---|---|---|
email | string | The email address of the user (unique ID). | Yes | |
firstname | string | The firstname of the user. | Yes | |
lastname | string | The lastname of the user. | Yes | |
phonenumber | string | The phone number of the user. | Yes | |
dateOfBirth | date | The date of birth of the user. | Yes | YYYY-MM-DD |
gender | string | The gender at birth of the user. | No | male / female DEPRECATED |
sex | string | The gender at birth of the user. | Yes | male / female / intersex |
height | string | The height in ft and inches of the user. | Yes | field format: Xft Yin eg: 6ft 1in |
pregnant | boolean | Is the user pregnant? | No | true/false will be false by default |
diabetes | number | Information if the patient has diabetes | Yes | 0 if not diabete 2 for Type-13 for Type-2 |
glp1drugs | boolean | Is the patient taking GLP-1 drugs | Yes | true/false |
paymentPlan | number | Periodicity of the plan | Yes | 1, 6 or 12 |
planStartDate | date | When is the program supposed to start | Yes | YYYY-MM-DD |
medicalClearance | string | Confirm medical clearance for exercise | Yes | full or low or nutrition |
medicalClearanceDescription | string | A description of the medical clearance | No | eg. Yes, provided medical clearance |
currentWeight | string | Patient current weight in Lbs | Yes | Replacing weight |
desiredWeight | string | Patient desired weight in Lbs | No | |
allergies | string | List of allergies | No | |
nutritionPreferences | string | List of preferences | No | |
religiousDietaryRestrictions | string | List of restrictions | No | |
doctorFullname | string | Fullname of the Doctor | No | |
metadata | object | Additional 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 code | Body Response |
|---|---|
409 | Email already exists |
400 | Invalid email address |
409 | Phone number already exists |
400 | Invalid 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.