curl --request PATCH \
--url https://api.iklim.co/v1/users/update \
--header 'Content-Type: application/json' \
--data @- <<EOF
{
"userId": "88a52d74-ebee-49a4-9631-cfe492f4bf53",
"username": "newuser@domain.com",
"password": "newStr0ng!P@ssw0rd",
"firstName": "<string>",
"midName": "<string>",
"lastName": "<string>",
"locale": "tr_TR",
"timezone": "Europe/Istanbul",
"roles": "['API_USER']",
"status": "INACTIVE",
"empty": true
}
EOFimport requests
url = "https://api.iklim.co/v1/users/update"
payload = {
"userId": "88a52d74-ebee-49a4-9631-cfe492f4bf53",
"username": "newuser@domain.com",
"password": "newStr0ng!P@ssw0rd",
"firstName": "<string>",
"midName": "<string>",
"lastName": "<string>",
"locale": "tr_TR",
"timezone": "Europe/Istanbul",
"roles": "['API_USER']",
"status": "INACTIVE",
"empty": True
}
headers = {"Content-Type": "application/json"}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
userId: '88a52d74-ebee-49a4-9631-cfe492f4bf53',
username: 'newuser@domain.com',
password: 'newStr0ng!P@ssw0rd',
firstName: '<string>',
midName: '<string>',
lastName: '<string>',
locale: 'tr_TR',
timezone: 'Europe/Istanbul',
roles: '[\'API_USER\']',
status: 'INACTIVE',
empty: true
})
};
fetch('https://api.iklim.co/v1/users/update', 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://api.iklim.co/v1/users/update",
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([
'userId' => '88a52d74-ebee-49a4-9631-cfe492f4bf53',
'username' => 'newuser@domain.com',
'password' => 'newStr0ng!P@ssw0rd',
'firstName' => '<string>',
'midName' => '<string>',
'lastName' => '<string>',
'locale' => 'tr_TR',
'timezone' => 'Europe/Istanbul',
'roles' => '[\'API_USER\']',
'status' => 'INACTIVE',
'empty' => true
]),
CURLOPT_HTTPHEADER => [
"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://api.iklim.co/v1/users/update"
payload := strings.NewReader("{\n \"userId\": \"88a52d74-ebee-49a4-9631-cfe492f4bf53\",\n \"username\": \"newuser@domain.com\",\n \"password\": \"newStr0ng!P@ssw0rd\",\n \"firstName\": \"<string>\",\n \"midName\": \"<string>\",\n \"lastName\": \"<string>\",\n \"locale\": \"tr_TR\",\n \"timezone\": \"Europe/Istanbul\",\n \"roles\": \"['API_USER']\",\n \"status\": \"INACTIVE\",\n \"empty\": true\n}")
req, _ := http.NewRequest("PATCH", url, payload)
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://api.iklim.co/v1/users/update")
.header("Content-Type", "application/json")
.body("{\n \"userId\": \"88a52d74-ebee-49a4-9631-cfe492f4bf53\",\n \"username\": \"newuser@domain.com\",\n \"password\": \"newStr0ng!P@ssw0rd\",\n \"firstName\": \"<string>\",\n \"midName\": \"<string>\",\n \"lastName\": \"<string>\",\n \"locale\": \"tr_TR\",\n \"timezone\": \"Europe/Istanbul\",\n \"roles\": \"['API_USER']\",\n \"status\": \"INACTIVE\",\n \"empty\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.iklim.co/v1/users/update")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"userId\": \"88a52d74-ebee-49a4-9631-cfe492f4bf53\",\n \"username\": \"newuser@domain.com\",\n \"password\": \"newStr0ng!P@ssw0rd\",\n \"firstName\": \"<string>\",\n \"midName\": \"<string>\",\n \"lastName\": \"<string>\",\n \"locale\": \"tr_TR\",\n \"timezone\": \"Europe/Istanbul\",\n \"roles\": \"['API_USER']\",\n \"status\": \"INACTIVE\",\n \"empty\": true\n}"
response = http.request(request)
puts response.read_body{
"userId": "8e94a551-5b86-40ba-ae55-b019dee5cc25",
"username": "name@domain.com",
"firstName": "John",
"lastName": "Doe",
"locale": "tr_TR",
"timezone": "Europe/Istanbul",
"roles": "API_USER",
"status": "INACTIVE",
"midName": "Bob",
"account": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"userId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"type": "INDIVIDUAL",
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z",
"mobilePhoneNumber": "<string>",
"location": "<string>",
"company": "<string>",
"industry": "<string>",
"profilePictureUrl": "<string>",
"subscriptionPlan": "NONE",
"emailVerified": true,
"mobilePhoneNumberVerified": true
}
}User Update Operation
An operation where only users with the ADMIN role can update roles, status, and password; only users with POWER_USER and higher roles, along with the requesting user themselves, can change the username; and users with other roles can update the remaining fields.
curl --request PATCH \
--url https://api.iklim.co/v1/users/update \
--header 'Content-Type: application/json' \
--data @- <<EOF
{
"userId": "88a52d74-ebee-49a4-9631-cfe492f4bf53",
"username": "newuser@domain.com",
"password": "newStr0ng!P@ssw0rd",
"firstName": "<string>",
"midName": "<string>",
"lastName": "<string>",
"locale": "tr_TR",
"timezone": "Europe/Istanbul",
"roles": "['API_USER']",
"status": "INACTIVE",
"empty": true
}
EOFimport requests
url = "https://api.iklim.co/v1/users/update"
payload = {
"userId": "88a52d74-ebee-49a4-9631-cfe492f4bf53",
"username": "newuser@domain.com",
"password": "newStr0ng!P@ssw0rd",
"firstName": "<string>",
"midName": "<string>",
"lastName": "<string>",
"locale": "tr_TR",
"timezone": "Europe/Istanbul",
"roles": "['API_USER']",
"status": "INACTIVE",
"empty": True
}
headers = {"Content-Type": "application/json"}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
userId: '88a52d74-ebee-49a4-9631-cfe492f4bf53',
username: 'newuser@domain.com',
password: 'newStr0ng!P@ssw0rd',
firstName: '<string>',
midName: '<string>',
lastName: '<string>',
locale: 'tr_TR',
timezone: 'Europe/Istanbul',
roles: '[\'API_USER\']',
status: 'INACTIVE',
empty: true
})
};
fetch('https://api.iklim.co/v1/users/update', 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://api.iklim.co/v1/users/update",
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([
'userId' => '88a52d74-ebee-49a4-9631-cfe492f4bf53',
'username' => 'newuser@domain.com',
'password' => 'newStr0ng!P@ssw0rd',
'firstName' => '<string>',
'midName' => '<string>',
'lastName' => '<string>',
'locale' => 'tr_TR',
'timezone' => 'Europe/Istanbul',
'roles' => '[\'API_USER\']',
'status' => 'INACTIVE',
'empty' => true
]),
CURLOPT_HTTPHEADER => [
"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://api.iklim.co/v1/users/update"
payload := strings.NewReader("{\n \"userId\": \"88a52d74-ebee-49a4-9631-cfe492f4bf53\",\n \"username\": \"newuser@domain.com\",\n \"password\": \"newStr0ng!P@ssw0rd\",\n \"firstName\": \"<string>\",\n \"midName\": \"<string>\",\n \"lastName\": \"<string>\",\n \"locale\": \"tr_TR\",\n \"timezone\": \"Europe/Istanbul\",\n \"roles\": \"['API_USER']\",\n \"status\": \"INACTIVE\",\n \"empty\": true\n}")
req, _ := http.NewRequest("PATCH", url, payload)
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://api.iklim.co/v1/users/update")
.header("Content-Type", "application/json")
.body("{\n \"userId\": \"88a52d74-ebee-49a4-9631-cfe492f4bf53\",\n \"username\": \"newuser@domain.com\",\n \"password\": \"newStr0ng!P@ssw0rd\",\n \"firstName\": \"<string>\",\n \"midName\": \"<string>\",\n \"lastName\": \"<string>\",\n \"locale\": \"tr_TR\",\n \"timezone\": \"Europe/Istanbul\",\n \"roles\": \"['API_USER']\",\n \"status\": \"INACTIVE\",\n \"empty\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.iklim.co/v1/users/update")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"userId\": \"88a52d74-ebee-49a4-9631-cfe492f4bf53\",\n \"username\": \"newuser@domain.com\",\n \"password\": \"newStr0ng!P@ssw0rd\",\n \"firstName\": \"<string>\",\n \"midName\": \"<string>\",\n \"lastName\": \"<string>\",\n \"locale\": \"tr_TR\",\n \"timezone\": \"Europe/Istanbul\",\n \"roles\": \"['API_USER']\",\n \"status\": \"INACTIVE\",\n \"empty\": true\n}"
response = http.request(request)
puts response.read_body{
"userId": "8e94a551-5b86-40ba-ae55-b019dee5cc25",
"username": "name@domain.com",
"firstName": "John",
"lastName": "Doe",
"locale": "tr_TR",
"timezone": "Europe/Istanbul",
"roles": "API_USER",
"status": "INACTIVE",
"midName": "Bob",
"account": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"userId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"type": "INDIVIDUAL",
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z",
"mobilePhoneNumber": "<string>",
"location": "<string>",
"company": "<string>",
"industry": "<string>",
"profilePictureUrl": "<string>",
"subscriptionPlan": "NONE",
"emailVerified": true,
"mobilePhoneNumberVerified": true
}
}Body
Identifier of the Updating User
"88a52d74-ebee-49a4-9631-cfe492f4bf53"
New Username. This Field Can Be Updated by the User Themselves or by Users with POWER_USER Role!
"newuser@domain.com"
User's New Password. This Field Can Only Be Updated by Users with ADMIN Role!
"newStr0ng!P@ssw0rd"
User's New First Name
User's New Middle Name
User's New Last Name
User's New Locale
"tr_TR"
User's New Time Zone
"Europe/Istanbul"
User's New Roles. This Field Can Only Be Updated by Users with ADMIN Role!
{msg:swagger.schema.users.update.roles}
GUEST, API_USER, STANDARD_USER, POWER_USER, EXTENDED_USER, ADMIN "['API_USER']"
User's New Status. This Field Can Only Be Updated by Users with ADMIN Role!
INACTIVE, ACTIVE, EXPIRED, BLOCKED, DELETED "INACTIVE"
Response
Successful User Update
ID Number of Registered User
"8e94a551-5b86-40ba-ae55-b019dee5cc25"
Registered User Name
"name@domain.com"
Registered User First Name
"John"
Registered User Last Name
"Doe"
Registered User Locale
"tr_TR"
Registered User Time Zone Id
"Europe/Istanbul"
Registered User Roles
{msg:swagger.schema.auth.register-response.roles}
GUEST, API_USER, STANDARD_USER, POWER_USER, EXTENDED_USER, ADMIN "API_USER"
Registered User Status
INACTIVE, ACTIVE, EXPIRED, BLOCKED, DELETED "INACTIVE"
Registered User Mid Name
"Bob"
Show child attributes
Show child attributes