Update Profile
curl --request PATCH \
--url https://api.bunship.com/api/v1/users/me \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"fullName": "<string>",
"avatarUrl": {},
"preferences": {
"preferences.theme": "<string>",
"preferences.language": "<string>",
"preferences.timezone": "<string>",
"preferences.notifications": {}
}
}
'import requests
url = "https://api.bunship.com/api/v1/users/me"
payload = {
"fullName": "<string>",
"avatarUrl": {},
"preferences": {
"preferences.theme": "<string>",
"preferences.language": "<string>",
"preferences.timezone": "<string>",
"preferences.notifications": {}
}
}
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({
fullName: '<string>',
avatarUrl: {},
preferences: {
'preferences.theme': '<string>',
'preferences.language': '<string>',
'preferences.timezone': '<string>',
'preferences.notifications': {}
}
})
};
fetch('https://api.bunship.com/api/v1/users/me', 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.bunship.com/api/v1/users/me",
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([
'fullName' => '<string>',
'avatarUrl' => [
],
'preferences' => [
'preferences.theme' => '<string>',
'preferences.language' => '<string>',
'preferences.timezone' => '<string>',
'preferences.notifications' => [
]
]
]),
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.bunship.com/api/v1/users/me"
payload := strings.NewReader("{\n \"fullName\": \"<string>\",\n \"avatarUrl\": {},\n \"preferences\": {\n \"preferences.theme\": \"<string>\",\n \"preferences.language\": \"<string>\",\n \"preferences.timezone\": \"<string>\",\n \"preferences.notifications\": {}\n }\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.bunship.com/api/v1/users/me")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"fullName\": \"<string>\",\n \"avatarUrl\": {},\n \"preferences\": {\n \"preferences.theme\": \"<string>\",\n \"preferences.language\": \"<string>\",\n \"preferences.timezone\": \"<string>\",\n \"preferences.notifications\": {}\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.bunship.com/api/v1/users/me")
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 \"fullName\": \"<string>\",\n \"avatarUrl\": {},\n \"preferences\": {\n \"preferences.theme\": \"<string>\",\n \"preferences.language\": \"<string>\",\n \"preferences.timezone\": \"<string>\",\n \"preferences.notifications\": {}\n }\n}"
response = http.request(request)
puts response.read_body{
"id": "usr_cld2abc123def456",
"email": "user@example.com",
"emailVerified": "2024-01-15T10:30:00Z",
"fullName": "Jane Doe",
"avatarUrl": null,
"preferences": {
"theme": "light",
"language": "en",
"timezone": "Europe/London",
"notifications": {
"email": true,
"push": true
}
},
"twoFactorEnabled": false,
"isActive": true,
"createdAt": "2024-01-15T10:00:00Z",
"updatedAt": "2024-01-21T09:00:00Z"
}
Users
Update Profile
Update the authenticated user’s profile
PATCH
/
api
/
v1
/
users
/
me
Update Profile
curl --request PATCH \
--url https://api.bunship.com/api/v1/users/me \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"fullName": "<string>",
"avatarUrl": {},
"preferences": {
"preferences.theme": "<string>",
"preferences.language": "<string>",
"preferences.timezone": "<string>",
"preferences.notifications": {}
}
}
'import requests
url = "https://api.bunship.com/api/v1/users/me"
payload = {
"fullName": "<string>",
"avatarUrl": {},
"preferences": {
"preferences.theme": "<string>",
"preferences.language": "<string>",
"preferences.timezone": "<string>",
"preferences.notifications": {}
}
}
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({
fullName: '<string>',
avatarUrl: {},
preferences: {
'preferences.theme': '<string>',
'preferences.language': '<string>',
'preferences.timezone': '<string>',
'preferences.notifications': {}
}
})
};
fetch('https://api.bunship.com/api/v1/users/me', 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.bunship.com/api/v1/users/me",
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([
'fullName' => '<string>',
'avatarUrl' => [
],
'preferences' => [
'preferences.theme' => '<string>',
'preferences.language' => '<string>',
'preferences.timezone' => '<string>',
'preferences.notifications' => [
]
]
]),
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.bunship.com/api/v1/users/me"
payload := strings.NewReader("{\n \"fullName\": \"<string>\",\n \"avatarUrl\": {},\n \"preferences\": {\n \"preferences.theme\": \"<string>\",\n \"preferences.language\": \"<string>\",\n \"preferences.timezone\": \"<string>\",\n \"preferences.notifications\": {}\n }\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.bunship.com/api/v1/users/me")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"fullName\": \"<string>\",\n \"avatarUrl\": {},\n \"preferences\": {\n \"preferences.theme\": \"<string>\",\n \"preferences.language\": \"<string>\",\n \"preferences.timezone\": \"<string>\",\n \"preferences.notifications\": {}\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.bunship.com/api/v1/users/me")
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 \"fullName\": \"<string>\",\n \"avatarUrl\": {},\n \"preferences\": {\n \"preferences.theme\": \"<string>\",\n \"preferences.language\": \"<string>\",\n \"preferences.timezone\": \"<string>\",\n \"preferences.notifications\": {}\n }\n}"
response = http.request(request)
puts response.read_body{
"id": "usr_cld2abc123def456",
"email": "user@example.com",
"emailVerified": "2024-01-15T10:30:00Z",
"fullName": "Jane Doe",
"avatarUrl": null,
"preferences": {
"theme": "light",
"language": "en",
"timezone": "Europe/London",
"notifications": {
"email": true,
"push": true
}
},
"twoFactorEnabled": false,
"isActive": true,
"createdAt": "2024-01-15T10:00:00Z",
"updatedAt": "2024-01-21T09:00:00Z"
}
Updates the profile information for the currently authenticated user. Only the fields included in the request body are updated; omitted fields remain unchanged. Preferences are merged with existing values.
Auth
Requires a valid Bearer token.
Request Body
All fields are optional. Include only the fields you want to change.Updated display name. Between 1 and 100 characters.
URL of the new avatar image, or
null to remove.Partial preferences object. Merged with existing preferences.
Show preferences properties
Show preferences properties
"light", "dark", or "system".Language code (2-10 characters), e.g.
"en", "fr".IANA timezone identifier, e.g.
"America/New_York".Notification settings with optional
email and push boolean fields.Response
Returns the full updated user profile. See Get Current User for the complete response schema.{
"id": "usr_cld2abc123def456",
"email": "user@example.com",
"emailVerified": "2024-01-15T10:30:00Z",
"fullName": "Jane Doe",
"avatarUrl": null,
"preferences": {
"theme": "light",
"language": "en",
"timezone": "Europe/London",
"notifications": {
"email": true,
"push": true
}
},
"twoFactorEnabled": false,
"isActive": true,
"createdAt": "2024-01-15T10:00:00Z",
"updatedAt": "2024-01-21T09:00:00Z"
}
Errors
| Status | Code | Description |
|---|---|---|
400 | VALIDATION_ERROR | Invalid field value |
401 | AUTHENTICATION_ERROR | Missing or invalid Bearer token |
404 | NOT_FOUND | User not found |
Example
curl -X PATCH https://api.bunship.com/api/v1/users/me \
-H "Authorization: Bearer eyJhbGciOiJIUzI1NiIs..." \
-H "Content-Type: application/json" \
-d '{
"fullName": "Jane Doe",
"preferences": {
"theme": "light",
"timezone": "Europe/London"
}
}'
⌘I

