curl --request PUT \
--url https://api.example.com/api/profile \
--header 'Content-Type: application/json' \
--data '
{
"goal": "<string>",
"height": 123,
"weight": 123,
"body_type": "<string>",
"gender": "<string>",
"meals_per_day": 123,
"activity_level": "<string>",
"birth_date": "<string>",
"body_fat_percentage": 123,
"calories_target": 123,
"protein_target": 123,
"carbs_target": 123,
"fat_target": 123,
"tastes": [
{
"id": 123,
"name": "<string>"
}
],
"restrictions": [
{
"id": 123,
"name": "<string>"
}
],
"diet_types": [
{}
]
}
'{
"id": 123,
"user_id": 123,
"goal": "<string>",
"height": 123,
"weight": 123,
"body_type": "<string>",
"gender": "<string>",
"meals_per_day": 123,
"activity_level": "<string>",
"birth_date": "<string>",
"body_fat_percentage": 123,
"calories_target": 123,
"protein_target": 123,
"carbs_target": 123,
"fat_target": 123,
"tastes": [
{}
],
"restrictions": [
{}
],
"diet_types": [
{}
],
"422 Unprocessable Entity": {},
"401 Unauthorized": {}
}Create or update the authenticated user’s profile with fitness goals, body metrics, dietary preferences, and nutritional targets
curl --request PUT \
--url https://api.example.com/api/profile \
--header 'Content-Type: application/json' \
--data '
{
"goal": "<string>",
"height": 123,
"weight": 123,
"body_type": "<string>",
"gender": "<string>",
"meals_per_day": 123,
"activity_level": "<string>",
"birth_date": "<string>",
"body_fat_percentage": 123,
"calories_target": 123,
"protein_target": 123,
"carbs_target": 123,
"fat_target": 123,
"tastes": [
{
"id": 123,
"name": "<string>"
}
],
"restrictions": [
{
"id": 123,
"name": "<string>"
}
],
"diet_types": [
{}
]
}
'{
"id": 123,
"user_id": 123,
"goal": "<string>",
"height": 123,
"weight": 123,
"body_type": "<string>",
"gender": "<string>",
"meals_per_day": 123,
"activity_level": "<string>",
"birth_date": "<string>",
"body_fat_percentage": 123,
"calories_target": 123,
"protein_target": 123,
"carbs_target": 123,
"fat_target": 123,
"tastes": [
{}
],
"restrictions": [
{}
],
"diet_types": [
{}
],
"422 Unprocessable Entity": {},
"401 Unauthorized": {}
}Authorization: Bearer <token>
lose_weight, maintain_weight, gain_weightlean, normal, stocky, obesemale, femalelow, medium, highhigh_protein, low_carb, vegan, vegetarian, low_calorie, high_fiber, high_carbcurl -X PUT "https://api.smarteat.com/api/profile" \
-H "Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9..." \
-H "Content-Type: application/json" \
-d '{
"goal": "lose_weight",
"height": 175.0,
"weight": 80.5,
"body_type": "normal",
"gender": "male",
"meals_per_day": 4,
"activity_level": "medium",
"birth_date": "1990-05-15",
"body_fat_percentage": 18.5,
"calories_target": 2200.0,
"protein_target": 165.0,
"carbs_target": 220.0,
"fat_target": 73.0,
"tastes": [
{"name": "spicy"},
{"name": "savory"}
],
"restrictions": [
{"name": "lactose intolerance"}
],
"diet_types": ["high_protein"]
}'
{
"id": 1,
"user_id": 42,
"goal": "lose_weight",
"height": 175.0,
"weight": 80.5,
"body_type": "normal",
"gender": "male",
"meals_per_day": 4,
"activity_level": "medium",
"birth_date": "1990-05-15",
"body_fat_percentage": 18.5,
"calories_target": 2200.0,
"protein_target": 165.0,
"carbs_target": 220.0,
"fat_target": 73.0,
"tastes": [
{
"id": 1,
"name": "spicy"
},
{
"id": 3,
"name": "savory"
}
],
"restrictions": [
{
"id": 2,
"name": "lactose intolerance"
}
],
"diet_types": [
{
"id": 5,
"name": "high_protein"
}
]
}
{
"detail": [
{
"loc": ["body", "height"],
"msg": "ensure this value is greater than or equal to 140",
"type": "value_error.number.not_ge"
}
]
}
{
"detail": "Not authenticated"
}
tastes and restrictions arrays are automatically converted to lowercasebirth_date is validated to ensure the user is between 16 and 100 years old