Skip to main content
PUT /api/user-challenges/:id/abandon Requires authentication.
Authorization
string
required
Bearer token obtained from /api/auth/login or /api/auth/signup. Format: Bearer <token>.
Abandoning a challenge cannot be undone. The challenge status is permanently set to ABANDONED. After abandoning, you can accept a new challenge.

Path parameters

id
number
required
The numeric ID of the user challenge to abandon.

Example

curl --request PUT \
  --url http://localhost:3000/api/user-challenges/14/abandon \
  --header 'Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...'

Response

200 OK Returns the updated user challenge object with status set to ABANDONED.
id
number
required
Unique numeric identifier for this user challenge.
user_id
string
required
UUID of the authenticated user.
template_id
number
required
ID of the challenge template this challenge is based on.
status
string
required
Updated status. Always ABANDONED after this operation.
start_date
string
required
ISO 8601 timestamp of when the challenge was started.
completed_at
string
Always null for abandoned challenges.
notes
string
Progress notes for the challenge. null if none were added.
created_at
string
required
ISO 8601 timestamp of when the record was created.
updated_at
string
required
ISO 8601 timestamp of this update.
Example response
{
  "id": 14,
  "user_id": "a3f2c1d0-89b4-4e7a-b6f5-1234567890ab",
  "template_id": 3,
  "status": "ABANDONED",
  "start_date": "2026-03-17T09:00:00.000Z",
  "completed_at": null,
  "notes": null,
  "created_at": "2026-03-17T09:00:00.000Z",
  "updated_at": "2026-03-17T18:30:00.000Z"
}

Errors

StatusDescription
401Missing, invalid, or expired token.
404No user challenge found with the given id.

Build docs developers (and LLMs) love