PATCH
/
api
/
v1
/
users
/
me
Update my profile
curl --request PATCH \
  --url https://api.example.com/api/v1/users/me
import requests

url = "https://api.example.com/api/v1/users/me"

response = requests.patch(url)

print(response.text)
const options = {method: 'PATCH'};

fetch('https://api.example.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.example.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",
]);

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
package main

import (
"fmt"
"net/http"
"io"
)

func main() {

url := "https://api.example.com/api/v1/users/me"

req, _ := http.NewRequest("PATCH", url, nil)

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.example.com/api/v1/users/me")
.asString();
require 'uri'
require 'net/http'

url = URI("https://api.example.com/api/v1/users/me")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Patch.new(url)

response = http.request(request)
puts response.read_body

Overview

Updates the authenticated user’s profile. Every field is optional — send only what changed (at least one field is required). Returns the full updated profile (same shape as GET /users/me). Email is not editable here. Changing the email would require a re-verification flow; it is omitted deliberately.

Setting the profile photo

The avatar uses the standard upload pipeline:
  1. POST /uploads/presign with fileType: "AVATAR".
  2. PUT the image bytes to the returned URL with the returned headers.
  3. POST /uploads/confirm → returns an uploadId.
  4. PATCH /users/me with { "avatarUploadId": "<that id>" }. The server resolves it to the public CDN url and stores it as avatarUrl.

Authentication

Bearer <accessToken> required. Scope: user.

Request body

FieldTypeRequiredConstraints
firstNamestringno1..100 chars after trim.
lastNamestringno1..100 chars after trim.
dateOfBirthstringnoISO YYYY-MM-DD; must be 18 or older.
biostring | nullno≤ 500 chars. Send null to clear it.
avatarUploadIdstringno24-char ObjectId of a confirmed AVATAR upload owned by you.
{
  "firstName": "Alice",
  "lastName": "Andersson",
  "dateOfBirth": "1990-06-15",
  "bio": "Looking to swap my 2-bed in Camden.",
  "avatarUploadId": "66400a8f1c2b4d5e6f7a8b90"
}

Response — 200 OK

The full updated profile — see GET /users/me for the field table.

Error responses

StatusCodeMeaning
400VALIDATION_FAILEDEmpty body; name out of range; dateOfBirth not YYYY-MM-DD or under 18; bio over 500 chars.
401UNAUTHENTICATEDMissing, malformed, or expired access token.
404NOT_FOUNDUser gone, or avatarUploadId is not a confirmed AVATAR upload owned by you.

Side effects

  • Writes the provided non-PII fields (firstName, lastName, bio, avatarUrl).
  • dateOfBirth, when provided, is written through the encrypted-at-rest PII path.

See also

curl

# Update name + bio
curl -X PATCH https://api.swappr.co.uk/api/v1/users/me \
  -H "Authorization: Bearer $ACCESS_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{ "firstName": "Alice", "bio": "Hello!" }'

# Set the avatar from a confirmed AVATAR upload
curl -X PATCH https://api.swappr.co.uk/api/v1/users/me \
  -H "Authorization: Bearer $ACCESS_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{ "avatarUploadId": "66400a8f1c2b4d5e6f7a8b90" }'