Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/Fireinthebellyy/ftb-web/llms.txt

Use this file to discover all available pages before exploring further.

The User Management API provides endpoints for managing user profiles, onboarding data, and administrative user operations.

Authentication

All User Management API endpoints require authentication with an active session.

Profile Management

Get Current User Profile

curl -X GET "https://ftbhustle.com/api/profile" \
  -H "Cookie: session=YOUR_SESSION_TOKEN"
Retrieve the current authenticated user’s profile information.

Response

user
object
User profile object
{
  "user": {
    "id": "user123",
    "name": "John Doe",
    "email": "john@example.com",
    "image": "https://example.com/avatar.jpg",
    "fieldInterests": ["Technology", "AI", "Web Development"],
    "opportunityInterests": ["hackathon", "internship"],
    "dateOfBirth": "2000-05-15",
    "collegeInstitute": "IIT Delhi",
    "contactNumber": "9876543210",
    "currentRole": "Computer Science Student"
  }
}

Update User Profile

curl -X POST "https://ftbhustle.com/api/profile" \
  -H "Cookie: session=YOUR_SESSION_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "John Doe",
    "fieldInterests": ["AI", "Web Development"],
    "contactNumber": "9876543210",
    "collegeInstitute": "IIT Delhi"
  }'
Update the current user’s profile information.

Request Body

name
string
required
User’s full name
image
string
Profile image URL
fieldInterests
array
Array of field interest strings
opportunityInterests
array
Array of opportunity interest strings
dateOfBirth
string
Date of birth (YYYY-MM-DD format)
collegeInstitute
string
College or institute name (alphanumeric with spaces and common punctuation)
contactNumber
string
10-digit phone number
currentRole
string
Current role or position (max 60 characters)

Response

user
object
The updated user profile object
{
  "user": {
    "id": "user123",
    "name": "John Doe",
    "email": "john@example.com",
    "image": null,
    "fieldInterests": ["AI", "Web Development"],
    "opportunityInterests": [],
    "dateOfBirth": null,
    "collegeInstitute": "IIT Delhi",
    "contactNumber": "9876543210",
    "currentRole": null
  }
}

Validation Rules

  • name: Required, non-empty string
  • image: Optional string
  • fieldInterests: Array of strings
  • opportunityInterests: Array of strings
  • dateOfBirth: Valid date string
  • collegeInstitute: Alphanumeric with spaces, .&'()- allowed, cannot be all numbers
  • contactNumber: Exactly 10 digits
  • currentRole: Max 60 characters

Onboarding

Get Onboarding Profile

curl -X GET "https://ftbhustle.com/api/onboarding" \
  -H "Cookie: session=YOUR_SESSION_TOKEN"
Retrieve the current user’s onboarding profile.

Response

profile
object
Onboarding profile object (null if not completed)
{
  "profile": {
    "id": "profile-123",
    "userId": "user123",
    "persona": "student",
    "locationType": "city",
    "locationValue": "Mumbai",
    "educationLevel": "undergraduate",
    "fieldOfStudy": "Computer Science",
    "fieldOther": null,
    "opportunityInterests": ["internship", "hackathon"],
    "domainPreferences": ["AI", "Web Development"],
    "struggles": ["Finding relevant opportunities", "Time management"],
    "createdAt": "2024-01-15T10:00:00Z",
    "updatedAt": "2024-01-15T10:00:00Z"
  }
}

Create or Update Onboarding Profile

curl -X POST "https://ftbhustle.com/api/onboarding" \
  -H "Cookie: session=YOUR_SESSION_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "persona": "student",
    "locationType": "city",
    "locationValue": "Mumbai",
    "educationLevel": "undergraduate",
    "fieldOfStudy": "Computer Science",
    "opportunityInterests": ["internship", "hackathon"],
    "domainPreferences": ["AI", "Web Development"],
    "struggles": ["Finding relevant opportunities"]
  }'
Create or update the user’s onboarding profile.

Request Body

persona
string
required
User persona: student or society
locationType
string
Location type: city or state (student only)
locationValue
string
Location value (student only)
educationLevel
string
Education level (student only)
fieldOfStudy
string
Field of study (student only)
fieldOther
string
Custom field of study when fieldOfStudy is “Other” (student only)
opportunityInterests
array
Array of opportunity interest strings (student only)
domainPreferences
array
Array of domain preference strings (student only)
struggles
array
Array of struggle strings (student only)

Response

profile
object
The created or updated onboarding profile
{
  "profile": {
    "id": "profile-123",
    "persona": "student",
    "locationType": "city",
    "locationValue": "Mumbai",
    "educationLevel": "undergraduate",
    "fieldOfStudy": "Computer Science",
    "fieldOther": null,
    "opportunityInterests": ["internship", "hackathon"],
    "domainPreferences": ["AI", "Web Development"],
    "struggles": ["Finding relevant opportunities"],
    "createdAt": "2024-03-15T14:30:00Z",
    "updatedAt": "2024-03-15T14:30:00Z"
  }
}

Admin User Management

List All Users

curl -X GET "https://ftbhustle.com/api/admin/users" \
  -H "Cookie: session=YOUR_SESSION_TOKEN"
Retrieve a list of all users. Admin only.

Response

users
array
Array of user objects
{
  "users": [
    {
      "id": "user123",
      "name": "John Doe",
      "email": "john@example.com",
      "role": "user",
      "image": "https://example.com/avatar.jpg",
      "createdAt": "2024-01-15T10:00:00Z",
      "emailVerified": true
    },
    {
      "id": "user456",
      "name": "Jane Smith",
      "email": "jane@example.com",
      "role": "admin",
      "image": "https://example.com/avatar2.jpg",
      "createdAt": "2023-12-01T08:00:00Z",
      "emailVerified": true
    }
  ]
}

Update User Role

curl -X PATCH "https://ftbhustle.com/api/admin/users/user123" \
  -H "Cookie: session=YOUR_SESSION_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "role": "member"
  }'
Update a user’s role. Admin only.

Path Parameters

id
string
required
The unique identifier of the user to update

Request Body

role
string
required
New role: user, member, or admin

Response

user
object
The updated user object
{
  "user": {
    "id": "user123",
    "name": "John Doe",
    "email": "john@example.com",
    "role": "member"
  }
}

Restrictions

  • Admins cannot change their own role
  • Role must be one of: user, member, admin

User Roles

User

Regular users with basic access. Created opportunities require approval before being published.

Member

Trusted members who can publish opportunities directly without approval.

Admin

Full access to all features including user management, content moderation, and administrative functions.

Error Responses

All API endpoints return appropriate HTTP status codes:
  • 401 Unauthorized: User is not authenticated
  • 403 Forbidden: User doesn’t have required permissions
  • 404 Not Found: User or resource not found
  • 400 Bad Request: Validation error or invalid input
  • 500 Internal Server Error: Server error
Error Response Example
{
  "error": "Invalid role. Must be 'user', 'member', or 'admin'"
}
Validation Error Response
{
  "error": "Invalid contactNumber"
}

Build docs developers (and LLMs) love