Update a user profile
curl --request PATCH \
--url {schemes}://api.upsun.com/profiles/{userId} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"display_name": "<string>",
"username": "<string>",
"current_password": "<string>",
"password": "<string>",
"company_type": "<string>",
"company_name": "<string>",
"vat_number": "<string>",
"company_role": "<string>",
"marketing": true,
"ui_colorscheme": "<string>",
"default_catalog": "<string>",
"project_options_url": "<string>",
"picture": "<string>"
}
'import requests
url = "{schemes}://api.upsun.com/profiles/{userId}"
payload = {
"display_name": "<string>",
"username": "<string>",
"current_password": "<string>",
"password": "<string>",
"company_type": "<string>",
"company_name": "<string>",
"vat_number": "<string>",
"company_role": "<string>",
"marketing": True,
"ui_colorscheme": "<string>",
"default_catalog": "<string>",
"project_options_url": "<string>",
"picture": "<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({
display_name: '<string>',
username: '<string>',
current_password: '<string>',
password: '<string>',
company_type: '<string>',
company_name: '<string>',
vat_number: '<string>',
company_role: '<string>',
marketing: true,
ui_colorscheme: '<string>',
default_catalog: '<string>',
project_options_url: '<string>',
picture: '<string>'
})
};
fetch('{schemes}://api.upsun.com/profiles/{userId}', 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 => "{schemes}://api.upsun.com/profiles/{userId}",
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([
'display_name' => '<string>',
'username' => '<string>',
'current_password' => '<string>',
'password' => '<string>',
'company_type' => '<string>',
'company_name' => '<string>',
'vat_number' => '<string>',
'company_role' => '<string>',
'marketing' => true,
'ui_colorscheme' => '<string>',
'default_catalog' => '<string>',
'project_options_url' => '<string>',
'picture' => '<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 := "{schemes}://api.upsun.com/profiles/{userId}"
payload := strings.NewReader("{\n \"display_name\": \"<string>\",\n \"username\": \"<string>\",\n \"current_password\": \"<string>\",\n \"password\": \"<string>\",\n \"company_type\": \"<string>\",\n \"company_name\": \"<string>\",\n \"vat_number\": \"<string>\",\n \"company_role\": \"<string>\",\n \"marketing\": true,\n \"ui_colorscheme\": \"<string>\",\n \"default_catalog\": \"<string>\",\n \"project_options_url\": \"<string>\",\n \"picture\": \"<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("{schemes}://api.upsun.com/profiles/{userId}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"display_name\": \"<string>\",\n \"username\": \"<string>\",\n \"current_password\": \"<string>\",\n \"password\": \"<string>\",\n \"company_type\": \"<string>\",\n \"company_name\": \"<string>\",\n \"vat_number\": \"<string>\",\n \"company_role\": \"<string>\",\n \"marketing\": true,\n \"ui_colorscheme\": \"<string>\",\n \"default_catalog\": \"<string>\",\n \"project_options_url\": \"<string>\",\n \"picture\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("{schemes}://api.upsun.com/profiles/{userId}")
http = Net::HTTP.new(url.host, url.port)
request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"display_name\": \"<string>\",\n \"username\": \"<string>\",\n \"current_password\": \"<string>\",\n \"password\": \"<string>\",\n \"company_type\": \"<string>\",\n \"company_name\": \"<string>\",\n \"vat_number\": \"<string>\",\n \"company_role\": \"<string>\",\n \"marketing\": true,\n \"ui_colorscheme\": \"<string>\",\n \"default_catalog\": \"<string>\",\n \"project_options_url\": \"<string>\",\n \"picture\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"display_name": "<string>",
"email": "jsmith@example.com",
"username": "<string>",
"type": "user",
"picture": "<string>",
"company_type": "<string>",
"company_name": "<string>",
"currency": "<string>",
"vat_number": "<string>",
"company_role": "<string>",
"website_url": "<string>",
"new_ui": true,
"ui_colorscheme": "<string>",
"default_catalog": "<string>",
"project_options_url": "<string>",
"marketing": true,
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"billing_contact": "jsmith@example.com",
"invoiced": true,
"customer_type": "individual",
"legal_entity_name": "<string>"
}User Profiles
Update a user profile
deprecated
Update a user profile, supplying one or more key/value pairs to to change.
PATCH
/
profiles
/
{userId}
Update a user profile
curl --request PATCH \
--url {schemes}://api.upsun.com/profiles/{userId} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"display_name": "<string>",
"username": "<string>",
"current_password": "<string>",
"password": "<string>",
"company_type": "<string>",
"company_name": "<string>",
"vat_number": "<string>",
"company_role": "<string>",
"marketing": true,
"ui_colorscheme": "<string>",
"default_catalog": "<string>",
"project_options_url": "<string>",
"picture": "<string>"
}
'import requests
url = "{schemes}://api.upsun.com/profiles/{userId}"
payload = {
"display_name": "<string>",
"username": "<string>",
"current_password": "<string>",
"password": "<string>",
"company_type": "<string>",
"company_name": "<string>",
"vat_number": "<string>",
"company_role": "<string>",
"marketing": True,
"ui_colorscheme": "<string>",
"default_catalog": "<string>",
"project_options_url": "<string>",
"picture": "<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({
display_name: '<string>',
username: '<string>',
current_password: '<string>',
password: '<string>',
company_type: '<string>',
company_name: '<string>',
vat_number: '<string>',
company_role: '<string>',
marketing: true,
ui_colorscheme: '<string>',
default_catalog: '<string>',
project_options_url: '<string>',
picture: '<string>'
})
};
fetch('{schemes}://api.upsun.com/profiles/{userId}', 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 => "{schemes}://api.upsun.com/profiles/{userId}",
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([
'display_name' => '<string>',
'username' => '<string>',
'current_password' => '<string>',
'password' => '<string>',
'company_type' => '<string>',
'company_name' => '<string>',
'vat_number' => '<string>',
'company_role' => '<string>',
'marketing' => true,
'ui_colorscheme' => '<string>',
'default_catalog' => '<string>',
'project_options_url' => '<string>',
'picture' => '<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 := "{schemes}://api.upsun.com/profiles/{userId}"
payload := strings.NewReader("{\n \"display_name\": \"<string>\",\n \"username\": \"<string>\",\n \"current_password\": \"<string>\",\n \"password\": \"<string>\",\n \"company_type\": \"<string>\",\n \"company_name\": \"<string>\",\n \"vat_number\": \"<string>\",\n \"company_role\": \"<string>\",\n \"marketing\": true,\n \"ui_colorscheme\": \"<string>\",\n \"default_catalog\": \"<string>\",\n \"project_options_url\": \"<string>\",\n \"picture\": \"<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("{schemes}://api.upsun.com/profiles/{userId}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"display_name\": \"<string>\",\n \"username\": \"<string>\",\n \"current_password\": \"<string>\",\n \"password\": \"<string>\",\n \"company_type\": \"<string>\",\n \"company_name\": \"<string>\",\n \"vat_number\": \"<string>\",\n \"company_role\": \"<string>\",\n \"marketing\": true,\n \"ui_colorscheme\": \"<string>\",\n \"default_catalog\": \"<string>\",\n \"project_options_url\": \"<string>\",\n \"picture\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("{schemes}://api.upsun.com/profiles/{userId}")
http = Net::HTTP.new(url.host, url.port)
request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"display_name\": \"<string>\",\n \"username\": \"<string>\",\n \"current_password\": \"<string>\",\n \"password\": \"<string>\",\n \"company_type\": \"<string>\",\n \"company_name\": \"<string>\",\n \"vat_number\": \"<string>\",\n \"company_role\": \"<string>\",\n \"marketing\": true,\n \"ui_colorscheme\": \"<string>\",\n \"default_catalog\": \"<string>\",\n \"project_options_url\": \"<string>\",\n \"picture\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"display_name": "<string>",
"email": "jsmith@example.com",
"username": "<string>",
"type": "user",
"picture": "<string>",
"company_type": "<string>",
"company_name": "<string>",
"currency": "<string>",
"vat_number": "<string>",
"company_role": "<string>",
"website_url": "<string>",
"new_ui": true,
"ui_colorscheme": "<string>",
"default_catalog": "<string>",
"project_options_url": "<string>",
"marketing": true,
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"billing_contact": "jsmith@example.com",
"invoiced": true,
"customer_type": "individual",
"legal_entity_name": "<string>"
}Authorizations
Body
application/json
Response
200 - application/json
A User profile object
The user profile.
Was this page helpful?