Core API

Decode Symptoms API

Available

Decode Symptoms structures free-text, image or voice symptom reports into consistent symptom events with labels, intensity and timing context.

Endpoint

POST/functions/v1/decode_symptoms

Contract

Send mymolecules-api-version with 2026-07-10 to use the documented response contract.

{
  "data": {},
  "meta": {
    "request_id": "req_...",
    "api_version": "2026-07-10"
  }
}

Headers

Request

  • x-api-key required - Server-side API key for your integration.
  • mymolecules-api-version required 2026-07-10 - Use the latest stable API version: 2026-07-10.
  • Content-Type required application/json - Required for JSON request bodies.

Response

  • x-request-id required - Request identifier. Log this value when contacting support.
  • mymolecules-api-version required 2026-07-10 - The API contract version used for the response.
  • x-ratelimit-limit optional - Quota limit for the current key and window when quota data is available.
  • x-ratelimit-remaining optional - Remaining requests in the current quota window when quota data is available.
  • x-ratelimit-reset optional - ISO timestamp for the current quota window reset when quota data is available.
  • retry-after optional - Seconds to wait before retrying when the request is rate-limited or temporarily unavailable.

Inputs

  • symptomText, symptomImage, symptomImageUrl, symptomVoice, symptomVoiceUrl or attachments
  • Optional timing fields such as timezone, reported_time, occurred_at_utc and occurred_end_at_utc
  • Optional source context such as user_id, conversation_id, source_message_id and correlation_id

Returns

  • 202 queued response with job_id, status_url and async meta
  • Completed symptom_detected result with one or more structured symptoms
  • Completed no_symptom_detected result with an empty symptoms array

Async pattern

Create the job with POST, then poll the same endpoint with job_id until the status is completed or failed.

  • Poll parameter: job_id
  • Status values: queued, processing, completed, failed

Error codes

  • missing_api_key
  • invalid_api_key
  • scope_not_allowed
  • quota_exceeded
  • invalid_json
  • invalid_request
  • validation_error
  • method_not_allowed
  • unsupported_api_version
  • job_not_found
  • backlog_high
  • upstream_timeout
  • upstream_error
  • internal_error

Request details

  • Provide at least one symptom input source.
  • Use timezone and reported_time when the user described a relative time such as "after dinner".
  • supersedes_event_id must be a UUID when provided.

Response details

  • Poll GET /functions/v1/decode_symptoms?job_id=... until status is completed or failed.
  • Every completed result has type: symptom_detected or type: no_symptom_detected.
  • symptom_detected returns symptoms with symptom_type, symptom_label, intensity_1_to_5 and duration.
  • intensity_1_to_5 is an integer from 1 to 5, or null when a symptom was detected without an explicit intensity.
  • no_symptom_detected returns symptoms: [] and error: null as a completed domain result.
  • The meta object includes retry_count and timestamps when available.

Operational notes

  • Requires x-api-key with the edge:decode_symptoms scope.
  • POST usage is counted and rate-limit headers are returned when quota data is available.
  • Writing symptom events to a mymolecules account requires additional account permissions.

Examples

Request JSON

{
  "symptomText": "Seit zwei Stunden habe ich mäßige Übelkeit.",
  "timezone": "Europe/Berlin"
}

Response JSON

{
  "data": {
    "job_id": "cb08a1...",
    "status": "queued",
    "status_url": "https://api.mymolecules.de/functions/v1/decode_symptoms?job_id=cb08a1..."
  },
  "meta": {
    "request_id": "req_...",
    "api_version": "2026-07-10"
  }
}

Code examples

curl -X POST 'https://api.mymolecules.de/functions/v1/decode_symptoms' \
  -H 'x-api-key: $MYMOLECULES_API_KEY' \
  -H 'mymolecules-api-version: 2026-07-10' \
  -H 'Content-Type: application/json' \
  --data '{  "symptomText": "Seit zwei Stunden habe ich mäßige Übelkeit.",  "timezone": "Europe/Berlin"}'