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": "john.doe@example.com",
"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"
}
Console APIs - Users
Update User Profile
Update user profile information
PATCH
/
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": "john.doe@example.com",
"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": "john.doe@example.com",
"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
string
First name.
string
Last name.
string
Username (must be unique).
string
Email address (must be unique and valid).
string
User biography (max 500 characters).
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();
};
import requests
def update_user_profile(profile_data, access_token):
response = requests.patch(
'https://api.weir.ai/user/profile',
headers={
'Authorization': f'Bearer {access_token}',
'Content-Type': 'application/json',
'x-source': 'console'
},
json=profile_data
)
response.raise_for_status()
return response.json()
Pro Tip: Only include fields you want to update. All fields are optional.
Was this page helpful?