Skip to main content
PATCH
https://api-dev.weir.ai/
/
user
/
profile
curl -X PATCH 'https://api.weir.ai/user/profile' \
  -H 'Authorization: Bearer YOUR_ACCESS_TOKEN' \
  -H 'Content-Type: application/json' \
  -H 'x-source: console' \
  -d '{
    "firstname": "John",
    "lastname": "Doe",
    "username": "johndoe123",
    "email": "[email protected]",
    "bio": "Software engineer from SF",
    "location": "San Francisco, CA"
  }'
{
  "data": {
    "userId": "user_123456789",
    "updatedAt": "2024-01-22T15:30:00Z"
  },
  "message": "Profile updated successfully",
  "status": "success"
}

Update User Profile

Update the authenticated user’s profile information.
curl -X PATCH 'https://api.weir.ai/user/profile' \
  -H 'Authorization: Bearer YOUR_ACCESS_TOKEN' \
  -H 'Content-Type: application/json' \
  -H 'x-source: console' \
  -d '{
    "firstname": "John",
    "lastname": "Doe",
    "username": "johndoe123",
    "email": "[email protected]",
    "bio": "Software engineer from SF",
    "location": "San Francisco, CA"
  }'
{
  "data": {
    "userId": "user_123456789",
    "updatedAt": "2024-01-22T15:30:00Z"
  },
  "message": "Profile updated successfully",
  "status": "success"
}

Request Body

firstname
string
First name.
lastname
string
Last name.
username
string
Username (must be unique).
email
string
Email address (must be unique and valid).
bio
string
User biography (max 500 characters).
location
string
User location.

Usage Examples

const updateUserProfile = async (profileData, accessToken) => {
  const response = await fetch('https://api.weir.ai/user/profile', {
    method: 'PATCH',
    headers: {
      'Authorization': `Bearer ${accessToken}`,
      'Content-Type': 'application/json',
      'x-source': 'console'
    },
    body: JSON.stringify(profileData)
  });
  if (!response.ok) throw new Error(`HTTP error! status: ${response.status}`);
  return await response.json();
};
Pro Tip: Only include fields you want to update. All fields are optional.