# search ## search_ai_search_retrieve - [GET /api/search/ai-search/](https://docs.ibl.ai/apis/ibl/search/search_ai_search_retrieve.md): Legacy endpoint for backward compatible mentor search ## search_catalog_retrieve - [GET /api/search/catalog/](https://docs.ibl.ai/apis/ibl/search/search_catalog_retrieve.md): Search and filter content across the learning catalog. This endpoint provides a powerful search interface for discovering content across multiple content types (courses, programs, pathways, skills, roles, resources). It supports full-text search, faceted filtering, and pagination. Query Parameters: query (str, optional): Search term to filter content by name or description content (list, optional): Content types to include in results (courses, programs, pathways, skills, roles, resources) Default: ["programs", "courses", "pathways", "skills"] # Filtering parameters course_id (str, optional): Filter by specific course ID program_id (str, optional): Filter by specific program ID pathway_id (str, optional): Filter by specific pathway ID skill_id (str, optional): Filter by specific skill ID subject (list, optional): Filter by subject areas tenant (list, optional): Filter by tenant/organization topics (list, optional): Filter by topic areas tags (list, optional): Filter by tags level (list, optional): Filter by difficulty level self_paced (list, optional): Filter by course format (self-paced, instructor-led) promotion (list, optional): Filter by promotion status language (list, optional): Filter by content language certificate (list, optional): Filter by certificate type program_type (list, optional): Filter by program type duration (list, optional): Filter by course duration range price (str, optional): Filter by price/audit status resource_type (list, optional): Filter by resource type skills (list, optional): Filter by skills # Sorting and pagination order_by (str, optional): Field to sort results by order_ascending (bool, optional): Sort direction (default: false) alphabetical (bool, optional): Sort alphabetically by name (default: false) limit (int, optional): Number of results per page (default: 12, max: 100) offset (int, optional): Starting position for pagination # Response options return_facet (bool, optional): Include facet data in response (default: true) return_items (bool, optional): Include items in programs/pathways (default: false) allow_skill_search (bool, optional): Enable skill-based search (default: false) update_facet (str, optional): Force facet update Returns: A JSON response containing: - results: List of content items with metadata - count: Total number of matching items - next: URL for the next page of results (if available) - previous: URL for the previous page of results (if available) - current_page: Current page number - total_pages: Total number of pages - facets: Aggregated counts for each filter category (if requested) Each content item contains type-specific fields: - Courses: { "id": 123, "type": "course", "course_id": "CS101", "name": "Introduction to Computer Science", "description": "Learn the fundamentals of computer science", "short_description": "CS fundamentals", "image_url": "https://example.com/images/cs101.jpg", "level": "Beginner", "subject": "Computer Science", "topics": ["Programming", "Algorithms"], "tags": ["python", "coding"], "language": "English", "tenant": "example-university", "self_paced": true, "duration": "6 weeks", "certificate": "Professional Certificate", "price": "Free", "skills": [ {"id": 1, "name": "Python Programming"}, {"id": 2, "name": "Algorithms"} ], "url": "https://example.com/courses/cs101" } - Programs: { "id": 456, "type": "program", "program_id": "PROG123", "name": "Data Science Program", "description": "Comprehensive data science curriculum", "short_description": "Learn data science", "image_url": "https://example.com/images/datascience.jpg", "level": "Intermediate", "subject": "Data Science", "topics": ["Machine Learning", "Statistics"], "program_type": "Professional Certificate", "courses": [ {"id": 123, "name": "Introduction to Python"}, {"id": 124, "name": "Statistics for Data Science"} ], "url": "https://example.com/programs/prog123" } - Pathways: { "id": 789, "type": "pathway", "pathway_id": "PATH456", "name": "Software Engineering Career Path", "description": "Complete pathway to become a software engineer", "image_url": "https://example.com/images/swe-path.jpg", "programs": [ {"id": 456, "name": "Programming Fundamentals"}, {"id": 457, "name": "Web Development"} ], "url": "https://example.com/pathways/path456" } - Skills: { "id": 321, "type": "skill", "name": "Machine Learning", "description": "Building systems that learn from data", "courses": [ {"id": 125, "name": "Machine Learning Fundamentals"} ], "related_skills": [ {"id": 322, "name": "Deep Learning"} ] } - Roles: { "id": 654, "type": "role", "name": "Data Scientist", "description": "Professional who analyzes and interprets complex data", "skills": [ {"id": 321, "name": "Machine Learning"}, {"id": 323, "name": "Data Analysis"} ], "recommended_courses": [ {"id": 125, "name": "Machine Learning Fundamentals"} ] } - Resources: { "id": 987, "type": "resource", "name": "Python Cheat Sheet", "description": "Quick reference guide for Python", "resource_type": "PDF", "url": "https://example.com/resources/python-cheatsheet.pdf", "topics": ["Programming", "Python"] } Error Responses: 500 Internal Server Error: If an unexpected error occurs during processing Notes: - Results are cached for performance - The 'resources' content type is only included by default if IBL_ENABLE_RESOURCES_IN_FACET is true - For debugging, add ?debug=true to see detailed information about skill matching ## search_mentors_retrieve - [GET /api/search/mentors/](https://docs.ibl.ai/apis/ibl/search/search_mentors_retrieve.md): Search and filter AI mentors across the platform. This endpoint provides a powerful search interface for discovering AI mentors with support for filtering, pagination, and detailed mentor information. Query Parameters: # Identification parameters (for detail view) id (int, optional): Retrieve a specific mentor by ID unique_id (uuid, optional): Retrieve a specific mentor by UUID # Search and filtering parameters query (str, optional): Search term to filter mentors by name or description tenant (str, optional): Filter by tenant/organization llm (list, optional): Filter by language model type audience (list, optional): Filter by target audience category (list, optional): Filter by mentor category tags (list, optional): Filter by tags created_by (str, optional): Filter mentors created by specific user # Sorting and pagination order_by (str, optional): Field to sort results by ('created_at', 'recently_accessed_at') order_direction (str, optional): Sort direction ('asc' or 'desc', default: 'desc') limit (int, optional): Number of results per page (default: 12, max: 100) offset (int, optional): Starting position for pagination Returns: For detail view (when id or unique_id is provided): A JSON response containing a single mentor's details: { "id": 123, "unique_id": "550e8400-e29b-41d4-a716-446655440000", "name": "Professor Smith", "description": "AI mentor specializing in computer science", "image_url": "https://example.com/images/prof-smith.jpg", "llm": { "id": 1, "name": "GPT-4", "description": "Advanced language model" }, "audience": { "id": 2, "name": "College Students", "description": "For university-level learners" }, "category": "Computer Science", "tags": ["programming", "algorithms", "data structures"], "created_at": "2023-01-15T12:00:00Z", "recently_accessed_at": "2023-06-20T15:30:00Z", "platform": { "id": 1, "name": "Example University", "key": "example-university" }, "visibility": "public", "settings": { "temperature": 0.7, "max_tokens": 1024, "system_prompt": "You are Professor Smith, an expert in computer science..." } } For list view: A JSON response containing: { "results": [ { "id": 123, "unique_id": "550e8400-e29b-41d4-a716-446655440000", "name": "Professor Smith", "description": "AI mentor specializing in computer science", "image_url": "https://example.com/images/prof-smith.jpg", "llm": {"id": 1, "name": "GPT-4"}, "audience": {"id": 2, "name": "College Students"}, "category": "Computer Science", "tags": ["programming", "algorithms"], "created_at": "2023-01-15T12:00:00Z", "recently_accessed_at": "2023-06-20T15:30:00Z" }, // Additional mentor objects... ], "count": 50, "next": "https://api.example.com/api/search/mentors/?limit=12&offset=12", "previous": null, "current_page": 1, "num_pages": 5, "facets": { "llm": [ {"key": "GPT-4", "doc_count": 30}, {"key": "Claude", "doc_count": 20} ], "audience": [ {"key": "College Students", "doc_count": 35}, {"key": "Professionals", "doc_count": 15} ], "category": [ {"key": "Computer Science", "doc_count": 25}, {"key": "Mathematics", "doc_count": 15}, {"key": "Business", "doc_count": 10} ] } } Error Responses: 400 Bad Request: If the request parameters are invalid 404 Not Found: If the requested mentor doesn't exist 500 Internal Server Error: If an unexpected error occurs Notes: - Results are cached for performance - Public mentors are visible to all users - Private mentors are only visible to authorized users ## search_mentors_documents_retrieve - [GET /api/search/mentors/{mentor_unique_id}/documents/](https://docs.ibl.ai/apis/ibl/search/search_mentors_documents_retrieve.md): Search and filter documents associated with a specific mentor ## search_orgs_users_mentors_retrieve - [GET /api/search/orgs/{org}/users/{username}/mentors/](https://docs.ibl.ai/apis/ibl/search/search_orgs_users_mentors_retrieve.md): Handle GET requests for tenant-specific mentor search. Args: request: HTTP request object org: Tenant/organization key username: Username of the user making the request Returns: Response: DRF Response object with search results ## search_orgs_users_prompts_retrieve - [GET /api/search/orgs/{org}/users/{username}/prompts/](https://docs.ibl.ai/apis/ibl/search/search_orgs_users_prompts_retrieve.md): Search and filter AI prompts for a specific user within a tenant. This endpoint extends the base prompt search functionality but filters results to only show prompts that are available to a specific user within a specific organization/tenant. Path Parameters: org (str): The organization/tenant identifier username (str): The username to filter prompts for Query Parameters: Same as PromptSearchView, plus: # Identification parameters (for detail view) id (int, optional): Retrieve a specific prompt by ID Returns: Same format as PromptSearchView, but filtered to only include prompts that the specified user has access to within the specified organization. Error Responses: 400 Bad Request: If the request parameters are invalid 403 Forbidden: If the requested prompt exists but the user doesn't have access 404 Not Found: If the requested prompt doesn't exist 500 Internal Server Error: If an unexpected error occurs Access Control: - Results are filtered based on user's permissions within the organization - Private prompts are only visible to authorized users ## search_orgs_users_recommended_retrieve - [GET /api/search/orgs/{org}/users/{username}/recommended/](https://docs.ibl.ai/apis/ibl/search/search_orgs_users_recommended_retrieve.md): Determine whether to serve a detail view or a list view. ## search_personalized_catalog_retrieve - [GET /api/search/personalized-catalog/{username}/](https://docs.ibl.ai/apis/ibl/search/search_personalized_catalog_retrieve.md): Determine whether to serve a detail view or a list view. If any detail-identifying parameters are present (course_id, program_id, etc.) the detail view is returned; otherwise the aggregated list view is returned. ## search_prompts_retrieve - [GET /api/search/prompts/](https://docs.ibl.ai/apis/ibl/search/search_prompts_retrieve.md): Search and filter AI prompts across the platform. This endpoint provides a search interface for discovering AI prompts with support for filtering, pagination, and detailed prompt information. Query Parameters: # Identification parameters (for detail view) id (int, optional): Retrieve a specific prompt by ID # Search and filtering parameters query (str, optional): Search term to filter prompts by name or content category (str, optional): Filter by prompt category language (str, optional): Filter by prompt language style (str, optional): Filter by writing style tone (str, optional): Filter by tone tenant (str, optional): Filter by tenant/organization mentor (str, optional): Filter by associated mentor (UUID) # Sorting and pagination sort_by (str, optional): Field to sort results by order_direction (str, optional): Sort direction ('asc' or 'desc', default: 'desc') alphabetical (bool, optional): Sort alphabetically by name (default: false) limit (int, optional): Number of results per page (default: 10) offset (int, optional): Starting position for pagination # Special parameters filter_facet (any, optional): If present, return only facets without results Returns: For detail view (when id is provided): A JSON response containing a single prompt's details: { "id": 456, "name": "Essay Writing Guide", "content": "Write a well-structured essay on the following topic: {{topic}}...", "category": "Academic Writing", "language": "English", "style": "Formal", "tone": "Professional", "mentor": { "id": 123, "unique_id": "550e8400-e29b-41d4-a716-446655440000", "name": "Professor Smith" }, "platform": { "id": 1, "name": "Example University", "key": "example-university" }, "created_at": "2023-02-10T09:15:00Z", "updated_at": "2023-05-05T14:20:00Z", "visibility": "public", "variables": ["topic", "length", "style"] } For list view: A JSON response containing: { "results": [ { "id": 456, "name": "Essay Writing Guide", "content": "Write a well-structured essay on the following topic: {{topic}}...", "category": "Academic Writing", "language": "English", "style": "Formal", "tone": "Professional", "mentor": {"id": 123, "name": "Professor Smith"}, "created_at": "2023-02-10T09:15:00Z", "updated_at": "2023-05-05T14:20:00Z" }, // Additional prompt objects... ], "count": 30, "next": "?limit=10&offset=10", "previous": null, "current_page": 1, "num_pages": 3, "facets": { "category": [ {"key": "Academic Writing", "doc_count": 15}, {"key": "Creative Writing", "doc_count": 10}, {"key": "Technical Documentation", "doc_count": 5} ], "language": [ {"key": "English", "doc_count": 25}, {"key": "Spanish", "doc_count": 5} ], "style": [ {"key": "Formal", "doc_count": 20}, {"key": "Casual", "doc_count": 10} ], "tone": [ {"key": "Professional", "doc_count": 15}, {"key": "Friendly", "doc_count": 10}, {"key": "Technical", "doc_count": 5} ] } } Error Responses: 400 Bad Request: If the request parameters are invalid 403 Forbidden: If the requested prompt exists but is not publicly available 404 Not Found: If the requested prompt doesn't exist 500 Internal Server Error: If an unexpected error occurs Notes: - Only publicly available prompts are returned by default - When filtering by mentor, the mentor ID must be a valid UUID ## search_users_orgs_users_retrieve - [GET /api/search/users/orgs/{org}/users/{username}/](https://docs.ibl.ai/apis/ibl/search/search_users_orgs_users_retrieve.md): Search and filter users within a specific organization/tenant. This endpoint provides a search interface for discovering users within an organization, with support for filtering by departments, pagination, and faceted filtering. Path Parameters: org (str): The organization/tenant identifier username (str): The username of the user making the request Query Parameters: # Search parameters query (str, optional): Search term to filter users by name, username, or email # Department filtering department_mode (bool, optional): Enable department-based filtering (default: false) user_department (bool, optional): Legacy parameter for department_mode (default: false) department (list, optional): Filter by specific departments # Additional filters role (list, optional): Filter by user role status (list, optional): Filter by user status (active, inactive) joined_date (list, optional): Filter by join date range last_login (list, optional): Filter by last login date range # Pagination limit (int, optional): Number of results per page (default: 10) offset (int, optional): Starting position for pagination Returns: A JSON response containing: Error Responses: 400 Bad Request: If the request parameters are invalid 403 Forbidden: If the user doesn't have department admin privileges (when using department_mode) 404 Not Found: If the user or organization doesn't exist 500 Internal Server Error: If an unexpected error occurs Access Control: - The requesting user must have an active account in the specified organization - When department_mode is enabled, the user must be an admin of at least one department - Department filtering restricts results to users in departments where the requesting user is an admin