Update a User
curl --request PATCH \
--url https://identity.sandbox.lerian.net/v1/users/{id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"email": "john@example.com",
"firstName": "John",
"groups": [
"admin-group",
"midaz-viewer-group"
],
"lastName": "Doe"
}
'import requests
url = "https://identity.sandbox.lerian.net/v1/users/{id}"
payload = {
"email": "john@example.com",
"firstName": "John",
"groups": ["admin-group", "midaz-viewer-group"],
"lastName": "Doe"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
email: 'john@example.com',
firstName: 'John',
groups: ['admin-group', 'midaz-viewer-group'],
lastName: 'Doe'
})
};
fetch('https://identity.sandbox.lerian.net/v1/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://identity.sandbox.lerian.net/v1/users/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'email' => 'john@example.com',
'firstName' => 'John',
'groups' => [
'admin-group',
'midaz-viewer-group'
],
'lastName' => '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://identity.sandbox.lerian.net/v1/users/{id}"
payload := strings.NewReader("{\n \"email\": \"john@example.com\",\n \"firstName\": \"John\",\n \"groups\": [\n \"admin-group\",\n \"midaz-viewer-group\"\n ],\n \"lastName\": \"Doe\"\n}")
req, _ := http.NewRequest("PATCH", 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.patch("https://identity.sandbox.lerian.net/v1/users/{id}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"email\": \"john@example.com\",\n \"firstName\": \"John\",\n \"groups\": [\n \"admin-group\",\n \"midaz-viewer-group\"\n ],\n \"lastName\": \"Doe\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://identity.sandbox.lerian.net/v1/users/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"email\": \"john@example.com\",\n \"firstName\": \"John\",\n \"groups\": [\n \"admin-group\",\n \"midaz-viewer-group\"\n ],\n \"lastName\": \"Doe\"\n}"
response = http.request(request)
puts response.read_body{
"email": "john@example.com",
"firstName": "John",
"groups": [
"admin-group",
"midaz-viewer-group"
],
"lastName": "Doe"
}Update a User
Use this endpoint to update a user’s information, such as name, email, or group assignments.
PATCH
/
v1
/
users
/
{id}
Update a User
curl --request PATCH \
--url https://identity.sandbox.lerian.net/v1/users/{id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"email": "john@example.com",
"firstName": "John",
"groups": [
"admin-group",
"midaz-viewer-group"
],
"lastName": "Doe"
}
'import requests
url = "https://identity.sandbox.lerian.net/v1/users/{id}"
payload = {
"email": "john@example.com",
"firstName": "John",
"groups": ["admin-group", "midaz-viewer-group"],
"lastName": "Doe"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
email: 'john@example.com',
firstName: 'John',
groups: ['admin-group', 'midaz-viewer-group'],
lastName: 'Doe'
})
};
fetch('https://identity.sandbox.lerian.net/v1/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://identity.sandbox.lerian.net/v1/users/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'email' => 'john@example.com',
'firstName' => 'John',
'groups' => [
'admin-group',
'midaz-viewer-group'
],
'lastName' => '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://identity.sandbox.lerian.net/v1/users/{id}"
payload := strings.NewReader("{\n \"email\": \"john@example.com\",\n \"firstName\": \"John\",\n \"groups\": [\n \"admin-group\",\n \"midaz-viewer-group\"\n ],\n \"lastName\": \"Doe\"\n}")
req, _ := http.NewRequest("PATCH", 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.patch("https://identity.sandbox.lerian.net/v1/users/{id}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"email\": \"john@example.com\",\n \"firstName\": \"John\",\n \"groups\": [\n \"admin-group\",\n \"midaz-viewer-group\"\n ],\n \"lastName\": \"Doe\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://identity.sandbox.lerian.net/v1/users/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"email\": \"john@example.com\",\n \"firstName\": \"John\",\n \"groups\": [\n \"admin-group\",\n \"midaz-viewer-group\"\n ],\n \"lastName\": \"Doe\"\n}"
response = http.request(request)
puts response.read_body{
"email": "john@example.com",
"firstName": "John",
"groups": [
"admin-group",
"midaz-viewer-group"
],
"lastName": "Doe"
}Authorizations
The authorization token in the 'Bearer ' format.
Path Parameters
The unique identifier of the user you want to retrieve.
Body
application/json
Response
Indicates that the resource was successfully updated and the operation was completed as expected.
Was this page helpful?
⌘I

