Technical reference

Prompt My Candis API

Create, read and update CANDIS entries over HTTP — with a browser session or a personal trv_… token.

Base https://promptmycandis.com/api/v1

Authentication

Preferred: token in the header. Generate it in Profile (after you log in).

Authorization: Bearer trv_••••••••

Alternative: session cookie (same routes, from an authenticated browser).

Quick start

  1. Log in and generate a token in your profile
  2. PUT /diary/AAAA-MM-DD — PUT /diary/YYYY-MM-DD with consumed and, if yes, slots
  3. Confirm with GET /diary/YYYY-MM-DD or in the app history
curl -X PUT "https://promptmycandis.com/api/v1/diary/2026-07-27" \
  -H "Authorization: Bearer trv_SEU_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "consumed": false,
    "notes": "Dia limpo"
  }'
GET /me

Authenticated user.

{
  "ok": true,
  "user": { "id": 1, "email": "…", "name": "…", "role": "patient" }
}
GET /stats?days=28

Motivational summary (streak, trend, days logged).

GET /diary

List entries. Optional query: from, to (ISO), limit (max 365).

GET /diary/<AAAA-MM-DD>

One day. 404 if it doesn't exist yet.

PUT /diary/<AAAA-MM-DD>

Create or update the day (also accepts POST). Future days → 400.

{
  "consumed": true,
  "notes": "opcional",
  "slots": {
    "morning":   [{ "qty": 1, "method": "C" }],
    "afternoon": [],
    "evening":   [{ "qty": 2, "method": "B" }],
    "night":     []
  }
}

Response includes created: true|false and the saved entry.

DELETE /diary/<AAAA-MM-DD>

Delete that day's entry.

Slots and methods

Time slots

  • morning — 6:00 – 12:00
  • afternoon — 12:00 – 18:00
  • evening — 18:00 – 24:00
  • night — 24:00 – 6:00

Methods

  • C — Joint
  • B — Bong
  • BA — Bucket
  • CA — Pipe
  • O — Other

Errors

  • 401 — not authenticated ({"ok":false,"error":"auth"})
  • 403 — account without a defined role
  • 400 — invalid date, future, or missing consumed
  • 404 — entry not found

Assistants and automation

Yes — you can ask an assistant (like Cursor) to create entries for you: share the token (or generate one just for that) and give dates / use. Revoke the token in your profile when you no longer need it.

Health data: treat the token like a password. OpenCloud prototype — not formally validated by the CANDIS programme.