Documentation

POST /api/todos

Add, complete or delete a task.

RequestPOST /api/todos
AuthenticationSession cookie required
Handlerbackend/server.py

What it does

One endpoint, three actions, each answering with the row it wrote so the client never has to re-read the list.

Authentication

Session cookie required. Send the ff_session cookie. Without one the engine treats the caller as a new visitor with no holds and no claims, and returns a new cookie to use from then on.

Parameters

ParameterInTypeRequiredDescription
ff_sessioncookiestringOptionalThe session identifier. Omit it on the first call and store the value the response sets; every later call must send the same one or the engine treats the caller as a new visitor with no holds and no claims.
actionbodystringOptional`delete` to remove a task. Omit to add or update.
labelbodystringOptionalThe task text, when adding. Refused as `empty_note` when blank.
idbodyintegerOptionalThe task to update or delete.
donebodybooleanOptionalThe completion state to set.

Request

The cookie jar carries the session between calls. Angle-bracketed values are the parameter types from the table above.

curl -s -b cookies.txt -c cookies.txt \
  -X POST -H 'Content-Type: application/json' \
  -d '{"action":"<string>","label":"<string>","id":"<integer>","done":"<boolean>"}' \
  "https://flowfinds.ai/api/todos"
const res = await fetch("https://flowfinds.ai/api/todos", {
  method: "POST",
  credentials: "include",
  headers: { "Content-Type": "application/json" },
  body: JSON.stringify({
    "action": "<string>",
    "label": "<string>",
    "id": "<integer>",
    "done": "<boolean>"
  }),
});
const data = await res.json();
import requests

s = requests.Session()
r = s.post("https://flowfinds.ai/api/todos", json={
    "action": "<string>",
    "label": "<string>",
    "id": "<integer>",
    "done": "<boolean>"
  })
data = r.json()

Recorded example

curl -s -b cookies.txt -c cookies.txt \
  -X POST -H 'Content-Type: application/json' \
  -d '{"label":"Check the supplier quote"}' \
  "$FLOWFINDS_ORIGIN/api/todos"

Responses

200A task was added.

FieldTypeDescription
statusstring`saved`.
idintegerThe new row id.
labelstringAs stored.
donebooleanFalse.

200A task was updated.

FieldTypeDescription
statusstring`saved`.
idintegerThe row.
donebooleanThe new state.

200A task was deleted.

FieldTypeDescription
statusstring`deleted`.
idintegerThe row.

Errors

StatusReasonWhen
400empty_noteA task was added with no label.
404No task carries that id on this account.
409The update conflicts with the stored row.

Related

Back to the API reference index, or read the cookbook for recipes that compose this endpoint with others.