Skip to main content
PUT
/
api
/
tasks
/
reorder
Reorder Tasks
curl --request PUT \
  --url https://api.example.com/api/tasks/reorder \
  --header 'Content-Type: application/json' \
  --data '
{
  "items": [
    {}
  ],
  "items[].id": 123,
  "items[].position": 123
}
'

Authentication

This endpoint requires authentication. Include a Bearer token in the Authorization header.

Request Body

Send an array of objects containing task IDs and their new positions.
items
array
required
Array of objects with task ID and position information
items[].id
integer
required
The task ID to reorder
items[].position
integer
required
The new position for the task

Response

Returns 204 No Content on success.

Example Request

curl -X PUT https://api.dailytracker.com/api/tasks/reorder \
  -H "Authorization: Bearer YOUR_TOKEN_HERE" \
  -H "Content-Type: application/json" \
  -d '[
    {
      "id": 1,
      "position": 3
    },
    {
      "id": 2,
      "position": 1
    },
    {
      "id": 3,
      "position": 2
    }
  ]'

Example Response

204 No Content

Error Responses

400 Bad Request
Invalid request body format
{
  "error": "Bad Request",
  "message": "Invalid request format"
}
401 Unauthorized
Missing or invalid authentication token
{
  "error": "Unauthorized",
  "message": "Invalid or missing authentication token"
}
404 Not Found
One or more tasks not found or do not belong to the authenticated user
{
  "error": "Not Found",
  "message": "One or more tasks not found"
}

Build docs developers (and LLMs) love