Skip to main content
PATCH
https://api.bunship.com
/
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": {}
  }
}
'
{
  "id": "usr_cld2abc123def456",
  "email": "[email protected]",
  "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.
fullName
string
Updated display name. Between 1 and 100 characters.
avatarUrl
string | null
URL of the new avatar image, or null to remove.
preferences
object
Partial preferences object. Merged with existing preferences.

Response

Returns the full updated user profile. See Get Current User for the complete response schema.
{
  "id": "usr_cld2abc123def456",
  "email": "[email protected]",
  "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

StatusCodeDescription
400VALIDATION_ERRORInvalid field value
401AUTHENTICATION_ERRORMissing or invalid Bearer token
404NOT_FOUNDUser 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"
    }
  }'