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
| Field | Type | Description | Required | Format |
|---|---|---|---|---|
email | string | The email address of the user (unique ID). | Yes | |
firstname | string | The firstname of the user. | No | |
lastname | string | The lastname of the user. | No | |
phonenumber | string | The phone number of the user. | No | |
dateOfBirth | date | The date of birth of the user. | No | YYYY-MM-DD |
gender | string | The gender at birth of the user. | No | male / female |
height | string | The height in ft and inches of the user. | No | |
weight | string | The weight in lbs of the user. | No | |
pregnant | boolean | Is the user pregnent? | No | true/false |
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',
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',
}
});