Overview
The Users API provides endpoints for managing user accounts, personal information, security settings, and company profiles. All procedures require authentication viaprotectedProcedure.
Queries
getUserbyUsername
Retrieve a user by their username. Input Parameters:The unique username to search for
Unique user identifier (CUID)
The user’s username
Mutations
updateUserPersonalInfo
Update the authenticated user’s personal information including profile details, contact information, and bio. Input Parameters:URL to profile picture
First name (2-30 characters)
Last name (2-30 characters)
Valid email address
Valid phone number (validated with libphonenumber-js)
Date of birth
Country of residence
City of residence
Street address
User biography
URL or text of resume
updateUserSecurityInfo
Update security-related settings including username, password, and two-factor authentication. Input Parameters:New username (2-30 characters, must be unique)
Enable or disable two-factor authentication
Current password (required when changing password, 6-30 characters)
New password (6-30 characters)
Confirm new password (must match newpassword)
User ID
Updated username
User email
BAD_REQUEST: Username already takenBAD_REQUEST: Invalid password
checkUsername
Check if a username is already taken by another user. Input Parameters:Username to check availability
The checked username
Whether the username is already taken
updateAccount
Update user account type and username during initial setup. Input Parameters:User role type:
"client", "freelancer", or "company"Default: "client"Desired username
User ID
Updated role (client, freelancer, company)
Updated username
BAD_REQUEST: Username already taken
createCompany
Create a company profile for users with the “company” role. Input Parameters:Company name (max 250 characters)
URL to company logo
Industry sector (max 250 characters)
Company location (max 250 characters)
Company description (max 250 characters)
Valid contact email address
Company website URL (max 250 characters)
BAD_REQUEST: User is not signed up as a company