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
  • Sensitive Profile Attributes
  • Decrypted attributes
  • ​Generating Keys

Was this helpful?

  1. Suggestic API Reference
  2. Mutations
  3. Users

Sensitive Profile Attributes

PreviousRequest Password Reset emailNextUpdate Profile

Last updated 1 year ago

Was this helpful?

Sensitive Profile Attributes

This mutation creates user profile attributes using Asymmetric Encryption each partner needs to have its Public and Private Keys 🔑

Argument

Type

Required

Description

attributes

String!

True

Encrypted profile attributes, this should be a valid JSON encrypted string

mutation {
  sensitiveProfileAttributes(
    attributes: "ZnlnY1QImbEse19xxr3tLulEzWxiRQTk4h2D4IYZkzCj+wwKhTlqQfi9PSs5I+BH4h/A2pIFiitweny3bK7dOKF2lkwtNPRKNu/VXWA423sQVdZct1w1pe6MExFhNm7r/y4rseJs+i30gsDC3EMo3tPgbiYB2UXMMKfe34cSb0xP1pnSTPHs+feyzSASojxl7bkoZ+nN9/rwpdPpsZ10ncO4CvYLVTZBiep7y/TC5HSQZCRGfHfAdFzYTYfgdD17gskvwvGUvdRJuFxEEYHZUze+uqBzg36nbQQzCLMzqyFFS0iuYTEvZt01iDprnIdZGAP+nElmc7yJGb+5yXvGdLutWjntACcQUFzqRKaX/RrWoxOg+zHQvIJ78VY51ReL0vRQrOlV4Nh83aBGki395A40tTMHMJpqUm8kDAfu7RoCZlTVWfVo09BrrRUAFnBfrAejSiIwcxIp98qZhyIQtoq8zxBl2JqxrYpgWes/DIo1AguBVN5Lwh+YTU3oL68Wfwh3ULlR6hCAQ9Cf/NsT5bUx9/F8epOY5ExhACZV+/W1qLjJwYx8NH+OKXxzIEXtbS3RAZehlxTMDj2PLqzd5tA1dhE+NR4HTiWSCFbv+mDY8xHtuw/AtRd587gynUVfBHuyNSKl0dFgLGIHydC9zG3K2z6kWbaxeR9OtVU0fTV1ulPf+wE3MeZQUlweBYqtUJP2/JZheNcU+pEfdkJlPMukqKSyRbgBkSM3ZTaXsdrGZF1eZicWiYAj+2cXv2MFZffg6kjZlGovW/PLQSAGgmnJJw7UbTIbMlxNMaZOlOnPwmUWGpsW8+j6O46BtH3fe5HF9ucu3gUpmBLmn9kJJcZ/nB+a/YuW/DUlInWo0SzpO9PJSaXXQmvgu6y5gO044maeFRQA65jlf8f3/gL0bSiEZQUwrzKGilvE7S8pBSkstaELE3HVqVFbB/RnUat/zJWIynu0wWeYxpfeu0l6X3va8/iisSLGJByEnY4SF+FElMICHBxZgTl8j88od+F67aeHY5qtJhbbzIwQqtWxNPAh8aNTjYEYe5RgIFw3YpNvs3v8NOT26iwX/AW7fqtWwq8cq4qzgLHR8BOEFSrrHTrUMh0wIuHJG1OyuK6hbqD0E2YRgmd5KYON8kgeNOpABUTcKblIDYAA4vq032VT0v9AfvILXeMyVcxZNYSrA7XMDoWWYHkjXDTcKF1xsw90IKmUIDKyKOPLwnP15fbnWObw2WZVtRl8md+Wg040iEj68zLEqML1tCHyaPFzBHltPOlS+VhUrgiwmekEy4CLUORxkXqVa1was8l/NHT6zVdpavLcrGHEOHwpO5XeekTSrfJvRg7TGqfePh0252L6IHWTpSDLaGAQIUybWKaOccyla7mehjVybiOUO1FHg2rlrKxu1eqPK71RtDtF9566VbI9INBNNSUeH0yNAjjJSV9AWuRHW9q8KEoYjst6iC/ym6P+/nh0SEZeNxbIPOFqP5DOxmWvw2/4yzzlloyCzfYHqb2nOinUfdJvAO/s+f0wPexmx6NT9Fx84kQEkPIYVEvpNUxpPUSgKq7i492Kj/reX3QXjOMAj/bMO2RTTRLqTlZZW9dfN/fpHDSgKuGHhrDiVkqAstVzMymVnECtuY9//kBUdanfjdbTXR/fN11/H80AwhJmYGX+9VnDFENRp/gWjKqYSa63rel9Agln4rpCWQ0oI3xyIA41sKjzE3s3Y8DbEYKbnhlvSC8dCxxhEjVUIIkupZBXKOY45nFshFGrmWp1rFx1Vxmn3KFTXCSjcFcaaoLirLYvG3KFLMgrI3AbGnfa00twrdQR/t3jZvc="
  ) {
    success
    errors {
      field
      messages
    }
  }
}

Decrypted attributes

Attributes structure should be the same as ​

[
      {
        name: "Carbohydrate Metabolism",
        dataType: STRING,
        value: "Slow"
      },
      {
        name: "Gluten Sensitivity",
        dataType: INT,
        value: 1
      },
      {
        name: "Lactose Tolerance",
        dataType: FLOAT,
        value: 1.4
        },
      {
        name: "Fiber Need",
        dataType: BOOLEAN,
        value: true
      }
]

​Generating Keys

# Private key
openssl genrsa -out privkey.pem 2048
# Public key
openssl rsa -in privkey.pem -pubout -out pubkey.pem

You can now share your 🔑 pubkey.pem with Suggestic, this way we can decode users' attributes on or end.

Store securely and do not share your privkey.pem key 🔑

Once the public and private keys are created you can then use them to encode users attributes using JWT RS256

import jwt
# Encoding user attr in partners end
private_key = b"-----BEGIN PRIVATE KEY-----\nMIGEAgEAMBAGByqGSM49AgEGBS..."
public_key = b"-----BEGIN PUBLIC KEY-----\nMHYwEAYHKoZIzj0CAQYFK4EEAC..."
encoded = jwt.encode(
    {"name": "Carbohydrate Metabolism"},
    private_key,
    algorithm="RS256"
)
print(encoded)
eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzb21lIjoicGF5bG9hZCJ9.4twFt5NiznN84AWoo1d7KO1T_yoc0Z6XOpOVswacPZg

# Decoding - this happens in Suggestic end
decoded = jwt.decode(encoded, public_key, algorithms=["RS256"])
{'name': 'Carbohydrate Metabolism'}

In order to encrypt users' profile attributes will need to create a private and public key, this can be achieved using .

CustomProfileAttribute
OpenSSL