Skip to main content
GET
https://api-dev.weir.ai/
/
user
/
profile
curl -X GET 'https://api.weir.ai/user/profile' \
  -H 'Authorization: Bearer YOUR_ACCESS_TOKEN' \
  -H 'x-source: console'
{
  "data": {
    "userId": "user_123456789",
    "fullname": "John Doe",
    "firstname": "John",
    "lastname": "Doe",
    "username": "johndoe123",
    "email": "[email protected]",
    "bio": "Software engineer",
    "location": "San Francisco, CA",
    "avatar": "https://cdn.weir.ai/avatars/user_123456789.jpg",
    "role": "Organization_Admin",
    "organizationId": "org_123456789",
    "createdAt": "2024-01-01T00:00:00Z",
    "updatedAt": "2024-01-22T15:30:00Z"
  },
  "message": "Profile retrieved successfully",
  "status": "success"
}

Get User Profile

Retrieve the authenticated user’s profile information.
curl -X GET 'https://api.weir.ai/user/profile' \
  -H 'Authorization: Bearer YOUR_ACCESS_TOKEN' \
  -H 'x-source: console'
{
  "data": {
    "userId": "user_123456789",
    "fullname": "John Doe",
    "firstname": "John",
    "lastname": "Doe",
    "username": "johndoe123",
    "email": "[email protected]",
    "bio": "Software engineer",
    "location": "San Francisco, CA",
    "avatar": "https://cdn.weir.ai/avatars/user_123456789.jpg",
    "role": "Organization_Admin",
    "organizationId": "org_123456789",
    "createdAt": "2024-01-01T00:00:00Z",
    "updatedAt": "2024-01-22T15:30:00Z"
  },
  "message": "Profile retrieved successfully",
  "status": "success"
}

Response Fields

data
object
required
User profile data object.

Usage Examples

const getUserProfile = async (accessToken) => {
  const response = await fetch('https://api.weir.ai/user/profile', {
    headers: {
      'Authorization': `Bearer ${accessToken}`,
      'x-source': 'console'
    }
  });
  if (!response.ok) throw new Error(`HTTP error! status: ${response.status}`);
  return await response.json();
};