Skip to main content
GET /api/challenge-templates/:id Requires authentication.
Authorization
string
required
Bearer token obtained from /api/auth/login or /api/auth/signup. Format: Bearer <token>.

Path parameters

id
number
required
The numeric ID of the challenge template to retrieve.

Example

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

Response

200 OK
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": 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"
}

Errors

StatusDescription
401Missing, invalid, or expired token.
404No challenge template found for the given ID.

Build docs developers (and LLMs) love