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
| Environment | Url |
|---|---|
| Sandbox | https://partners-sandbox.ftmtapi.com/users/update |
| Prod | https://partners.ftmtapi.com/users/update |
Request fields
| Field | Type | Description | Required | Format |
|---|---|---|---|---|
email | string | The email address of the user (unique ID). | Yes | |
glp1drugs | boolean | Does the user take GLP-1 drugs? | No | true/false |
diabetes | number | Does the user have diabetes? | No | 0 if not diabete 1 if pre-diabetes2 for Type-13 for Type-2 |
doctorFullname | string | Doctor full name | No | Dr. House |
medicalClearanceDescription | string | Any description of the medical clearence | No | |
metadata | object | Additional 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',
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',
}
});