Skip to main content
POST /api/challenge-templates Requires authentication.
string
required
Bearer token obtained from /api/auth/login or /api/auth/signup. Format: Bearer <token>.
The API enforces a maximum of 10 challenge templates at a time. Creating a new template when 10 already exist returns a 400 error. Delete an existing template first to free up a slot.

Request body

string
required
Display name of the challenge. Must not be empty.
string
required
Full description of the challenge goal and instructions.
number
required
Number of consecutive days the challenge runs. Must not be empty.

Example

Response

201 Created Returns the newly created challenge template object.
number
required
Unique numeric identifier assigned to the new template.
string
required
Display name of the challenge.
string
required
Full description of the challenge goal and instructions.
number
required
Number of consecutive days the challenge runs.
string
required
ISO 8601 timestamp of when the template was created.
string
required
ISO 8601 timestamp of the last update to the template.
Example response

Errors