DELETE /users/{id} Bearer

Delete 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

Path Parameters

Path Parameters

id required
integer

The unique identifier of the user to delete

Response

Returns an empty object on successful deletion.

Error Responses

StatusDescription
401Unauthorized - missing or invalid authentication
404User 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.

Terminal window
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); // 200
import requests
response = requests.delete(
"https://jsonplaceholder.typicode.com/users/1",
headers={"Authorization": "Bearer <token>"}
)
print(response.status_code)
{}
{
"error": "User not found"
}
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