How to complete the challenge PUT /api/todos/{id} not found (404)

Issue a PUT request to /api/todos/{id} where the URL id does not exist, and do not include an id in the request body.

This is an update attempt against a specific URL resource. Since that resource does not exist, the response should be 404 Not Found.

Basic Instructions

  • Send PUT /api/todos/{id} where {id} does not exist
  • Add an X-CHALLENGER header to track challenge completion
  • Set Content-Type to application/json
  • Do not include an id field in the JSON payload
  • Include a valid title
  • Verify the response status is 404

Example body:

{
  "title": "missing todo",
  "doneStatus": false,
  "description": "URL id does not exist"
}

Try it now

PUT /api/todos/{id} with a missing URL id and no body id

Lessons Learned

  • A valid PUT body cannot update a resource id that does not exist.
  • 404 Not Found here is about the target path resource, not body validation.
  • Missing-resource update tests should keep the payload valid so the status is unambiguous.

Suggested Experiments

  • Reuse the same payload against an existing id and compare 200 OK with the missing-id 404 Not Found.
  • Create a new todo after the failed update and check that the failed PUT did not create that id.
Experiment with this endpoint