/goals talks to Keel only through these routes, so the same rules apply on the phone, in the CLI and in the browser terminal. A goal in a response has the same fields as goal show g1 --json (see JSON output).
With a login set up (phone login), every route needs a Goals session or a terminal session. Without one the answer is 401 with { "error": "Sign in first.", "signIn": "goals" }.
Creating a goal
dueOn is a day (YYYY-MM-DD) and cueAt a local time (YYYY-MM-DDTHH:MM). appetite, obstacle and each step’s cueAt, cuePlace and minimum are optional. The first step is the first one in the list, unless one has "firstStep": true. Send it with content-type: application/json.
Errors
Every error has the same shape:{ "error", "hint", "field" }. field names the input it is about (title, doneMeans, dueOn, plan, steps), or is null.