kriyan

Agent API

Every operation is one HTTP call. These are the same operations your AI uses over MCP and the CLI runs, so anything one can do, the others can too.

Requests

Send POST https://kriyan.app/api/v1/<operation> with a JSON object as the body and a personal access token from Settings in the Authorization header. GET https://kriyan.app/api/v1 lists every operation with its JSON Schema.

Read today
curl -X POST https://kriyan.app/api/v1/get_today \
  -H "Authorization: Bearer $KRIYAN_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{}'
Add a task from a sentence
curl -X POST https://kriyan.app/api/v1/add_task \
  -H "Authorization: Bearer $KRIYAN_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"text": "essay fri 5pm #school every week remind 1h before"}'

Responses

A call that worked answers 200 with { "result": ... }. Anything else answers with { "error": "..." }, written to be shown to a person or fixed by an agent:

Dates are dates in your own calendar, like 2026-10-13, and “today” is today in the time zone from your profile. Times are minutes after midnight: 14:30 is 870. Lengths are minutes, and are only set when you know them.

Operations

get_today

Get today. Reads only, never changes anything.

Read the person's plan for a day (today by default): scheduled blocks, anytime tasks, done tasks, tasks left from earlier days, and habits. Read this before planning.

FieldTypeAbout
datestringA date like 2026-10-13, in the person's own calendar.

get_week

Get a week. Reads only, never changes anything.

Read seven days starting on a date (Monday of this week by default): each day's blocks, deadlines and planned hours against capacity, plus the inbox and unscheduled tasks.

FieldTypeAbout
startstringA date like 2026-10-13, in the person's own calendar.

get_inbox

Get the inbox. Reads only, never changes anything.

Read tasks captured without a date or a space.

Send an empty object.

get_space

Get a space. Reads only, never changes anything.

Read one space: its next and later tasks, child spaces, goals, note and stats.

FieldTypeAbout
spaceId (required)stringThe space's id.

list_spaces

List spaces. Reads only, never changes anything.

List every space as a tree, with ids, colours and paths like 'Work / Kriyan'.

Send an empty object.

get_progress

Get progress. Reads only, never changes anything.

Read time done this week and this year, time by space, goals against pace and habits.

Send an empty object.

add_task

Add a task. Changes your plan.

Add a task. Either pass `text` as one sentence the way a person types it ('essay fri 5pm #school every week remind 1h before') or pass the fields. Only the title is required. Never invent a length.

FieldTypeAbout
textstringOne sentence, parsed like the app's quick add.
titlestring
spaceIdstringThe space's id.
datestringA date like 2026-10-13, in the person's own calendar.
timeinteger, 0 to 1439Start time, in minutes after midnight (14:30 is 870).
lengthinteger, 1 to 1440Length in minutes. Leave it out unless the person said how long; never guess.
deadlinestringWhen it's due, if different from the day it's planned for.
repeatobjectHow the task repeats. Examples: every Tue and Thu {freq:'week',interval:1,weekdays:[1,3]}; last day of each month {freq:'month',interval:1,monthly:{kind:'last'}}; second Tuesday {freq:'month',interval:1,monthly:{kind:'nth',n:2,weekday:1}}; yearly {freq:'year',interval:1}; every 2 days after done {freq:'day',interval:2,fromCompletion:true}. Weekdays: 0 Monday to 6 Sunday.
reminderslist of objectReminders. {kind:'before',minutes:10} fires 10 minutes before the start (or before 09:00 for a task with no time); {kind:'day',offset:-1,time:1200} fires the day before at 20:00.
notestringMarkdown.
eventbooleanTrue for something attended (a class, a meeting) rather than ticked off.
goalIdstringThe goal's id.

update_task

Change a task. Changes your plan.

Change fields of a task. Pass null to clear a field. Changing the date of a repeating task moves the whole series.

FieldTypeAbout
taskId (required)stringThe task's id.
titlestring
spaceIdstring or nullThe space's id.
datestring or nullA date like 2026-10-13, in the person's own calendar.
timeinteger, 0 to 1439 or nullStart time, in minutes after midnight (14:30 is 870).
lengthinteger, 1 to 1440 or nullLength in minutes. Leave it out unless the person said how long; never guess.
deadlinestring or nullWhen it's due, if different from the day it's planned for.
repeatobject or nullHow the task repeats. Examples: every Tue and Thu {freq:'week',interval:1,weekdays:[1,3]}; last day of each month {freq:'month',interval:1,monthly:{kind:'last'}}; second Tuesday {freq:'month',interval:1,monthly:{kind:'nth',n:2,weekday:1}}; yearly {freq:'year',interval:1}; every 2 days after done {freq:'day',interval:2,fromCompletion:true}. Weekdays: 0 Monday to 6 Sunday.
reminderslist of object or nullReminders. {kind:'before',minutes:10} fires 10 minutes before the start (or before 09:00 for a task with no time); {kind:'day',offset:-1,time:1200} fires the day before at 20:00.
notestring or nullMarkdown.
eventboolean or nullTrue for something attended (a class, a meeting) rather than ticked off.
goalIdstring or nullThe goal's id.

complete_task

Complete a task. Changes your plan.

Tick a task off. A repeating task moves to its next date.

FieldTypeAbout
taskId (required)stringThe task's id.

reopen_task

Reopen a task. Changes your plan.

Mark a finished task as not done.

FieldTypeAbout
taskId (required)stringThe task's id.

delete_task

Delete a task. Changes your plan.

Delete a task. The person can restore it from the app.

FieldTypeAbout
taskId (required)stringThe task's id.

move_tasks

Move tasks. Changes your plan.

Move tasks to a date, optionally at a time. Pass date null to unschedule.

FieldTypeAbout
taskIds (required)list of string
date (required)string or nullA date like 2026-10-13, in the person's own calendar.
timeinteger, 0 to 1439 or nullStart time, in minutes after midnight (14:30 is 870).

add_space

Add a space. Changes your plan.

Add a space, optionally inside another one. Colour defaults to the parent's.

FieldTypeAbout
name (required)string
colorone of "blue", "green", "orange", "purple", "red", "yellow", "teal", "pink"
parentIdstringThe parent space's id.

update_space

Change a space. Changes your plan.

Rename a space, change its colour or parent, or replace its Markdown note.

FieldTypeAbout
spaceId (required)stringThe space's id.
namestring
colorone of "blue", "green", "orange", "purple", "red", "yellow", "teal", "pink"
parentIdstring or nullThe parent space's id.
notestring

add_habit

Add a habit. Changes your plan.

Add a habit with a weekly target (1 to 7 times a week).

FieldTypeAbout
title (required)string
target (required)integer, 1 to 7
spaceIdstringThe space's id.

check_habit

Check a habit. Changes your plan.

Mark a habit done or not done on a day (today by default).

FieldTypeAbout
habitId (required)stringThe habit's id.
done (required)boolean
datestringA date like 2026-10-13, in the person's own calendar.

add_goal

Add a goal. Changes your plan.

Add a goal: a number to reach (kind 'number', e.g. 100 km) or a count of linked tasks to finish (kind 'tasks').

FieldTypeAbout
title (required)string
kind (required)one of "number", "tasks"
target (required)number
unitstring
dueDatestringA date like 2026-10-13, in the person's own calendar.
spaceIdstringThe space's id.

update_goal

Change a goal. Changes your plan.

Update a goal's progress (`current`), target, unit or due date.

FieldTypeAbout
goalId (required)stringThe goal's id.
titlestring
targetnumber
currentnumber
unitstring or null
dueDatestring or nullA date like 2026-10-13, in the person's own calendar.

propose_plan

Propose a plan. Changes your plan.

Propose new time blocks. They appear in the app as proposals the person accepts or discards, so use this for plans rather than add_task. Each block is a new task with a date, a time and a length.

FieldTypeAbout
agent (required)stringYour name, shown to the person, like 'Claude'.
blocks (required)list of object