On this page:

Delete a user: a tutorial

This tutorial should take you about 10 minutes to complete.

Before you begin

  1. Make sure you’ve set up your environment.
  2. Start the Orca Sightings service with json-server.

How to delete a user

In this section, you’ll delete the user with an id of 4.

To use cURL:

  1. Open a new terminal window.
  2. Find the user you want to delete.
  3. Run the following command:
curl -X DELETE http://localhost:3000/users/4

To use Postman:

  1. In Postman’s main panel on the right, toward the top, select DELETE.
  2. Add the following content to the URL text box next to GET: http://localhost:3000/users/4.
  3. Click Send.

If you don’t specify a user ID, the service won’t delete all the users. Instead, it returns a 404 Not Found error message.

View the response

The response body should show an empty record:

{}

In Postman, you should also see a green 200 OK message at the top of the pane. Hover over that text to see the full confirmation message.

That’s it. Next, view the reference topic DELETE /users.

Also, you can try other tutorials or view other topics in the API reference.


Back to top

Copyright © 2025 Julie Brodeur (technical writer) and Jeff Naemura (subject matter expert). Distributed by an MIT license. This work is for educational and demonstration purposes only.