Categories
Categories help you organize listings in your directory into logical groups. Categories support hierarchical structures with parent-child relationships, allowing you to create nested category trees (e.g., “Web Development” > “Frontend” > “React”).Get Directory Categories
Retrieve all active categories for a specific directory.directory_id(integer, required): The ID of the directory
Get Single Category
Retrieve a specific category by ID.directory_id(integer, required): The ID of the directorycategory_id(integer, required): The ID of the category
Create Category
Create a new category in the directory.directory_id(integer, required): The ID of the directory
title(string, required): The category title (max 255 characters)slug(string, optional): URL-safe slug (lowercase letters, numbers, hyphens only). Auto-generated from title if not provideddescription(string, optional): Category descriptionicon(string, optional): Icon identifier (max 255 characters)parent_id(integer, optional): ID of the parent category for nested hierarchies. Must reference an existing categoryis_active(boolean, optional): Whether the category is active (default: true)show_on_sidebar(boolean, optional): Whether to display in the sidebar navigation (default: true)order(integer, optional): Sort order for display (min: 0)
Update Category
Update an existing category.directory_id(integer, required): The ID of the directorycategory_id(integer, required): The ID of the category
title(string, optional): The category title (max 255 characters)slug(string, optional): URL-safe slug (lowercase letters, numbers, hyphens only)description(string, optional): Category descriptionicon(string, optional): Icon identifier (max 255 characters)parent_id(integer, optional): ID of the parent category. Must reference an existing categoryis_active(boolean, optional): Whether the category is activeshow_on_sidebar(boolean, optional): Whether to display in the sidebar navigationorder(integer, optional): Sort order for display (min: 0)
Delete Category
Delete a category from the directory. When a parent category is deleted, its child categories will have theirparent_id set to null (they become top-level categories).
directory_id(integer, required): The ID of the directorycategory_id(integer, required): The ID of the category
Key Features
Hierarchical Categories
- Categories support parent-child relationships via the
parent_idfield - You can create multi-level category trees for organizing listings
- When a parent category is deleted, child categories are automatically promoted to top-level
Slug Generation
- Slugs are automatically generated from the category title if not provided
- Slugs must be URL-safe (lowercase letters, numbers, and hyphens only)
Sidebar Visibility
- Use
show_on_sidebarto control whether a category appears in the directory’s sidebar navigation - Use
orderto control the display order of categories in the sidebar
