POST /v1/ingest — Full Reference

Endpoint

POST https://api.nefesh.ai/v1/ingest
Content-Type: application/json
X-Nefesh-Key: YOUR_KEY

Required Fields

FieldTypeNotes
session_idstring (max 256)Unique per user session
timestampISO 8601 datetimee.g. 2026-03-29T16:30:00Z
+ at least 1 signalOtherwise 422 error

Optional Meta Fields

FieldTypeNotes
subject_idstringPersistent user ID (required for Trigger Memory)
source_devicestringe.g. "polar_h10", "garmin", "webcam" — affects Device Trust Scoring
confidencefloat (0.0–1.0)Client-side confidence override

Signal Fields — Cardiovascular (fused ✓)

FieldTypeRange
heart_ratefloat30–220
rmssdfloat
sdnnfloat
pnn50float
mean_ibifloat
ibi_countint
spo2float0–100

Signal Fields — Vocal (fused ✓)

FieldTypeValues
toneliteralcalm, focused, hesitant, tense, frustrated, anxious, hostile, excited, neutral
speech_ratefloat
pitch_variabilityfloat

Signal Fields — Visual (fused ✓)

FieldTypeValues
expressionliteralrelaxed, concentrated, frowning, smiling, tense, surprised, neutral
gazeliteraldirect, averted, downward, wandering
postureliteralupright, leaning_forward, leaning_back, slouched
engagementfloat0.0–1.0

Signal Fields — Textual (fused ✓)

FieldTypeValues
sentimentfloat-1.0 to 1.0 (NOT a string! -1.0 = negative, 0 = neutral, 1.0 = positive)
urgencyliterallow, medium, high, critical

Signal Fields — Conversation (for Trigger Memory)

FieldTypeMax Length
user_messagestring4096 chars
ai_responsestring4096 chars

Requires subject_id to be set. Nefesh auto-extracts psychological trigger topics and tracks stress patterns per user over time.

Signal Fields — Metabolic (accepted, not fused yet)

FieldTypeValues
glucose_mg_dlfloat20–600
glucose_mmol_lfloat1.0–33.0
glucose_trendliteralrapid_fall, falling, stable, rising, rapid_rise

Signal Fields — Neural (accepted, not fused yet)

FieldTypeRange
eeg_alpha_powerfloat
eeg_beta_powerfloat
eeg_theta_powerfloat
cognitive_loadfloat0.0–1.0

Signal Fields — Electrodermal (accepted, not fused yet)

FieldType
edafloat
skin_temperaturefloat

Signal Fields — Respiratory (accepted, not fused yet)

FieldType
respiratory_ratefloat

Signal Fields — Movement (accepted, not fused yet)

FieldTypeValues
steps_last_minuteint
activity_levelliteralsedentary, light, moderate, vigorous

Signal Fields — Sleep (accepted, not fused yet)

FieldTypeValues
sleep_stageliteralawake, light, deep, rem

Signal Fields — Override

FieldTypeRange
stress_scorefloat0–100 (overrides calculated score)

Response

{
  "session_id": "test-001",
  "state": "stressed",
  "stress_score": 73,
  "confidence": 0.87,
  "signals_received": ["cardiovascular", "textual", "visual", "vocal"],
  "suggested_action": "de-escalate_and_shorten",
  "action_reason": "elevated heart rate + anxious vocal tone + tense facial expression + negative sentiment",
  "recommendation": "Max 2 sentences. Direct, factual, no ambiguity.",
  "disclaimer": "Not a medical device. For contextual AI adaptation only."
}

State Values

StateScore Range
calm0–19
relaxed20–39
focused40–59
stressed60–79
acute_stress80–100

Body Size Limit

Maximum 4 KB per request. Requests exceeding this limit receive HTTP 413.

Adaptation Feedback Loop

On the 2nd+ call within the same session, the response includes adaptation_effectiveness — a closed-loop feedback mechanism that tells your agent whether the previous action worked.

{
  "state": "relaxed",
  "stress_score": 28,
  "suggested_action": "maintain_engagement",
  "action_reason": "heart rate signal + calm vocal tone",
  "adaptation_effectiveness": {
    "previous_action": "de-escalate_and_shorten",
    "previous_score": 73,
    "current_score": 28,
    "stress_delta": -45,
    "effective": true
  }
}
FieldTypeDescription
previous_actionstringThe suggested_action from the previous call
previous_scoreintegerStress score from the previous call
current_scoreintegerStress score from this call
stress_deltaintegerChange in stress. Negative = improvement.
effectivebooleantrue if stress stayed the same or decreased

Use it to build self-improving agents:

  • effective: true → Current approach works. Continue.
  • effective: false → Stress increased despite the action. Try a different strategy — shorter responses, topic change, or suggest a break.

This is a closed-loop system: send signals → get action → follow action → check if it worked → adapt. No other API offers this.