DELETE
/users/{id} BearerDelete User
Permanently delete a user account and all associated data from the system via authenticated DELETE request
Overview
Permanently deletes a user from the system. This action cannot be undone.
Authorization
Note
This is a destructive operation that requires authentication. Use with caution.
Path Parameters
Path Parameters
id requiredThe unique identifier of the user to delete
Response
Returns an empty object on successful deletion.
Error Responses
| Status | Description |
|---|---|
401 | Unauthorized - missing or invalid authentication |
404 | User not found |
Usage Notes
Verify User Exists
Before deleting, you may want to verify the user exists using the GET endpoint.
Handle Dependencies
Ensure any posts or comments associated with this user are handled appropriately.
Confirm Deletion
This operation is irreversible. Consider implementing a confirmation step in your UI.
curl -X DELETE "https://jsonplaceholder.typicode.com/users/1" \ -H "Authorization: Bearer <token>"const response = await fetch("https://jsonplaceholder.typicode.com/users/1", { method: "DELETE", headers: { "Authorization": "Bearer <token>" }});
console.log(response.status); // 200import requests
response = requests.delete( "https://jsonplaceholder.typicode.com/users/1", headers={"Authorization": "Bearer <token>"})print(response.status_code){}{ "error": "User not found"}Was this page helpful?
Request
curl -X DELETE "https://jsonplaceholder.typicode.com/users/{id}" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer <token>"const response = await fetch("https://jsonplaceholder.typicode.com/users/{id}", {
method: "DELETE",
headers: {
"Content-Type": "application/json",
"Authorization": "Bearer <token>"
},
});
const data = await response.json();
console.log(data);import requests
response = requests.delete(
"https://jsonplaceholder.typicode.com/users/{id}",
headers={'Content-Type':'application/json','Authorization':'Bearer <token>'},
)
print(response.json())package main
import (
"fmt"
"net/http"
"io"
)
func main() {
req, _ := http.NewRequest("DELETE", "https://jsonplaceholder.typicode.com/users/{id}", nil)
req.Header.Set("Content-Type", "application/json")
req.Header.Set("Authorization", "Bearer <token>")
client := &http.Client{}
resp, _ := client.Do(req)
defer resp.Body.Close()
body, _ := io.ReadAll(resp.Body)
fmt.Println(string(body))
}Response
Send a request to see the response
Authorization
Headers
Response