Home

Stallfreunde API (v1)

Read only access to your stable’s data for your own scripts, e.g. a daily check of which stable duties were left open. The API works independently of the app.

Access

Every request sends the token in the header:

Authorization: Bearer sf_…

Versions

The version is part of the path (/api/v1/…). Within v1, at most new fields and new filter values are added; existing ones are not renamed or removed. So ignore fields you do not know. An incompatible change would come as /api/v2/…, and v1 keeps running.

GET /api/v1/tasks

https://bgkidelbtqrzvgfokdfd.supabase.co/functions/v1/api/v1/tasks

Tasks with a due day in the period (days in the stable’s time zone, Europe/Berlin). Tasks without a due day are not returned.

ParameterRequiredValues
from, toyesYYYY-MM-DD, both inclusive, at most 31 days
stable_duties_onlytrue: only tasks from stable duties
stable_duty_idonly the tasks of this stable duty
statusopen, done, needs_people (open and nobody signed up yet, or fewer people than the stable duty needs)
assigned_tome, nobody or the ID of a person
scopecomma separated from ORGANIZATION (whole stable), HORSE, HORSE_POSITION (box), RIDING_GROUP, PERSONAL
scope_idID of the horse, box or riding group

Filters only narrow the result. An unknown parameter or value is not silently ignored but rejected with 400.

Example: open stable duties from yesterday
curl -s -H "Authorization: Bearer $STALLFREUNDE_TOKEN" 
  "https://bgkidelbtqrzvgfokdfd.supabase.co/functions/v1/api/v1/tasks?from=2026-11-16&to=2026-11-16&stable_duties_only=true&status=open"

Response (anonymized)

{
  "api_version": 1,
  "orga_id": "6f1c0a52-…",
  "from": "2026-11-16",
  "to": "2026-11-16",
  "generated_at": "2026-11-17T07:00:01.204+00:00",
  "tasks": [
    {
      "id": "a14558cd-95e8-4fbb-8ce9-746b159ead60",
      "title": "Koppelservice morgens",
      "description": "Pferde auf die Koppel bringen und Wasser auffüllen",
      "scope": { "type": "ORGANIZATION", "id": null, "name": null },
      "stable_duty": { "id": "0b6e…", "name": "Koppelservice morgens" },
      "due_date": "2026-11-16",
      "all_day": false,
      "start_time": "08:00",
      "end_time": "09:00",
      "assignees": [
        { "id": "3d2a…", "name": "Vorname", "surname": "Nachname" }
      ],
      "is_done": false,
      "closed_at": null,
      "needs_people": true,
      "created_at": "2026-11-02T03:00:12.551+00:00",
      "updated_at": "2026-11-15T18:21:40.002+00:00"
    }
  ]
}
FieldMeaning
idpermanent ID of the task
scope.typewho the task applies to (values as in the scope filter; new values may be added)
scope.namename of the horse, box or riding group, otherwise null
stable_dutythe stable duty the task comes from, otherwise null
due_datedue day (stable’s time zone)
all_day, start_time, end_timestable duties have the time of their duty, other tasks apply all day (start_time/end_time are then null)
assigneessigned up people; name/surname are null for people who left the stable
is_done, closed_atdone, and when
needs_peopleopen and still missing people

Errors

All errors come as JSON: { "error": { "code": "…", "message": "…" } }

StatuscodeWhen
400invalid_parametera parameter is missing, unknown or invalid (the message says which)
401unauthorizedtoken missing, wrong, revoked, expired, or the account is no longer in the stable
403missing_scopethe token may not use this endpoint
404not_foundunknown path or unknown version
405method_not_allowedonly GET (and HEAD)
500internal_errorerror on our side; please try again later

Please do not query more than once per minute: for a daily check, one call per day is enough.