Technical Docs
  • Introduction
  • Guides
    • Getting Started
    • Attribution Guidelines
    • Core Concepts
      • Adherence Score
      • Programs, Diets, and Rulesets
      • User Profile
      • Datasets
    • Tutorials and Walkthroughs
      • Creating a Meal Plan
      • Food Log Guide
      • Pagination
      • Executing Multiple Mutations
  • Knowledge Base
    • How-to guides
      • How to add desserts to your meal plan
      • How to log your custom recipe
      • How to generate a Meal Plan based on a template
    • Common errors
      • Meal Plan generation
    • FAQs
      • Getting Started on Suggestic
      • API and Authentication
      • Device Compatibility
      • Meal Plan
      • Nutrition
      • Programs
      • Recipes
  • HELPFUL RESOURCES
    • Deprecated Features
    • Glossary
    • Integrations
      • Building a No-code Meal Planning Application
        • Step 1: Creating the Integromat Scenario and Google Forms Connection
        • Step 2: Creating a User, Generating a Meal Plan, and Retrieving It
        • Step 3: Crafting Our PDF and Connecting PDFMonkey
        • Step 4: Sending The Document to Our User
  • Packages and SDKs
    • Node Package (NPM)
  • GraphQL
    • GraphQL Overview
    • Authentication
    • Calling GraphQL
    • GraphQL Playground
  • Changelog
    • 2025
      • March
  • Suggestic API Reference
    • Search
      • Food Log
        • Branded Foods Search
        • Common Foods Search
        • My Branded Food Search
        • My Common Foods Search
        • Food Search
        • Legacy
          • Autocomplete
          • Barcode Search
      • Recipe Search
        • Recipe Search
        • Recipe Search by Name or Ingredients
        • Recipe Search by Ingredients
      • Meal Plan Template Search
      • Profile Search
      • Restaurant Search
        • Restaurant Search by Location
        • Restaurant Search
    • Queries
      • Appointments
        • Upcoming Appointments
        • Past Appointments
        • Appointments Types
      • Assessments
        • Assessment Answers
        • Display Assessments
        • Supplement Recommendations
        • User Assessments
      • Content
        • Content Library
        • Content Categories
        • Content Tags
        • Journey
      • Food Log
        • Frequently Logged
        • Food Log Entries
        • Macros Aggregation
        • Micronutrients Aggregation
        • Macro Goals
        • Recently Logged
        • User's Foods and Recipes
          • User's Recipes
        • Legacy
          • Food Log Entries (Legacy)
          • Own Food Items
          • Own Food Item
          • Own Food Item by Id
          • Own Items
          • Own Recipe
          • Own Recipes
      • Lab Tests
        • Biomarker Categories
        • Biomarker Units
        • Biomarker Catalog
        • Biomarkers
        • Biomarker Results
        • Historical Biomarker Results
        • Historical Results by Biomarker
        • Lab Test Reports
        • Recommended Supplements
        • Recommended Articles
      • Meal Plan
        • Meal Plan
        • Custom Meal Plan
        • Simplified Meal Tracking
          • Meal Tracker
        • Meal Plan Config
        • Meal Planner (deprecated)
      • Program
        • All Programs
        • Program Details
      • Recipes
        • Equivalent Recipes (Macros)
        • Equivalent Recipes (Calories)
        • Recipe by Id
        • Recipes By MealTime
        • Recipes By Tag
        • Recipe Swap Options
        • Popular Recipes
        • Favorite Recipes
        • Premium Program Recipes
      • Restaurants
        • Restaurant By Id
        • Menu Items
        • Menu Item By Id
        • Menu Item by Program
        • Recommend Menu Items
      • Restrictions
        • Restrictions
        • Restriction by ID
      • Shopping List
        • Shopping List by Aisle
        • Shopping List by Recipes
      • Subscriptions
        • Subscription List
      • Supplement Plans
        • Supplement plan list
        • Supplement list
      • Tracking
        • Activity and Exercise
        • Checklists
          • Intake Checklist
        • Daily Recap
          • Get Daily Recap
          • Get Daily Recaps
          • Get Daily Recap Questions
          • Get Daily Mood Summary
        • Inisghts
        • Wellness Score
        • Sleep
          • Sleep Time
          • Sleep Quality Score
        • Steps
        • Water and Hydration
        • Heart Rate
        • HRV
        • Weight Tracker
      • USDA Food
      • Users
        • Users
        • User Profile
      • WGPT
        • Assistants
        • Journey
        • Guardrails
    • Mutations
      • Appointments
        • Update Appointment Credits
      • Assessments
        • New User Assessments
        • Set User Answers
      • Content
        • Mark Content as Read
      • Feedback
      • Food Log
        • Log Entries
          • Food Log
            • Add a Food Log Entry
            • Delete a Food Log Entry
          • Meal Log (Legacy)
            • Create Log Entry
            • Update Log Entry
            • Remove Log Entry
        • User's Foods and Recipes
          • Create a User Recipe
          • Create my Branded Food
          • Create my Common Foods
          • Update a User Recipe
          • Delete a User Recipe
          • Legacy: "Own" Recipe
            • Create "Own" Recipe
            • Update "Own" Recipe
            • Remove "Own" Recipe
        • AI Food Log
          • Process Ai Food
        • Legacy (ownFoods and ownRecipes)
          • Create "own" Food Item
          • Update "own Food"
          • Remove "own" Food Item
      • Journey Status
        • Start Journeys
        • Journey Status
        • Toggle Task Completed
      • Lab Tests
        • Add Biomarker
        • Update Biomarker
        • Add Biomarker Result
        • Add Biomarker Category
        • Update Biomarker Category
        • Remove Biomarker Category
        • Add Lab Test Report
        • Delete Lab Test Report
        • Update Lab Test Report
        • Create Recommended Supplement
        • Update Recommended Supplement
        • Remove Recommended Supplement
        • Create Recommended Article
        • Update Recommended Article
        • Remove Recommended Supplement
      • Meal Plan
        • Create Meal Plan Template
          • Custom Options
          • From Days
          • From Scratch
        • Assign a Meal Plan Template to a User
        • Generate Simple Meal Plan
        • Generate Meal Plan
        • Start Over Meal Plan
        • Swap Meals
        • Simplified Meal Tracking
          • Create a Meal Tracker Entry
        • Remove Meal Plan
        • Remove Meal Plan Recipe
      • Recipes
        • Add new recipe
        • Add Favorite Recipe
      • Shopping List
        • Add Multiple Recipes to the Shopping List
        • Add a Recipe to the Shopping List
        • Bulk Check/Uncheck Items
        • Check/Uncheck an Item
        • Clear Checked Items
        • Clear Shopping List
        • Remove Recipe
        • Update Serving Number
      • Subscriptions
        • Update Subscription
      • Supplement Plans
        • Create supplement plan for user
        • Update user supplement plan
        • Add Supplement
        • Update Supplement
      • Tracking
        • Activity and Exercise
          • Add Exercise Entry
          • Delete Exercise Entry
        • Checklists
          • Create my Checklist Item
          • Delete my Checklist Item
        • Daily Recap
          • Create a daily recap question
          • Select Daily Recap Questions
          • Delete a Daily Recap Question
        • Sleep
          • Add Sleep Time
          • Add Sleep Quality Score
        • Steps
          • Add Steps Count
          • Delete Steps Count
        • Heart Rate
          • Add Heart Rate
          • Delete Heart Rate
        • HRV
          • Add HRV
          • Delete HRV
        • Water and Hydration
        • Weight
          • Add Weight Entry
          • Remove Weight Entry
        • User Tracker Goals
          • Create User Goal
          • Update User Goal
          • Remove User Goal
      • Users
        • Authenticate using a Magic Link
        • Create User
        • Custom Attributes
        • Delete a User Account
        • Login User
        • Merge User Accounts
        • Request Reset Password
        • Reset Password
        • Request Password Reset email
        • Sensitive Profile Attributes
        • Update Profile
        • Update User's Program
        • User's Restrictions
        • Update Meal Plan Settings
        • User's Goals
        • Legacy User Mutations
          • Legacy | User's Biomarkers
          • User's Meal Plan Settings (deprecated)
      • WGPT
        • Add user to journey
  • Objects
    • Appointments
      • Appointment
      • Appointment Type
      • Appointment Credit
      • Attendee
      • Coach
    • Common
      • User
      • Adherence
      • Aisle Name
      • CPC
      • CPCIngredientGroup
      • Meal Times
      • Menu Item
      • Own Serving
      • Own Nutrients
      • MacroNutrientsRangeInput
      • Range
      • Tracker
      • Restaurant
    • Food Logs
      • Food Filter
      • Ingredient Amount
      • Ingredients
      • Own Recipe Ingredient
      • Meal Type
      • Nutrients
        • Nutrient Enum
      • Portions
      • Servings
      • AI Food Log
        • Food Analysis
    • Meal Plan
      • Debug Meal Plan Conditions
      • Meal
      • Meal Plan Day
      • Maximum Time per Meal
      • Maximum Ingredient Count
      • Meal Plan Template
      • Simple Meal Plan Filters
    • Recipe
      • Recipe
        • Tags
        • Cuisines
      • Recipe Swap Options
      • Parsed Ingredient Lines
      • Nutritional Info
      • Nutrients Per Serving
      • Calories Per Serving
      • Relative Calories
      • Source
      • Ingredients
      • Units of Measurement
    • Lab Tests
      • Article
      • Biomarker
    • Supplement
    • Assessments
      • Question
      • Answer
    • Content
      • Content Library
      • Content Categories
      • Content Tag
    • WGPT
      • Journey
      • dayJourney
      • Interaction
  • Case Studies
    • Reverse Health Case Study
Powered by GitBook
On this page
  • Considerations to calculate your macros
  • Setup the goals
  • Define your macro goals to lose weight
  • Define your macros goals to gain weight
  • Available Arguments
  • Available Fields
  • Example
  • PHP Example

Was this helpful?

  1. Suggestic API Reference
  2. Mutations
  3. Users

User's Goals

Set user weight-related goals

PreviousUpdate Meal Plan SettingsNextLegacy User Mutations

Last updated 2 years ago

Was this helpful?

Use the profileMacroGoalsSettings mutation to determine and set up a user's weight-related goals based on personal information such as weight, height, activity level, etc. Check to know which fields are used to calculate a user's caloric daily requirement.

The information is saved and read in the metric unit (kilograms, grams, meters, centimeters, etc). We DO NOT do unit conversions.

You are responsible for Unit Conversion. Make sure your units are correct.

Considerations to calculate your macros

Setup the goals

If goals are set as "on", those will be used. However, If they are not set or are "off" then for meal planning purposes, the meal plan will default to the program's pre-defined goal settings.

The following profile attributes relate to the goals' functionality and can be set directly on the user's profile.

If goals are on and the mutation is used, all the information will be overwritten.

Define your macro goals to lose weight

If the goal is to lose weight, your targetWeight have to be less than the currentWeight.

Check the following equation:

targetWeight<startingWeighttargetWeight < startingWeight targetWeight<startingWeight

Then, define the rate to lose weight by choosing a weekly weight-related goal in the weeklyWeightGoalto add calories to the total daily expenditure.

Example:

You will have the following macros:

  • currentWeight: 80kg

  • targetWeight: 60kg

  • weeklyWeightGoal: GOAL_1 (lose 0.5 kg)

This means that the user's goal is to lose 0.5 kg per week until the target weight is reached.

Define your macros goals to gain weight

If the goal is to gain weight, your targetWeight have to be greater than the currentWeight.

Check the following equation:

targetWeight>startingWeighttargetWeight > startingWeighttargetWeight>startingWeight

Then, define the rate to lose weight by choosing a weekly weight-related goal in the weeklyWeightGoalto add calories to the total daily expenditure.

Example:

You will have the following macros:

  • currentWeight: 60kg

  • targetWeight: 80kg

  • weeklyWeightGoal: GOAL_1 (gain 0.5 kg)

This means that the user's goal is to gain 0.5 kg per week until the target weight is reached.

Available Arguments

Argument

is Required?

Type

Description

activityLevel

Yes

ActivityLevel

User's weekly activity level. Valid values are

- NOT_ACTIVE,

- EXERCISE_1 (1 - 2 times per week)

- EXERCISE_2 (3+ times per week) Use this to calculate your caloric daily requirement

biologicalSex

Yes

BiologicalSex

The biological sex of the user. Valid values are MALE and FEMALE Use this to calculate your caloric daily requirement

birthdate

Yes

Date

User's birthday. Use this to calculate your caloric daily requirement

goalsOn

Yes

Boolean

True if the goals functionality is enabled. Requires all other parameters to be set.

height

Yes

Float

The height of the user. Use this to calculate your caloric daily requirement . Expressed in centimeters

startingWeight

Yes

Float

The user's current weight. Use this to calculate your caloric daily requirement. Expressed in kilograms.

targetWeight

Yes

Float

The user's target weight. Use this to calculate your caloric daily requirement. Expressed in kilograms.

weeklyWeightGoal

Yes

WeeklyWeightGoal

User weekly weight-related goal. Depending on the user's goals, use this to gain, lose or maintain weight. Valid values are:

MANTAIN: maintain the weight,

GOAL_1: lose/gain 0.5 kg,

GOAL_2: lose/gain (1 kg),

GOAL_3: lose/gain (1.5 kg),

GOAL_4: lose/gain (4 kg) Use this to calculate your caloric daily requirement

Available Fields

The following field will be part of the response.

Field Name

Type

Description

success

Boolean

True if the user weight-related goals has been set successfully. Otherwise, False

The following fields are the result of the macro goals calculation:

Field Name

Type

Description

dcig

Int

Daily Caloric Intake Goal

Int

Caloric Difference between the daily caloric intake goal and the totaly daily energy expenditure

Int

Total Daily Energy Expenditure

Int

Basal Metabolic Rate calculated with the Harris–Benedict equation.

Int

Body Mass Index calculated from user's weight and height values.

Example

mutation {
  profileMacroGoalsSettings(
    goalsOn: true
    biologicalSex: FEMALE
    birthdate: "1982-01-10"
    height: 158 
    startingWeight: 70
    targetWeight: 58
    weeklyWeightGoal: GOAL_4
    activityLevel: EXERCISE_2
  ) {
    success
    bmr
    bmi 
    tdee 
    cd
    dcig 
  }
}
{
  "data": {
    "profileMacroGoalsSettings": {
      "success": true,
      "bmr": 1126,
      "bmi": 22,
      "tdee": 1576,
      "cd": 250,
      "dcig": 1326
    }
  }
}
{
  myProfile {
    id
    age
    birthdate
    biologicalSex
    activityLevel
    startingWeight
    customAttributes
    targetWeight
    height
    weeklyWeightGoal
    goalsOn
    programName
    language
    subscription{
      id
      createdAt
      name
    }
    restrictions {
      name
    }
    dailyCaloricIntakeGoal
		caloricDifference 
		totalDailyEnergyExpenditure
		basalMetabolicRate
		program {
		  databaseId,
		  name
      author
		}
  }
}
{
  "data": {
    "myProfile": {
      "id": "05d50bb8-20cd-461f-a15f-788dbe18fdbb",
      "age": 40,
      "birthdate": "1982-01-10",
      "biologicalSex": "FEMALE",
      "activityLevel": "EXERCISE_2",
      "startingWeight": 70,
      "customAttributes": "[{\"name\": \"Carbohydrate Metabolism\", \"value\": \"Slow\", \"data_type\": \"STRING\"}, {\"name\": \"Gluten Sensitivity\", \"value\": 1, \"data_type\": \"INT\"}, {\"name\": \"Lactose Tolerance\", \"value\": 1.4, \"data_type\": \"FLOAT\"}, {\"name\": \"Fiber Need\", \"value\": true, \"data_type\": \"BOOLEAN\"}]",
      "targetWeight": 58,
      "height": 1.58,
      "weeklyWeightGoal": "GOAL_4",
      "goalsOn": true,
      "programName": "Wheat Belly 10-Day Grain Detox",
      "language": "en",
      "subscription": {
        "id": "U3Vic2NyaXB0aW9uOjY4ZjM4YTkzLWE3YTYtNGRhMy1hYTU4LTFhNTBlNTE4N2I4Mg==",
        "createdAt": "2022-01-20T23:37:10.795183+00:00",
        "name": "Suggestic Default"
      },
      "restrictions": [
        {
          "name": "Yogurt"
        },
        {
          "name": "Beef"
        },
        {
          "name": "Chicken"
        }
      ],
      "dailyCaloricIntakeGoal": 1142,
      "caloricDifference": 1000,
      "totalDailyEnergyExpenditure": 2142,
      "basalMetabolicRate": 1428,
      "program": {
        "databaseId": "01bbd541-939b-4b85-8d90-48ff0b02d0ee",
        "name": "Wheat Belly 10-Day Grain Detox",
        "author": "Dr. William Davis"
      }
    }
  }
}

PHP Example

<?php

$token = 'TOKEN';
$user = 'USER';

$query = <<<'GQL'
mutation profileMacroGoalsSettings(
    $biologicalSex: BiologicalSex!
    $birthdate: Date!
    $height: Float!
    $startingWeight:Float!
    $targetWeight: Float!
    $weeklyWeightGoal: WeeklyWeightGoal!
    $activityLevel: ActivityLevel!
  ){
    profileMacroGoalsSettings(
      biologicalSex: $biologicalSex,
      birthdate: $birthdate,
      goalsOn: true,
      height: $height,
      startingWeight: $startingWeight,
      targetWeight: $targetWeight,
      weeklyWeightGoal: $weeklyWeightGoal,
      activityLevel: $activityLevel
    ) {
      success
      bmr
      bmi 
      tdee 
      cd
      dcig 
    }
  }
  
GQL;

$variables = array(
    'biologicalSex' => 'FEMALE',
    'birthdate' => '1983-04-09',
    'height' => 179.71,
    'startingWeight' => 83,
    'targetWeight' => 73,
    'weeklyWeightGoal' => 'GOAL_3',
    'activityLevel' => 'NOT_ACTIVE',
);

$json = json_encode(['query' => $query, 'variables' => $variables]);

$curl = curl_init();
curl_setopt_array($curl, array(
    CURLOPT_URL => 'https://production.suggestic.com/graphql',
    CURLOPT_CUSTOMREQUEST => 'POST',
    CURLOPT_POSTFIELDS => $json,
    CURLOPT_HTTPHEADER => array(
        'Authorization: Token ' . $token,
        'sg-user: ' . $user,
        'Content-Type: application/json',
    ) ,
));

$response = curl_exec($curl);
$result = curl_close($curl);
echo $result;

Check to see the valid values to define for the weeklyWeightGoal

Check to see the valid values to define for the weeklyWeightGoal

Execute the query to check these goals configured.

myProfile
updateMealPlanSettings
this information
this documentation
this documentation
cd
tdee
bmr
bmi