curl --request PUT \
--url https://reimagined-journey-g45xxv4v6gwhvrrr-80.app.github.dev/users/{id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"email": "johndoe@gmail.com",
"password": "P@ssw0rd!",
"role": "manager",
"user_name": "john_doe"
}
'import requests
url = "https://reimagined-journey-g45xxv4v6gwhvrrr-80.app.github.dev/users/{id}"
payload = {
"email": "johndoe@gmail.com",
"password": "P@ssw0rd!",
"role": "manager",
"user_name": "john_doe"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
email: 'johndoe@gmail.com',
password: 'P@ssw0rd!',
role: 'manager',
user_name: 'john_doe'
})
};
fetch('https://reimagined-journey-g45xxv4v6gwhvrrr-80.app.github.dev/users/{id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://reimagined-journey-g45xxv4v6gwhvrrr-80.app.github.dev/users/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'email' => 'johndoe@gmail.com',
'password' => 'P@ssw0rd!',
'role' => 'manager',
'user_name' => 'john_doe'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://reimagined-journey-g45xxv4v6gwhvrrr-80.app.github.dev/users/{id}"
payload := strings.NewReader("{\n \"email\": \"johndoe@gmail.com\",\n \"password\": \"P@ssw0rd!\",\n \"role\": \"manager\",\n \"user_name\": \"john_doe\"\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.put("https://reimagined-journey-g45xxv4v6gwhvrrr-80.app.github.dev/users/{id}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"email\": \"johndoe@gmail.com\",\n \"password\": \"P@ssw0rd!\",\n \"role\": \"manager\",\n \"user_name\": \"john_doe\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://reimagined-journey-g45xxv4v6gwhvrrr-80.app.github.dev/users/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"email\": \"johndoe@gmail.com\",\n \"password\": \"P@ssw0rd!\",\n \"role\": \"manager\",\n \"user_name\": \"john_doe\"\n}"
response = http.request(request)
puts response.read_body{
"id": "674d0bf5c28b69001f8e03a1",
"created_at": "2024-04-22T10:00:00Z",
"updated_at": "2024-04-22T10:00:00Z",
"user_name": "john_doe",
"email": "johndoe@gmail.com",
"password": "P@ssw0rd!",
"role": "manager"
}{
"title": "Human-readable error title.",
"detail": "Human-readable error details."
}{
"title": "Human-readable error title.",
"detail": "Human-readable error details."
}{
"title": "Human-readable error title.",
"detail": "Human-readable error details."
}Update a user
Update a user’s email, password, user_name, or role properties.
curl --request PUT \
--url https://reimagined-journey-g45xxv4v6gwhvrrr-80.app.github.dev/users/{id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"email": "johndoe@gmail.com",
"password": "P@ssw0rd!",
"role": "manager",
"user_name": "john_doe"
}
'import requests
url = "https://reimagined-journey-g45xxv4v6gwhvrrr-80.app.github.dev/users/{id}"
payload = {
"email": "johndoe@gmail.com",
"password": "P@ssw0rd!",
"role": "manager",
"user_name": "john_doe"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
email: 'johndoe@gmail.com',
password: 'P@ssw0rd!',
role: 'manager',
user_name: 'john_doe'
})
};
fetch('https://reimagined-journey-g45xxv4v6gwhvrrr-80.app.github.dev/users/{id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://reimagined-journey-g45xxv4v6gwhvrrr-80.app.github.dev/users/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'email' => 'johndoe@gmail.com',
'password' => 'P@ssw0rd!',
'role' => 'manager',
'user_name' => 'john_doe'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://reimagined-journey-g45xxv4v6gwhvrrr-80.app.github.dev/users/{id}"
payload := strings.NewReader("{\n \"email\": \"johndoe@gmail.com\",\n \"password\": \"P@ssw0rd!\",\n \"role\": \"manager\",\n \"user_name\": \"john_doe\"\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.put("https://reimagined-journey-g45xxv4v6gwhvrrr-80.app.github.dev/users/{id}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"email\": \"johndoe@gmail.com\",\n \"password\": \"P@ssw0rd!\",\n \"role\": \"manager\",\n \"user_name\": \"john_doe\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://reimagined-journey-g45xxv4v6gwhvrrr-80.app.github.dev/users/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"email\": \"johndoe@gmail.com\",\n \"password\": \"P@ssw0rd!\",\n \"role\": \"manager\",\n \"user_name\": \"john_doe\"\n}"
response = http.request(request)
puts response.read_body{
"id": "674d0bf5c28b69001f8e03a1",
"created_at": "2024-04-22T10:00:00Z",
"updated_at": "2024-04-22T10:00:00Z",
"user_name": "john_doe",
"email": "johndoe@gmail.com",
"password": "P@ssw0rd!",
"role": "manager"
}{
"title": "Human-readable error title.",
"detail": "Human-readable error details."
}{
"title": "Human-readable error title.",
"detail": "Human-readable error details."
}{
"title": "Human-readable error title.",
"detail": "Human-readable error details."
}Request Structure
{
"data": {
"type": "users",
"attributes": {
"name": "John D. Smith",
"role_id": 10,
"is_active": false
}
}
}
Key Fields
| Field | Required | Description |
|---|---|---|
email | No | Updated email address |
name | No | Updated display name |
role_id | No | New role assignment |
is_active | No | Enable or disable user |
Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Path Parameters
The unique user identifier, generated when the user was created.
Body
The request body for updating a user requires only the properties to be updated.
The email address for the user account.
"johndoe@gmail.com"
Passwords must be at least eight characters long and contain at least one uppercase letter, one lowercase letter, one digit, and one special character (@, $, !, %, *, ?, &).
"P@ssw0rd!"
The role assigned to a user account. A user's role will determine the level of access available for protected endpoints.
patron, expeditor, chef, manager "manager"
The user name for account login purposes. User names cannot contain spaces.
"john_doe"
Response
User updated successfully
A unique alpha-numeric string generated by the system when creating a resource (e.g., dishes, ingredients, etc). Ids are required for retrieving the properties of a specific resource.
"674d0bf5c28b69001f8e03a1"
The date and time the resource was created. Timestamp uses ISO 8601 format, Ex: 2025-04-05T14:55:03.824Z
"2024-04-22T10:00:00Z"
The date and time the resource was last updated.
Timestamp uses ISO 8601 format, Ex: 2025-04-05T14:55:03.824Z
"2024-04-22T10:00:00Z"
The user name for account login purposes. User names cannot contain spaces.
"john_doe"
The email address for the user account.
"johndoe@gmail.com"
Passwords must be at least eight characters long and contain at least one uppercase letter, one lowercase letter, one digit, and one special character (@, $, !, %, *, ?, &).
"P@ssw0rd!"
The role assigned to a user account. A user's role will determine the level of access available for protected endpoints.
patron, expeditor, chef, manager "manager"