Skip to main content
GET
/
api
/
profile
Get Profile
curl --request GET \
  --url https://api.example.com/api/profile
{
  "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": [
    {
      "id": 123,
      "name": "<string>"
    }
  ],
  "restrictions": [
    {
      "id": 123,
      "name": "<string>"
    }
  ],
  "diet_types": [
    {
      "id": 123,
      "name": "<string>"
    }
  ],
  "404 Not Found": {},
  "401 Unauthorized": {}
}

Authentication

This endpoint requires authentication. Include a valid JWT token in the Authorization header:
Authorization: Bearer <token>

Request

No parameters required. The profile is retrieved for the currently authenticated user.

Response

id
integer
required
Profile ID
user_id
integer
required
Associated User ID
goal
string
required
User’s fitness goalAllowed values: lose_weight, maintain_weight, gain_weight
height
float
required
User’s height in centimeters (140-220)
weight
float
required
User’s weight in kilograms (35-300)
body_type
string
required
User’s body typeAllowed values: lean, normal, stocky, obese
gender
string
required
User’s genderAllowed values: male, female
meals_per_day
integer
required
Number of meals per day (1-6)
activity_level
string
required
User’s activity levelAllowed values: low, medium, high
birth_date
string
required
User’s birth date in ISO format (YYYY-MM-DD). User must be 16-100 years old.
body_fat_percentage
float
User’s body fat percentage (optional, >= 0.0)
calories_target
float
User’s target calories (optional, >= 0.0)
protein_target
float
User’s target protein in grams (optional, >= 0.0)
carbs_target
float
User’s target carbs in grams (optional, >= 0.0)
fat_target
float
User’s target fat in grams (optional, >= 0.0)
tastes
array
List of user’s taste preferences
id
integer
Taste category ID
name
string
Taste category name (lowercase)
restrictions
array
List of user’s dietary restrictions
id
integer
Restriction category ID
name
string
Restriction category name (lowercase)
diet_types
array
List of user’s diet types
id
integer
Diet type category ID
name
string
Diet type name (lowercase)

Example Request

curl -X GET "https://api.smarteat.com/api/profile" \
  -H "Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9..."

Example Response

{
  "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"
    }
  ]
}

Error Responses

404 Not Found
error
Profile does not exist for the authenticated user
{
  "detail": "Profile not existing."
}
401 Unauthorized
error
Authentication token is missing or invalid
{
  "detail": "Not authenticated"
}

Build docs developers (and LLMs) love