Skip to main content
Version: 2023-08-01

Update user

You can update a user using our API.

It is also possible to use this endpoint to add later metadata to a user.

Metadata is a key/value object that can be used to store any additional information about the user coming from your system that you are looking us to use for the benefit of your customers.

Request fields

FieldTypeDescriptionRequiredFormat
emailstringThe email address of the user (unique ID).Yes
firstnamestringThe firstname of the user.No
lastnamestringThe lastname of the user.No
phonenumberstringThe phone number of the user.No
dateOfBirthdateThe date of birth of the user.NoYYYY-MM-DD
genderstringThe gender at birth of the user.Nomale / female
heightstringThe height in ft and inches of the user.No
weightstringThe weight in lbs of the user.No
pregnantbooleanIs the user pregnent?Notrue/false
metadataobjectAdditional information about the user.No{key: value}
⚠️metadata will be replacing the existing values stored into it. If you want to add a new key/value pair, you need to provide all the existing ones.

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 updated successfully",
"identifier": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
"data": {
"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",
...
}
}

Full example of a call made with axios

const axios = require('axios');

const res = await axios({
url: 'https://partners.ftmtapi.com/users/update',
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',
}
});