Skip to main content
GET /api/challenge-templates Requires authentication.
Authorization
string
required
Bearer token obtained from /api/auth/login or /api/auth/signup. Format: Bearer <token>.
The API is pre-seeded with 7 built-in challenge templates ranging from 1 to 60 days. They are available to all authenticated users immediately after the service starts.

Example

curl --request GET \
  --url http://localhost:3000/api/challenge-templates \
  --header 'Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...'

Response

200 OK Returns an array of challenge template objects ordered by creation date, most recent first.
id
number
required
Unique numeric identifier for the template.
title
string
required
Display name of the challenge.
description
string
required
Full description of the challenge goal and instructions.
duration_days
number
required
Number of consecutive days the challenge runs.
created_at
string
required
ISO 8601 timestamp of when the template was created.
updated_at
string
required
ISO 8601 timestamp of the last update to the template.
Example response
[
  {
    "id": 7,
    "title": "Semestre de Disciplina",
    "description": "O desafio supremo: 60 dias de consistência. Apenas para os mais dedicados!",
    "duration_days": 60,
    "created_at": "2026-03-14T00:10:00.000Z",
    "updated_at": "2026-03-14T00:10:00.000Z"
  },
  {
    "id": 6,
    "title": "Desafio Relâmpago",
    "description": "Apenas 1 dia! Complete todas as suas tarefas hoje e ganhe o selo de conclusão.",
    "duration_days": 1,
    "created_at": "2026-03-14T00:10:00.000Z",
    "updated_at": "2026-03-14T00:10:00.000Z"
  },
  {
    "id": 5,
    "title": "Quinzena Produtiva",
    "description": "Duas semanas de produtividade máxima. 14 dias para transformar sua rotina.",
    "duration_days": 14,
    "created_at": "2026-03-14T00:10:00.000Z",
    "updated_at": "2026-03-14T00:10:00.000Z"
  },
  {
    "id": 4,
    "title": "Sprint de 3 Dias",
    "description": "Um desafio rápido para começar. Mantenha sua rotina por 3 dias seguidos.",
    "duration_days": 3,
    "created_at": "2026-03-14T00:10:00.000Z",
    "updated_at": "2026-03-14T00:10:00.000Z"
  },
  {
    "id": 3,
    "title": "Maratona de 30 Dias",
    "description": "Um mês inteiro de dedicação. Complete suas tarefas todos os dias por 30 dias.",
    "duration_days": 30,
    "created_at": "2026-03-14T00:10:00.000Z",
    "updated_at": "2026-03-14T00:10:00.000Z"
  },
  {
    "id": 2,
    "title": "21 Dias de Hábito",
    "description": "Dizem que 21 dias formam um hábito. Aceite este desafio e prove para si mesmo!",
    "duration_days": 21,
    "created_at": "2026-03-14T00:10:00.000Z",
    "updated_at": "2026-03-14T00:10:00.000Z"
  },
  {
    "id": 1,
    "title": "7 Dias de Foco Total",
    "description": "Complete todas as suas tarefas diárias por 7 dias consecutivos. Mantenha o foco e a disciplina!",
    "duration_days": 7,
    "created_at": "2026-03-14T00:10:00.000Z",
    "updated_at": "2026-03-14T00:10:00.000Z"
  }
]

Errors

StatusDescription
401Missing, invalid, or expired token.

Build docs developers (and LLMs) love