Filter Syntax

To filter tasks via the api, you can use a query syntax similar to SQL.

This document is about filtering via the api. To filter in Vikunja's web ui, check out the help text below the filter query input.

Available fields #

The available fields for filtering include:

doneWhether the task is completed or not
priorityThe priority level of the task (1–5)
percentDoneThe percentage of completion for the task (0–100)
dueDateThe due date of the task
startDateThe start date of the task
endDateThe end date of the task
doneAtThe date and time when the task was completed
assigneesThe assignees of the task
labelsThe labels associated with the task
projectThe project the task belongs to. Only available for saved filters, not on a project level
remindersThe reminders of a task.
createdThe time and date when the task was created.
updatedThe time and date when the task was updated.

All fields are in snake_case when accessed through the api.

You can use date math to set relative dates with any date field. See below for an explanation.

All strings must be either single-word or enclosed in " or '. This extends to date values like 2024-03-11.

Operators #

The available operators for filtering include:

!=Not equal to
=Equal to
>Greater than
>=Greater than or equal to
<Less than
<=Less than or equal to
likeMatches a pattern (using wildcard %)
inMatches any value in a comma-separated list of values
not inMatches any value not in a comma-separated list of values. Please note this syntax does not work with Typesense, due to limitations in the query language.

To combine multiple conditions, you can use the following logical operators:

&&AND operatormatches if all conditions are true
||OR operatormatches if any of the conditions are true
( and )Parenthesesfor grouping conditions

Date Math #

Date Math allows you to specify relative dates which are resolved on the fly by Vikunja when applying the filter.

Each Date Math expression starts with an anchor date, which can either be now, or a date string ending with ||.

This anchor date can optionally be followed by one or more maths expressions, for example:

  • +1d: Add one day
  • -1d: Subtract one day
  • /d: Round down to the nearest day

These expressions are similar to the ones provided by Grafana and Elasticsearch.

Supported time units #

sSeconds
mMinutes
hHours
dDays
wWeeks
MMonths
yYears

Example date math expressions #

now Right now (Oct 30, 2024, 14:26:12)
now+24h In 24h (Oct 31, 2024, 14:26:12)
now/d Today at 00:00 (Oct 30, 2024, 00:00:00)
now/w The beginning of this week at 00:00 (Oct 27, 2024, 00:00:00)
now/w+1w The end of this week (Nov 3, 2024, 00:00:00)
now+30d In 30 days (Nov 29, 2024, 00:00:00)
Oct 30, 2024, 14:26:12||+1M/d Oct 30, 2024, 14:26:12 plus one month at 00:00 of that day (Nov 30, 2024, 00:00:00)

Filter Examples #

Here are some examples of filter queries:

priority = 4tasks with priority level 4
dueDate < nowtasks with a due date in the past
done = false && priority >= 3undone tasks with priority level 3 or higher
assignees in user1, user2tasks assigned to either user1 or user2
(priority = 1 || priority = 2) && dueDate <= nowtasks with priority level 1 or 2 and a due date in the past