Update user profile
curl --request PUT \
--url https://closedvpn.io/auth/settings-profile \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"givenName": "John",
"surname": "Doe",
"phoneNumber": "+441234567890",
"companyName": "Acme Ltd",
"receiveNotifications": true,
"receivePromotional": false
}
'import requests
url = "https://closedvpn.io/auth/settings-profile"
payload = {
"givenName": "John",
"surname": "Doe",
"phoneNumber": "+441234567890",
"companyName": "Acme Ltd",
"receiveNotifications": True,
"receivePromotional": False
}
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({
givenName: 'John',
surname: 'Doe',
phoneNumber: '+441234567890',
companyName: 'Acme Ltd',
receiveNotifications: true,
receivePromotional: false
})
};
fetch('https://closedvpn.io/auth/settings-profile', 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://closedvpn.io/auth/settings-profile",
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([
'givenName' => 'John',
'surname' => 'Doe',
'phoneNumber' => '+441234567890',
'companyName' => 'Acme Ltd',
'receiveNotifications' => true,
'receivePromotional' => false
]),
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://closedvpn.io/auth/settings-profile"
payload := strings.NewReader("{\n \"givenName\": \"John\",\n \"surname\": \"Doe\",\n \"phoneNumber\": \"+441234567890\",\n \"companyName\": \"Acme Ltd\",\n \"receiveNotifications\": true,\n \"receivePromotional\": false\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://closedvpn.io/auth/settings-profile")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"givenName\": \"John\",\n \"surname\": \"Doe\",\n \"phoneNumber\": \"+441234567890\",\n \"companyName\": \"Acme Ltd\",\n \"receiveNotifications\": true,\n \"receivePromotional\": false\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://closedvpn.io/auth/settings-profile")
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 \"givenName\": \"John\",\n \"surname\": \"Doe\",\n \"phoneNumber\": \"+441234567890\",\n \"companyName\": \"Acme Ltd\",\n \"receiveNotifications\": true,\n \"receivePromotional\": false\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"name": "John Doe",
"email": "[email protected]",
"avatar": "JD",
"givenName": "John",
"surname": "Doe",
"phoneNumber": "+441234567890",
"companyName": "Acme Ltd",
"receiveNotifications": true,
"receivePromotional": false
}{
"success": false,
"message": "Name cannot be empty"
}{
"success": false,
"message": "Unauthorized"
}{
"success": false,
"message": "User not found"
}{
"success": false,
"message": "Server error",
"error": "Detailed error message"
}Profile
Update Profile
Updates the user’s profile and syncs the new display name across every organization they belong to. The display name is composed from givenName and surname; there is no name field in the request. Omitted optional fields are reset to their empty value rather than left unchanged, so send the complete profile on every call.
PUT
/
auth
/
settings-profile
Update user profile
curl --request PUT \
--url https://closedvpn.io/auth/settings-profile \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"givenName": "John",
"surname": "Doe",
"phoneNumber": "+441234567890",
"companyName": "Acme Ltd",
"receiveNotifications": true,
"receivePromotional": false
}
'import requests
url = "https://closedvpn.io/auth/settings-profile"
payload = {
"givenName": "John",
"surname": "Doe",
"phoneNumber": "+441234567890",
"companyName": "Acme Ltd",
"receiveNotifications": True,
"receivePromotional": False
}
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({
givenName: 'John',
surname: 'Doe',
phoneNumber: '+441234567890',
companyName: 'Acme Ltd',
receiveNotifications: true,
receivePromotional: false
})
};
fetch('https://closedvpn.io/auth/settings-profile', 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://closedvpn.io/auth/settings-profile",
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([
'givenName' => 'John',
'surname' => 'Doe',
'phoneNumber' => '+441234567890',
'companyName' => 'Acme Ltd',
'receiveNotifications' => true,
'receivePromotional' => false
]),
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://closedvpn.io/auth/settings-profile"
payload := strings.NewReader("{\n \"givenName\": \"John\",\n \"surname\": \"Doe\",\n \"phoneNumber\": \"+441234567890\",\n \"companyName\": \"Acme Ltd\",\n \"receiveNotifications\": true,\n \"receivePromotional\": false\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://closedvpn.io/auth/settings-profile")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"givenName\": \"John\",\n \"surname\": \"Doe\",\n \"phoneNumber\": \"+441234567890\",\n \"companyName\": \"Acme Ltd\",\n \"receiveNotifications\": true,\n \"receivePromotional\": false\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://closedvpn.io/auth/settings-profile")
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 \"givenName\": \"John\",\n \"surname\": \"Doe\",\n \"phoneNumber\": \"+441234567890\",\n \"companyName\": \"Acme Ltd\",\n \"receiveNotifications\": true,\n \"receivePromotional\": false\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"name": "John Doe",
"email": "[email protected]",
"avatar": "JD",
"givenName": "John",
"surname": "Doe",
"phoneNumber": "+441234567890",
"companyName": "Acme Ltd",
"receiveNotifications": true,
"receivePromotional": false
}{
"success": false,
"message": "Name cannot be empty"
}{
"success": false,
"message": "Unauthorized"
}{
"success": false,
"message": "User not found"
}{
"success": false,
"message": "Server error",
"error": "Detailed error message"
}Authorizations
Personal Access Token (PAT) passed in the Authorization header (e.g., Bearer <pat>) for authenticated API requests. PATs are generated via /auth/generate-pat after authenticating through the magic link flow.
Body
application/json
Response
Profile updated successfully
Example:
true
Example:
"John Doe"
Example:
Example:
"JD"
Example:
"John"
Example:
"Doe"
Example:
"+441234567890"
Example:
"Acme Ltd"
Example:
true
Example:
false

