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 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"
}
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"
}
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();
};
Was this page helpful?