Skip to main content
Version: 2023-08-01

Create User

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

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.Yesmale / female
heightstringThe height in ft and inches of the user.Yes
weightstringThe weight in lbs of the user.Yes
pregnantbooleanIs the user pregnent?Yestrue/false
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',
weight: 130,
pregnant: false,
metadata: {
key: 'value',
foodRestricition: 'vegan',
...
},
}

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,
},
headers: {
Authorization: 'Bearer <YOUR_API_KEY>',
'Fitmate-Version': '2023-08-01',
}
});

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.