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 Opportunities API allows you to create, retrieve, update, and delete opportunity listings on FTB Hustle.
Authentication
All Opportunities API endpoints require authentication. Users must be logged in to access these endpoints.
User Roles
- user: Regular users can create opportunities that require admin approval before being published
- member: Members can create opportunities that are published immediately
- admin: Admins can create, edit, and delete any opportunity, and view all opportunities including pending ones
List Opportunities
curl -X GET "https://ftbhustle.com/api/opportunities?limit=10&offset=0" \
-H "Cookie: session=YOUR_SESSION_TOKEN"
Retrieve a paginated list of opportunities with optional filtering and search.
Query Parameters
Number of opportunities to return (1-50)
Number of opportunities to skip for pagination
Search term to filter opportunities by title or description
Comma-separated list of opportunity types to filter by (hackathon, grant, competition, ideathon)
Comma-separated list of tags to filter by (case-insensitive)
Comma-separated list of opportunity IDs to retrieve specific opportunities
Whether to include an accurate total count in the response
Response
Indicates if the request was successful
Array of opportunity objects
Unique identifier for the opportunity
Type of opportunity: hackathon, grant, competition, or ideathon
Detailed description of the opportunity
Location of the opportunity
Information about the organizer
Start date in YYYY-MM-DD format
End date in YYYY-MM-DD format
Scheduled publish date/time (ISO 8601 format)
Whether the opportunity has been verified
Whether the opportunity is active and visible to non-admin users
Whether the opportunity has been flagged for review
Whether the current user has upvoted this opportunity
ID of the user who created the opportunity
User information
User role (user, member, admin)
Creation timestamp (ISO 8601 format)
Last update timestamp (ISO 8601 format)
Pagination metadata
Total number of opportunities (approximate unless includeTotal=true)
Whether there are more opportunities to fetch
{
"success": true,
"opportunities": [
{
"id": "550e8400-e29b-41d4-a716-446655440000",
"type": "hackathon",
"title": "Tech Innovation Hackathon 2024",
"description": "Join us for a 48-hour hackathon focused on AI and sustainability",
"images": ["https://example.com/image1.jpg"],
"tags": ["AI", "Sustainability", "Innovation"],
"location": "San Francisco, CA",
"organiserInfo": "TechCorp",
"startDate": "2024-06-15",
"endDate": "2024-06-17",
"publishAt": null,
"isVerified": true,
"isActive": true,
"isFlagged": false,
"upvoteCount": 42,
"userHasUpvoted": false,
"userId": "user123",
"user": {
"id": "user123",
"name": "John Doe",
"image": "https://example.com/avatar.jpg",
"role": "member"
},
"createdAt": "2024-03-01T10:00:00Z",
"updatedAt": "2024-03-01T10:00:00Z"
}
],
"pagination": {
"limit": 10,
"offset": 0,
"total": 156,
"hasMore": true
}
}
Create Opportunity
curl -X POST "https://ftbhustle.com/api/opportunities" \
-H "Cookie: session=YOUR_SESSION_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"type": "hackathon",
"title": "AI Hackathon 2024",
"description": "Build innovative AI solutions",
"tags": ["AI", "Machine Learning"],
"location": "New York, NY",
"startDate": "2024-07-01",
"endDate": "2024-07-03"
}'
Create a new opportunity listing.
Request Body
Type of opportunity. Must be one of: hackathon, grant, competition, ideathon
Opportunity title (minimum 1 character)
Detailed description (minimum 1 character)
Array of image URL strings
Array of tag strings for categorization
Location of the opportunity
Information about the organizer
Start date (ISO 8601 format or YYYY-MM-DD)
End date (ISO 8601 format or YYYY-MM-DD)
Scheduled publish date/time (ISO 8601 format). Pass empty string or null to publish immediately
Response
Indicates if the opportunity was created successfully
The created opportunity object
The role of the user who created the opportunity
{
"success": true,
"data": {
"id": "550e8400-e29b-41d4-a716-446655440000",
"type": "hackathon",
"title": "AI Hackathon 2024",
"description": "Build innovative AI solutions",
"images": [],
"tagIds": ["tag-id-1", "tag-id-2"],
"location": "New York, NY",
"organiserInfo": null,
"startDate": "2024-07-01",
"endDate": "2024-07-03",
"publishAt": null,
"isFlagged": false,
"isVerified": false,
"isActive": false,
"upvoteCount": 0,
"upvoterIds": [],
"userId": "user123",
"createdAt": "2024-03-15T14:30:00Z",
"updatedAt": "2024-03-15T14:30:00Z",
"deletedAt": null
},
"userRole": "user"
}
Update Opportunity
curl -X PUT "https://ftbhustle.com/api/opportunities/550e8400-e29b-41d4-a716-446655440000" \
-H "Cookie: session=YOUR_SESSION_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"title": "Updated AI Hackathon 2024",
"location": "San Francisco, CA"
}'
Update an existing opportunity. Only the opportunity owner can update their own opportunities.
Path Parameters
The unique identifier of the opportunity to update
Request Body
All fields are optional. Only provided fields will be updated.
Type of opportunity: hackathon, grant, competition, or ideathon
Scheduled publish date/time
Response
Indicates if the update was successful
The updated opportunity object
Error Responses
- 401 Unauthorized: User is not authenticated
- 403 Forbidden: User doesn’t have permission to edit this opportunity
- 404 Not Found: Opportunity not found
- 400 Bad Request: Validation error
Delete Opportunity
curl -X DELETE "https://ftbhustle.com/api/opportunities/550e8400-e29b-41d4-a716-446655440000" \
-H "Cookie: session=YOUR_SESSION_TOKEN"
Soft delete an opportunity. Only the opportunity owner can delete their own opportunities.
Path Parameters
The unique identifier of the opportunity to delete
Response
{
"message": "Opportunity deleted successfully"
}
Error Responses
- 401 Unauthorized: User is not authenticated
- 403 Forbidden: User doesn’t have permission to delete this opportunity
- 404 Not Found: Opportunity not found
Error Handling
All API endpoints return appropriate HTTP status codes and error messages:
{
"error": "Validation error message"
}
For validation errors from Zod:
Validation Error Response
{
"error": [
{
"code": "too_small",
"minimum": 1,
"path": ["title"],
"message": "Title is required"
}
]
}
Upvote Opportunity
Get Upvote Status
curl -X GET "https://ftbhustle.com/api/opportunities/550e8400-e29b-41d4-a716-446655440000/upvote" \
-H "Cookie: session=YOUR_SESSION_TOKEN"
Get the upvote count and whether the current user has upvoted this opportunity.
Response
Whether the current user has upvoted this opportunity
{
"count": 42,
"userHasUpvoted": true
}
Toggle Upvote
curl -X POST "https://ftbhustle.com/api/opportunities/550e8400-e29b-41d4-a716-446655440000/upvote" \
-H "Cookie: session=YOUR_SESSION_TOKEN"
Toggle the current user’s upvote on an opportunity. If the user has already upvoted, this removes the upvote. If not, it adds an upvote.
Response
Indicates if the toggle was successful
New upvote status for the current user
Updated total upvote count
{
"success": true,
"userHasUpvoted": true,
"count": 43
}
curl -X GET "https://ftbhustle.com/api/opportunities/550e8400-e29b-41d4-a716-446655440000/comments" \
-H "Cookie: session=YOUR_SESSION_TOKEN"
Retrieve all comments for an opportunity, ordered by newest first.
Response
Array of comment objects with user information
Unique comment identifier
Comment content (sanitized)
ID of the user who posted the comment
curl -X POST "https://ftbhustle.com/api/opportunities/550e8400-e29b-41d4-a716-446655440000/comments" \
-H "Cookie: session=YOUR_SESSION_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"content": "Great opportunity!"
}'
Post a new comment on an opportunity. Comments are automatically sanitized to remove HTML/script tags.
Request Body
Comment content (1-1000 characters). HTML tags and scripts will be stripped.
Response
The created comment with user information
{
"comment": {
"id": "comment-uuid",
"content": "Great opportunity!",
"createdAt": "2024-03-15T14:30:00Z",
"updatedAt": "2024-03-15T14:30:00Z",
"userId": "user123",
"opportunityId": "550e8400-e29b-41d4-a716-446655440000",
"user": {
"id": "user123",
"name": "John Doe",
"image": "https://example.com/avatar.jpg"
}
},
"message": "Comment posted successfully"
}
curl -X DELETE "https://ftbhustle.com/api/opportunities/550e8400-e29b-41d4-a716-446655440000/comments/comment-uuid" \
-H "Cookie: session=YOUR_SESSION_TOKEN"
Delete a comment. Only the comment author can delete their own comments.
Path Parameters
Response
{
"message": "Comment deleted successfully"
}
Error Responses
- 401 Unauthorized: User is not authenticated
- 404 Not Found: Comment not found or user doesn’t have permission to delete it