Skip to main content
Version: Next

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.

Endpoint Url

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

Request fields

FieldTypeDescriptionRequiredFormat
emailstringThe email address of the user (unique ID).Yes
glp1drugsbooleanDoes the user take GLP-1 drugs?Notrue/false
diabetesnumberDoes the user have diabetes?No0 if not diabete
1 if pre-diabetes
2 for Type-1
3 for Type-2
doctorFullnamestringDoctor full nameNoDr. House
medicalClearanceDescriptionstringAny description of the medical clearenceNo
metadataobjectAdditional information about the user.Nokey: 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',
glp1drugs: true,
diabetes: 0,
doctorFullname: 'Dr. House',
medicalClearanceDescription: "Your medical clearance description",
metadata: {
key: 'value',
...
}
}

Response

Response is always in JSON format.

{
"message": "User updated successfully",
"identifier": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
"data": {
"email": "jane@doe.com",
"diabetes": 0,
"glp1drugs": true,
"doctorFullname": "Dr. House",
"medicalClearanceDescription": "Your medical clearance description",
"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',
glp1drugs: false,
diabetes: 1,
doctorFullname: 'Dr. House',
medicalClearanceDescription: "Your medical clearance description",
},
headers: {
Authorization: 'Bearer <YOUR_API_KEY>',
'Fitmate-Version': '2023-08-22',
}
});