Cookest
Backend APIEndpoints

Profile & Preferences

User profile, dietary preferences, favourites, and history

Profile & Preferences

GET /api/me

Get the authenticated user's profile.

MethodPathAuthTier
GET/api/meJWT BearerFree

Response 200 OK

{
  "id": "uuid",
  "email": "user@example.com",
  "name": "Alice",
  "household_size": 2,
  "dietary_restrictions": ["vegetarian"],
  "allergies": ["nuts"],
  "health_goals": ["weight_loss"],
  "cooking_skill": "intermediate",
  "tier": "pro",
  "created_at": "2024-01-15T10:00:00Z"
}

PUT /api/me

Update the authenticated user's profile.

MethodPathAuthTier
PUT/api/meJWT BearerFree

Request body (all fields optional)

{
  "name": "Alice Smith",
  "household_size": 3,
  "dietary_restrictions": ["vegetarian", "gluten_free"],
  "allergies": ["nuts", "shellfish"],
  "health_goals": ["muscle_gain"],
  "cooking_skill": "advanced"
}

Response 200 OK

Returns the updated user profile object.


GET /api/me/preferences

Get the user's learned taste preference vectors.

MethodPathAuthTier
GET/api/me/preferencesJWT BearerFree

Response 200 OK

{
  "cuisine_weights": {
    "italian": 0.85,
    "asian": 0.72,
    "mediterranean": 0.91
  },
  "difficulty_weights": {
    "easy": 0.60,
    "medium": 0.80,
    "hard": 0.30
  },
  "ingredient_weights": {
    "chicken": 0.90,
    "pasta": 0.75,
    "broccoli": 0.65
  }
}

These weights are updated automatically by the online learning algorithm when users rate or complete recipes.


DELETE /api/me/preferences

Reset all preference weights to neutral (0.5).

MethodPathAuthTier
DELETE/api/me/preferencesJWT BearerFree

Response 200 OK

{ "message": "Preferences reset successfully" }

GET /api/me/favourites

List the user's saved/bookmarked recipes.

MethodPathAuthTier
GET/api/me/favouritesJWT BearerFree

Query parameters

ParameterTypeDescription
limitintegerMax results (default: 20)
offsetintegerPagination offset

Response 200 OK

{
  "items": [
    {
      "id": "uuid",
      "title": "Pasta Carbonara",
      "cuisine": "italian",
      "difficulty": "medium",
      "prep_time": 10,
      "cook_time": 20,
      "calories": 520,
      "image_url": "https://..."
    }
  ],
  "total": 14,
  "limit": 20,
  "offset": 0
}

GET /api/me/history

Get the user's cooking history (recipes they have cooked).

MethodPathAuthTier
GET/api/me/historyJWT BearerFree

Query parameters

ParameterTypeDescription
limitintegerMax results (default: 20)
offsetintegerPagination offset

Response 200 OK

{
  "items": [
    {
      "recipe_id": "uuid",
      "title": "Pasta Carbonara",
      "cooked_at": "2024-01-20T18:30:00Z",
      "servings": 2
    }
  ],
  "total": 42
}

GET /api/me/push-tokens

List registered push notification tokens for the user.

MethodPathAuthTier
GET/api/me/push-tokensJWT BearerFree

Response 200 OK

[
  {
    "id": "uuid",
    "token": "ExponentPushToken[...]",
    "platform": "ios",
    "created_at": "2024-01-15T10:00:00Z"
  }
]

POST /api/me/push-tokens

Register a device push token.

MethodPathAuthTier
POST/api/me/push-tokensJWT BearerFree

Request body

{
  "token": "ExponentPushToken[xxxxxxxxxxxxxxxxxxxxxx]",
  "platform": "ios"
}

platform values: ios | android | web

Response 201 Created

{
  "id": "uuid",
  "token": "ExponentPushToken[...]",
  "platform": "ios"
}

DELETE /api/me/push-tokens/:id

Remove a push token (e.g., on logout).

MethodPathAuthTier
DELETE/api/me/push-tokens/:idJWT BearerFree

Response 204 No Content

StatusMeaning
404Token not found or belongs to another user

On this page