On this page:
PATCH /users update some of the details about a user
Updates some of the details about a user.
Also see:
- Update all or part of a user entry: a tutorial
- GET: List all users
- GET: Get user by id
- PATCH: Update part of a sighting
Method
PATCH
Endpoint
{base_url}/users/{id}
Also see:
Properties
Required: the id of the user you want to update.
For a description of all properties, see /users resource.
Headers
Content-Type: application/json
Request body
cURL example
Shows updating the first_name of the user with an id of 1.
curl -X PATCH \
-H "Content-Type: application/json" \
-d '{
"first_name": "Benjamin"
}' \
http://localhost:3000/users/6
Postman example
Shows updating the first_name of the user with an id of 6.
Request builder method and endpoint
Select PATCH and enter http://localhost:3000/users/6.
Request builder body
Select Body > raw > JSON and enter:
{
"first_name": "Benjamin"
}
Return body
Returns the updated user entry.
{
"last_name": "Waters",
"first_name": "Benjamin",
"email": "ben.waters@gmail.com",
"id": 6
}
Return status
| Status value | Return status | Description |
|---|---|---|
| 200 | OK | Request successful. The server has responded as required. |
| 404 | Not Found | Requested resource could not be found. |