Skip to content

Parse Composer text

POST
/api/v1/notes/composer/parse
curl --request POST \
--url https://example.com/api/v1/notes/composer/parse \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{ "mode": "example", "now": "example", "text": "example" }'

Requires a signed-in User with the data scope. It parses one line in Event, Task or Note mode without saving it. It returns 400 for invalid text, time or mode, or 413 when the line is too long. Route: /api/v1/notes/composer/parse. Inputs: . Do not automatically replay this operation after an uncertain result.

Media typeapplication/json
object
mode
required

The composer’s mode: event (a Log entry or an Event), task or note. It selects the run grammar and the tag namespace.

string
now
required

The client’s local wall time, YYYY-MM-DDTHH:MM[:SS]. Its date is the reference for relative dates (“tomorrow”); the core ignores the zone.

string
text
required

Line 1 of the composer text. No line breaks.

string
Examplegenerated
{
"mode": "example",
"now": "example",
"text": "example"
}
Media typeapplication/json
object
classification
required
object
confidence
required

none, medium or high.

string
margin
required
integer format: int32
mode
required
string
entry
required
object
crosses_midnight
required
boolean
date

An explicit or resolved date, YYYY-MM-DD.

string | null
duration_minutes
integer | null format: int32
end
string | null
mode
required
string
since
string | null
start
string | null
tags
required
Array<string>
title
required
string
until
string | null
note
required
object
tags
required
Array<string>
title
required
string
runs
required
Array<object>
object
end
required

UTF-16 code-unit offset, exclusive.

integer
kind
required

date, time, duration, priority, recurrence, tag or anchor.

string
start
required

UTF-16 code-unit offset, inclusive.

integer
task
One of:

Present only when mode is task.

object
due
string | null
due_time
string | null
priority
string | null
recurrence

The recurrence as the Task file stores it (every week).

string | null
scheduled
string | null
scheduled_time
string | null
start
string | null
start_time
string | null
tags
required
Array<string>
title
required
string
Examplegenerated
{
"classification": {
"confidence": "example",
"margin": 1,
"mode": "example"
},
"entry": {
"crosses_midnight": true,
"date": "example",
"duration_minutes": 1,
"end": "example",
"mode": "example",
"since": "example",
"start": "example",
"tags": [
"example"
],
"title": "example",
"until": "example"
},
"note": {
"tags": [
"example"
],
"title": "example"
},
"runs": [
{
"end": 1,
"kind": "example",
"start": 1
}
],
"task": {
"due": "example",
"due_time": "example",
"priority": "example",
"recurrence": "example",
"scheduled": "example",
"scheduled_time": "example",
"start": "example",
"start_time": "example",
"tags": [
"example"
],
"title": "example"
}
}

Malformed text, time or mode

The line is longer than 8 KiB