Skip to main content

Endpoint

POST /diary/symptom

Authentication

This endpoint requires authentication via Bearer token.
Authorization: Bearer <token>

Request Body

date
string
required
Date of the symptom in YYYY-MM-DD format (e.g., “2024-03-15”)
symptom
object
required
Symptom data object
type
string
required
Type of symptom. Options: bloating, gas, cramps, nausea, diarrhea, constipation, reflux, fatigue, headache, brain_fog, other
intensity
number
required
Intensity level from 1 (mild) to 5 (severe)
time
string
required
Time when the symptom occurred in HH:MM format (e.g., “14:30”)
duration
number
Duration of the symptom in minutes
notes
string
Additional notes about the symptom (max 500 characters)

Response

success
boolean
Indicates if the symptom was successfully logged
data
object
The created diary entry
_id
string
Entry ID (MongoDB ObjectId)
userId
string
User ID who created the entry
date
string
Entry date in YYYY-MM-DD format
type
string
Entry type (always “symptom” for this endpoint)
symptom
object
Complete symptom data including all provided fields
createdAt
string
Timestamp when the entry was created
updatedAt
string
Timestamp when the entry was last updated

Examples

Log a bloating symptom

curl -X POST "https://api.ceboelha.com/diary/symptom" \
  -H "Authorization: Bearer YOUR_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "date": "2024-03-15",
    "symptom": {
      "type": "bloating",
      "intensity": 3,
      "time": "14:30",
      "duration": 45,
      "notes": "Começou após o almoço, sentindo desconforto abdominal"
    }
  }'

Log severe cramps

curl -X POST "https://api.ceboelha.com/diary/symptom" \
  -H "Authorization: Bearer YOUR_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "date": "2024-03-15",
    "symptom": {
      "type": "cramps",
      "intensity": 5,
      "time": "16:00",
      "duration": 20,
      "notes": "Dor intensa, precisei parar o que estava fazendo"
    }
  }'

Log mild gas without duration

curl -X POST "https://api.ceboelha.com/diary/symptom" \
  -H "Authorization: Bearer YOUR_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "date": "2024-03-15",
    "symptom": {
      "type": "gas",
      "intensity": 2,
      "time": "10:15"
    }
  }'
curl -X POST "https://api.ceboelha.com/diary/symptom" \
  -H "Authorization: Bearer YOUR_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "date": "2024-03-15",
    "symptom": {
      "type": "fatigue",
      "intensity": 4,
      "time": "15:00",
      "duration": 120,
      "notes": "Cansaço extremo após os sintomas digestivos"
    }
  }'
{
  "success": true,
  "data": {
    "_id": "65f1a2b3c4d5e6f7a8b9c0d2",
    "userId": "65e1a2b3c4d5e6f7a8b9c0d1",
    "date": "2024-03-15",
    "type": "symptom",
    "symptom": {
      "type": "bloating",
      "intensity": 3,
      "time": "14:30",
      "duration": 45,
      "notes": "Começou após o almoço, sentindo desconforto abdominal"
    },
    "createdAt": "2024-03-15T14:32:10.000Z",
    "updatedAt": "2024-03-15T14:32:10.000Z"
  }
}

Symptom Types

TypeDescription
bloatingAbdominal bloating and distension
gasFlatulence and gas
crampsAbdominal cramps and pain
nauseaFeeling of nausea
diarrheaLoose or watery stools
constipationDifficulty passing stools
refluxAcid reflux or heartburn
fatigueTiredness or lack of energy
headacheHeadache
brain_fogMental cloudiness or difficulty concentrating
otherOther symptoms not listed

Intensity Levels

LevelDescription
1Very mild - barely noticeable
2Mild - noticeable but not bothersome
3Moderate - somewhat bothersome
4Severe - very bothersome, affecting daily activities
5Very severe - debilitating, unable to function normally

Build docs developers (and LLMs) love