Skip to main content
GET
/
problematic-foods
curl --request GET \
  --url https://api.ceboelha.com/problematic-foods \
  --header 'Authorization: Bearer YOUR_TOKEN'
{
  "success": true,
  "data": [
    {
      "_id": "507f1f77bcf86cd799439011",
      "userId": "507f191e810c19729de860ea",
      "foodId": 1234,
      "foodName": "Onion",
      "totalIncidents": 3,
      "lastIncident": "2024-03-15",
      "status": "confirmed",
      "incidents": [
        {
          "diaryEntryId": "507f1f77bcf86cd799439012",
          "date": "2024-03-15",
          "symptomTypes": ["bloating", "gas", "cramps"],
          "intensity": 4,
          "notes": "Ate raw onion in salad, symptoms within 2 hours"
        },
        {
          "diaryEntryId": "507f1f77bcf86cd799439013",
          "date": "2024-03-10",
          "symptomTypes": ["bloating", "gas"],
          "intensity": 3
        },
        {
          "diaryEntryId": "507f1f77bcf86cd799439014",
          "date": "2024-03-05",
          "symptomTypes": ["bloating"],
          "intensity": 2
        }
      ],
      "createdAt": "2024-03-05T10:30:00.000Z",
      "updatedAt": "2024-03-15T14:20:00.000Z"
    }
  ]
}
Returns a list of all foods that have been marked as problematic, including incident history and current status.
All problematic foods API endpoints require authentication via Bearer token.

Authentication

header.Authorization
string
required
Bearer token for authentication. Format: Bearer YOUR_TOKEN

Response

success
boolean
required
Indicates whether the request was successful.
data
object[]
required
Array of problematic food records.
curl --request GET \
  --url https://api.ceboelha.com/problematic-foods \
  --header 'Authorization: Bearer YOUR_TOKEN'
{
  "success": true,
  "data": [
    {
      "_id": "507f1f77bcf86cd799439011",
      "userId": "507f191e810c19729de860ea",
      "foodId": 1234,
      "foodName": "Onion",
      "totalIncidents": 3,
      "lastIncident": "2024-03-15",
      "status": "confirmed",
      "incidents": [
        {
          "diaryEntryId": "507f1f77bcf86cd799439012",
          "date": "2024-03-15",
          "symptomTypes": ["bloating", "gas", "cramps"],
          "intensity": 4,
          "notes": "Ate raw onion in salad, symptoms within 2 hours"
        },
        {
          "diaryEntryId": "507f1f77bcf86cd799439013",
          "date": "2024-03-10",
          "symptomTypes": ["bloating", "gas"],
          "intensity": 3
        },
        {
          "diaryEntryId": "507f1f77bcf86cd799439014",
          "date": "2024-03-05",
          "symptomTypes": ["bloating"],
          "intensity": 2
        }
      ],
      "createdAt": "2024-03-05T10:30:00.000Z",
      "updatedAt": "2024-03-15T14:20:00.000Z"
    }
  ]
}

Notes

  • Results are sorted by lastIncident in descending order (most recent first)
  • Status automatically changes to confirmed after 3 or more incidents
  • Each user can only have one record per foodId (enforced by unique compound index)

Build docs developers (and LLMs) love