Update current user profile
curl --request PATCH \
--url https://handauncle-backend-prod-205012263523.asia-south1.run.app/api/v1/auth/me \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"fullName": "<string>",
"preferences": {
"language": "<string>",
"theme": "<string>",
"notifications": true
},
"_clearAvatar": true
}
'import requests
url = "https://handauncle-backend-prod-205012263523.asia-south1.run.app/api/v1/auth/me"
payload = {
"fullName": "<string>",
"preferences": {
"language": "<string>",
"theme": "<string>",
"notifications": True
},
"_clearAvatar": True
}
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>',
preferences: {language: '<string>', theme: '<string>', notifications: true},
_clearAvatar: true
})
};
fetch('https://handauncle-backend-prod-205012263523.asia-south1.run.app/api/v1/auth/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://handauncle-backend-prod-205012263523.asia-south1.run.app/api/v1/auth/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>',
'preferences' => [
'language' => '<string>',
'theme' => '<string>',
'notifications' => true
],
'_clearAvatar' => true
]),
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://handauncle-backend-prod-205012263523.asia-south1.run.app/api/v1/auth/me"
payload := strings.NewReader("{\n \"fullName\": \"<string>\",\n \"preferences\": {\n \"language\": \"<string>\",\n \"theme\": \"<string>\",\n \"notifications\": true\n },\n \"_clearAvatar\": true\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://handauncle-backend-prod-205012263523.asia-south1.run.app/api/v1/auth/me")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"fullName\": \"<string>\",\n \"preferences\": {\n \"language\": \"<string>\",\n \"theme\": \"<string>\",\n \"notifications\": true\n },\n \"_clearAvatar\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://handauncle-backend-prod-205012263523.asia-south1.run.app/api/v1/auth/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 \"preferences\": {\n \"language\": \"<string>\",\n \"theme\": \"<string>\",\n \"notifications\": true\n },\n \"_clearAvatar\": true\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"data": {
"user": {
"id": "<string>",
"fullName": "<string>",
"createdAt": "2023-11-07T05:31:56Z",
"email": "jsmith@example.com",
"phoneNumber": "<string>",
"avatarUrl": "<string>",
"authProvider": "<string>",
"preferences": {
"language": "<string>",
"theme": "<string>",
"notifications": true
},
"deviceId": "<string>",
"phoneVerified": true,
"emailVerified": true,
"last_login_at": "2023-11-07T05:31:56Z"
},
"usage": {
"conversations": {
"total": 123,
"active": 123,
"archived": 123,
"deleted": 123,
"lastActiveAt": "2023-11-07T05:31:56Z"
},
"shares": {
"total": 123,
"active": 123,
"expired": 123,
"revoked": 123,
"totalViews": 123,
"lastSharedAt": "2023-11-07T05:31:56Z"
}
},
"profileContext": {
"static": [
"<string>"
],
"recent": [
"<string>"
],
"frequent": [
"<string>"
]
}
},
"meta": {
"timestamp": "2023-11-07T05:31:56Z",
"requestId": "<string>"
}
}{
"success": false,
"error": {
"message": "Please enter a valid 10-digit phone number (e.g., 9876543210)",
"code": "VALIDATION_ERROR",
"details": [
{
"field": "phone",
"message": "Please enter a valid 10-digit phone number (e.g., 9876543210)"
}
]
},
"meta": {
"timestamp": "2023-11-07T05:31:56Z",
"requestId": "<string>"
}
}{
"success": false,
"error": {
"message": "Please enter a valid 10-digit phone number (e.g., 9876543210)",
"code": "VALIDATION_ERROR",
"details": [
{
"field": "phone",
"message": "Please enter a valid 10-digit phone number (e.g., 9876543210)"
}
]
},
"meta": {
"timestamp": "2023-11-07T05:31:56Z",
"requestId": "<string>"
}
}{
"success": false,
"error": {
"message": "Please enter a valid 10-digit phone number (e.g., 9876543210)",
"code": "VALIDATION_ERROR",
"details": [
{
"field": "phone",
"message": "Please enter a valid 10-digit phone number (e.g., 9876543210)"
}
]
},
"meta": {
"timestamp": "2023-11-07T05:31:56Z",
"requestId": "<string>"
}
}Auth service
Update Profile
Updates the authenticated user’s profile. Supports both JSON and multipart/form-data. Use multipart/form-data to upload an avatar image along with profile updates. Images larger than 1MB are automatically compressed. Use _clearAvatar: true to remove the avatar.
PATCH
/
api
/
v1
/
auth
/
me
Update current user profile
curl --request PATCH \
--url https://handauncle-backend-prod-205012263523.asia-south1.run.app/api/v1/auth/me \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"fullName": "<string>",
"preferences": {
"language": "<string>",
"theme": "<string>",
"notifications": true
},
"_clearAvatar": true
}
'import requests
url = "https://handauncle-backend-prod-205012263523.asia-south1.run.app/api/v1/auth/me"
payload = {
"fullName": "<string>",
"preferences": {
"language": "<string>",
"theme": "<string>",
"notifications": True
},
"_clearAvatar": True
}
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>',
preferences: {language: '<string>', theme: '<string>', notifications: true},
_clearAvatar: true
})
};
fetch('https://handauncle-backend-prod-205012263523.asia-south1.run.app/api/v1/auth/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://handauncle-backend-prod-205012263523.asia-south1.run.app/api/v1/auth/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>',
'preferences' => [
'language' => '<string>',
'theme' => '<string>',
'notifications' => true
],
'_clearAvatar' => true
]),
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://handauncle-backend-prod-205012263523.asia-south1.run.app/api/v1/auth/me"
payload := strings.NewReader("{\n \"fullName\": \"<string>\",\n \"preferences\": {\n \"language\": \"<string>\",\n \"theme\": \"<string>\",\n \"notifications\": true\n },\n \"_clearAvatar\": true\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://handauncle-backend-prod-205012263523.asia-south1.run.app/api/v1/auth/me")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"fullName\": \"<string>\",\n \"preferences\": {\n \"language\": \"<string>\",\n \"theme\": \"<string>\",\n \"notifications\": true\n },\n \"_clearAvatar\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://handauncle-backend-prod-205012263523.asia-south1.run.app/api/v1/auth/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 \"preferences\": {\n \"language\": \"<string>\",\n \"theme\": \"<string>\",\n \"notifications\": true\n },\n \"_clearAvatar\": true\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"data": {
"user": {
"id": "<string>",
"fullName": "<string>",
"createdAt": "2023-11-07T05:31:56Z",
"email": "jsmith@example.com",
"phoneNumber": "<string>",
"avatarUrl": "<string>",
"authProvider": "<string>",
"preferences": {
"language": "<string>",
"theme": "<string>",
"notifications": true
},
"deviceId": "<string>",
"phoneVerified": true,
"emailVerified": true,
"last_login_at": "2023-11-07T05:31:56Z"
},
"usage": {
"conversations": {
"total": 123,
"active": 123,
"archived": 123,
"deleted": 123,
"lastActiveAt": "2023-11-07T05:31:56Z"
},
"shares": {
"total": 123,
"active": 123,
"expired": 123,
"revoked": 123,
"totalViews": 123,
"lastSharedAt": "2023-11-07T05:31:56Z"
}
},
"profileContext": {
"static": [
"<string>"
],
"recent": [
"<string>"
],
"frequent": [
"<string>"
]
}
},
"meta": {
"timestamp": "2023-11-07T05:31:56Z",
"requestId": "<string>"
}
}{
"success": false,
"error": {
"message": "Please enter a valid 10-digit phone number (e.g., 9876543210)",
"code": "VALIDATION_ERROR",
"details": [
{
"field": "phone",
"message": "Please enter a valid 10-digit phone number (e.g., 9876543210)"
}
]
},
"meta": {
"timestamp": "2023-11-07T05:31:56Z",
"requestId": "<string>"
}
}{
"success": false,
"error": {
"message": "Please enter a valid 10-digit phone number (e.g., 9876543210)",
"code": "VALIDATION_ERROR",
"details": [
{
"field": "phone",
"message": "Please enter a valid 10-digit phone number (e.g., 9876543210)"
}
]
},
"meta": {
"timestamp": "2023-11-07T05:31:56Z",
"requestId": "<string>"
}
}{
"success": false,
"error": {
"message": "Please enter a valid 10-digit phone number (e.g., 9876543210)",
"code": "VALIDATION_ERROR",
"details": [
{
"field": "phone",
"message": "Please enter a valid 10-digit phone number (e.g., 9876543210)"
}
]
},
"meta": {
"timestamp": "2023-11-07T05:31:56Z",
"requestId": "<string>"
}
}Updates the authenticated user’s profile including avatar upload. Requires a valid Auth0 access token in the
Authorization header.
This endpoint supports both JSON and multipart/form-data content types:
- JSON: For updating profile fields only
- multipart/form-data: For uploading an avatar image along with profile updates
Request Body (JSON)
All fields are optional. Only include the fields you want to update.| Field | Type | Description |
|---|---|---|
fullName | string | User’s display name (1-120 chars, trimmed) |
preferences | object | UI preferences (merged with existing) |
preferences.language | string | Language code (e.g., “en”, “hi”) |
preferences.theme | string | Theme name (e.g., “dark”, “light”) |
preferences.notifications | boolean | Enable/disable notifications |
_clearAvatar | boolean | Set to true to remove the current avatar |
Request Body (multipart/form-data)
For uploading an avatar image:| Field | Type | Description |
|---|---|---|
avatar | file | Avatar image file (JPEG, PNG, GIF, WebP). Auto-compressed if >1MB. |
data | string | JSON string with profile fields (fullName, preferences, _clearAvatar) |
Example: JSON Request
curl -X PATCH https://api.handauncle.com/api/v1/auth/me \
-H "Authorization: Bearer <access-token>" \
-H "Content-Type: application/json" \
-d '{
"fullName": "Puneet Sharma",
"preferences": {
"theme": "dark",
"notifications": true
}
}'
Example: Upload Avatar
curl -X PATCH https://api.handauncle.com/api/v1/auth/me \
-H "Authorization: Bearer <access-token>" \
-F "avatar=@/path/to/photo.jpg" \
-F 'data={"fullName": "Puneet Sharma"}'
Example: Clear Avatar
curl -X PATCH https://api.handauncle.com/api/v1/auth/me \
-H "Authorization: Bearer <access-token>" \
-H "Content-Type: application/json" \
-d '{"_clearAvatar": true}'
Response
Returns the updated profile overview (same format asGET /api/v1/auth/me):
{
"success": true,
"data": {
"user": {
"id": "683b7e9f465b1b4e6753627a4f",
"email": "investor@example.com",
"fullName": "Puneet Sharma",
"avatarUrl": "https://storage.googleapis.com/...",
"preferences": {
"language": "en",
"theme": "dark",
"notifications": true
}
},
"usage": { ... },
"profileContext": { ... }
}
}
Avatar Upload Details
- Supported formats: JPEG, PNG, GIF, WebP
- Auto-compression: Images larger than 1MB are automatically resized (max 800px) and compressed
- No size limit error: Even large files are accepted and compressed server-side
- Auto-deletion: Previous avatar is automatically deleted when uploading a new one
Notes
- Field merging: Preferences are merged with existing values, not replaced entirely
- Whitespace trimming:
fullNameis automatically trimmed - Cache invalidation: The profile context cache is invalidated when changes are saved
Authorizations
Auth0 access token for registered users.
Body
application/jsonmultipart/form-data
⌘I