Skip to main content
Set is_daily_routine to true for tasks that repeat every day as part of your regular habits (e.g., “Drink 2L of water”). Leave it false for one-off tasks (e.g., “Read a book this week”). The flag does not enforce any scheduling logic — it is a label that helps you and the app distinguish recurring habits from standalone goals.

Request body

title
string
required
Display name for the task. Cannot be empty.
points
number
default:"10"
required
Points awarded to the user each time this task is completed. Must be greater than zero. Defaults to 10 when not provided.
description
string
Optional longer description of the task.
is_daily_routine
boolean
default:"false"
Whether this task is part of the user’s daily routine. Defaults to false.
challenge_template_id
number
Associate this task with a challenge template. When provided, the user must currently have an active challenge that matches this template ID, otherwise the request returns 400.

Response

201 Created — Returns the newly created task object.
id
number
required
Auto-incremented unique identifier for the task.
user_id
string
required
UUID of the user who owns the task.
challenge_template_id
number | null
required
ID of the associated challenge template, or null if not linked to a challenge.
title
string
required
Display name of the task.
description
string | null
required
Optional description, or null if not provided.
points
number
required
Points awarded per completion.
is_daily_routine
boolean
required
Whether the task is flagged as a daily routine.
created_at
string
required
ISO 8601 timestamp of when the task was created.
updated_at
string
required
ISO 8601 timestamp of when the task was last updated.

Errors

StatusCondition
400points is zero or negative.
400challenge_template_id is provided but the user does not have an active challenge matching that template.
404challenge_template_id is provided but the template does not exist.
401Missing or invalid authentication token.
curl --request POST \
  --url http://localhost:3000/api/tasks \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{
    "title": "Meditate for 10 minutes",
    "description": "Morning meditation session",
    "points": 20,
    "is_daily_routine": true
  }'
{
  "id": 42,
  "user_id": "a3f1c2d4-0e5b-4a7f-b891-2c3d4e5f6a7b",
  "challenge_template_id": null,
  "title": "Meditate for 10 minutes",
  "description": "Morning meditation session",
  "points": 20,
  "is_daily_routine": true,
  "created_at": "2026-03-17T08:00:00.000Z",
  "updated_at": "2026-03-17T08:00:00.000Z"
}

Build docs developers (and LLMs) love