curl --request PATCH \
--url https://api.sandbox.tesouro.com/identity/v1/users/{id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"address1": "<string>",
"address2": "<string>",
"city": "<string>",
"country": "<string>",
"jobTitle": "<string>",
"name": "<string>",
"permissions": {
"grant": [
"<string>"
],
"revoke": [
"<string>"
]
},
"phoneNumber": "<string>",
"postalCode": "<string>",
"reportingManagerUserId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"stateOrProvince": "<string>"
}
'import requests
url = "https://api.sandbox.tesouro.com/identity/v1/users/{id}"
payload = {
"address1": "<string>",
"address2": "<string>",
"city": "<string>",
"country": "<string>",
"jobTitle": "<string>",
"name": "<string>",
"permissions": {
"grant": ["<string>"],
"revoke": ["<string>"]
},
"phoneNumber": "<string>",
"postalCode": "<string>",
"reportingManagerUserId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"stateOrProvince": "<string>"
}
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({
address1: '<string>',
address2: '<string>',
city: '<string>',
country: '<string>',
jobTitle: '<string>',
name: '<string>',
permissions: {grant: ['<string>'], revoke: ['<string>']},
phoneNumber: '<string>',
postalCode: '<string>',
reportingManagerUserId: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
stateOrProvince: '<string>'
})
};
fetch('https://api.sandbox.tesouro.com/identity/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://api.sandbox.tesouro.com/identity/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([
'address1' => '<string>',
'address2' => '<string>',
'city' => '<string>',
'country' => '<string>',
'jobTitle' => '<string>',
'name' => '<string>',
'permissions' => [
'grant' => [
'<string>'
],
'revoke' => [
'<string>'
]
],
'phoneNumber' => '<string>',
'postalCode' => '<string>',
'reportingManagerUserId' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'stateOrProvince' => '<string>'
]),
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://api.sandbox.tesouro.com/identity/v1/users/{id}"
payload := strings.NewReader("{\n \"address1\": \"<string>\",\n \"address2\": \"<string>\",\n \"city\": \"<string>\",\n \"country\": \"<string>\",\n \"jobTitle\": \"<string>\",\n \"name\": \"<string>\",\n \"permissions\": {\n \"grant\": [\n \"<string>\"\n ],\n \"revoke\": [\n \"<string>\"\n ]\n },\n \"phoneNumber\": \"<string>\",\n \"postalCode\": \"<string>\",\n \"reportingManagerUserId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"stateOrProvince\": \"<string>\"\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://api.sandbox.tesouro.com/identity/v1/users/{id}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"address1\": \"<string>\",\n \"address2\": \"<string>\",\n \"city\": \"<string>\",\n \"country\": \"<string>\",\n \"jobTitle\": \"<string>\",\n \"name\": \"<string>\",\n \"permissions\": {\n \"grant\": [\n \"<string>\"\n ],\n \"revoke\": [\n \"<string>\"\n ]\n },\n \"phoneNumber\": \"<string>\",\n \"postalCode\": \"<string>\",\n \"reportingManagerUserId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"stateOrProvince\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.sandbox.tesouro.com/identity/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 \"address1\": \"<string>\",\n \"address2\": \"<string>\",\n \"city\": \"<string>\",\n \"country\": \"<string>\",\n \"jobTitle\": \"<string>\",\n \"name\": \"<string>\",\n \"permissions\": {\n \"grant\": [\n \"<string>\"\n ],\n \"revoke\": [\n \"<string>\"\n ]\n },\n \"phoneNumber\": \"<string>\",\n \"postalCode\": \"<string>\",\n \"reportingManagerUserId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"stateOrProvince\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"email": "<string>",
"name": "<string>",
"organizationId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"status": "<string>",
"address1": "<string>",
"address2": "<string>",
"city": "<string>",
"country": "<string>",
"jobTitle": "<string>",
"phoneNumber": "<string>",
"postalCode": "<string>",
"reportingManagerUserId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"stateOrProvince": "<string>"
}{
"detail": "<string>",
"instance": "<string>",
"status": 123,
"title": "<string>",
"type": "<string>"
}{
"detail": "<string>",
"instance": "<string>",
"status": 123,
"title": "<string>",
"type": "<string>"
}{
"detail": "<string>",
"instance": "<string>",
"status": 123,
"title": "<string>",
"type": "<string>"
}{
"detail": "<string>",
"instance": "<string>",
"status": 123,
"title": "<string>",
"type": "<string>"
}{
"detail": "<string>",
"instance": "<string>",
"status": 123,
"title": "<string>",
"type": "<string>"
}Updates profile fields for a user accessible to the caller.
Updating a user in the caller’s own organization requires the user:write:org scope. Updating a user in another (downstream) organization requires the user:write:all scope. A caller cannot update their own profile.
Token types: APP, USER | Accepted scopes (any of): user:write:all, user:write:org
curl --request PATCH \
--url https://api.sandbox.tesouro.com/identity/v1/users/{id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"address1": "<string>",
"address2": "<string>",
"city": "<string>",
"country": "<string>",
"jobTitle": "<string>",
"name": "<string>",
"permissions": {
"grant": [
"<string>"
],
"revoke": [
"<string>"
]
},
"phoneNumber": "<string>",
"postalCode": "<string>",
"reportingManagerUserId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"stateOrProvince": "<string>"
}
'import requests
url = "https://api.sandbox.tesouro.com/identity/v1/users/{id}"
payload = {
"address1": "<string>",
"address2": "<string>",
"city": "<string>",
"country": "<string>",
"jobTitle": "<string>",
"name": "<string>",
"permissions": {
"grant": ["<string>"],
"revoke": ["<string>"]
},
"phoneNumber": "<string>",
"postalCode": "<string>",
"reportingManagerUserId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"stateOrProvince": "<string>"
}
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({
address1: '<string>',
address2: '<string>',
city: '<string>',
country: '<string>',
jobTitle: '<string>',
name: '<string>',
permissions: {grant: ['<string>'], revoke: ['<string>']},
phoneNumber: '<string>',
postalCode: '<string>',
reportingManagerUserId: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
stateOrProvince: '<string>'
})
};
fetch('https://api.sandbox.tesouro.com/identity/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://api.sandbox.tesouro.com/identity/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([
'address1' => '<string>',
'address2' => '<string>',
'city' => '<string>',
'country' => '<string>',
'jobTitle' => '<string>',
'name' => '<string>',
'permissions' => [
'grant' => [
'<string>'
],
'revoke' => [
'<string>'
]
],
'phoneNumber' => '<string>',
'postalCode' => '<string>',
'reportingManagerUserId' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'stateOrProvince' => '<string>'
]),
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://api.sandbox.tesouro.com/identity/v1/users/{id}"
payload := strings.NewReader("{\n \"address1\": \"<string>\",\n \"address2\": \"<string>\",\n \"city\": \"<string>\",\n \"country\": \"<string>\",\n \"jobTitle\": \"<string>\",\n \"name\": \"<string>\",\n \"permissions\": {\n \"grant\": [\n \"<string>\"\n ],\n \"revoke\": [\n \"<string>\"\n ]\n },\n \"phoneNumber\": \"<string>\",\n \"postalCode\": \"<string>\",\n \"reportingManagerUserId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"stateOrProvince\": \"<string>\"\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://api.sandbox.tesouro.com/identity/v1/users/{id}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"address1\": \"<string>\",\n \"address2\": \"<string>\",\n \"city\": \"<string>\",\n \"country\": \"<string>\",\n \"jobTitle\": \"<string>\",\n \"name\": \"<string>\",\n \"permissions\": {\n \"grant\": [\n \"<string>\"\n ],\n \"revoke\": [\n \"<string>\"\n ]\n },\n \"phoneNumber\": \"<string>\",\n \"postalCode\": \"<string>\",\n \"reportingManagerUserId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"stateOrProvince\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.sandbox.tesouro.com/identity/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 \"address1\": \"<string>\",\n \"address2\": \"<string>\",\n \"city\": \"<string>\",\n \"country\": \"<string>\",\n \"jobTitle\": \"<string>\",\n \"name\": \"<string>\",\n \"permissions\": {\n \"grant\": [\n \"<string>\"\n ],\n \"revoke\": [\n \"<string>\"\n ]\n },\n \"phoneNumber\": \"<string>\",\n \"postalCode\": \"<string>\",\n \"reportingManagerUserId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"stateOrProvince\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"email": "<string>",
"name": "<string>",
"organizationId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"status": "<string>",
"address1": "<string>",
"address2": "<string>",
"city": "<string>",
"country": "<string>",
"jobTitle": "<string>",
"phoneNumber": "<string>",
"postalCode": "<string>",
"reportingManagerUserId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"stateOrProvince": "<string>"
}{
"detail": "<string>",
"instance": "<string>",
"status": 123,
"title": "<string>",
"type": "<string>"
}{
"detail": "<string>",
"instance": "<string>",
"status": 123,
"title": "<string>",
"type": "<string>"
}{
"detail": "<string>",
"instance": "<string>",
"status": 123,
"title": "<string>",
"type": "<string>"
}{
"detail": "<string>",
"instance": "<string>",
"status": 123,
"title": "<string>",
"type": "<string>"
}{
"detail": "<string>",
"instance": "<string>",
"status": 123,
"title": "<string>",
"type": "<string>"
}Authorizations
Application (M2M) OAuth2 access token (client credentials).
Path Parameters
The user ID to update.
Body
Cancellation token.
Explicit grant/revoke deltas for the user's permissions. Permissions not listed in either array are left untouched, so a caller managing only a subset of permissions does not have to round-trip every permission the target already holds.
Show child attributes
Show child attributes
The ID of the user's reporting manager. Three states: absent = leave unchanged, null = clear, value = set to the provided ID.
Response
User updated successfully.
Was this page helpful?