Skip to content

Get all bookmark categories

GET
/api/browser/categories

Retrieve all bookmark categories with usage statistics and rules.

Returns all defined bookmark categories including:

  • Category metadata (name, description, color)
  • Bookmark count per category
  • Auto-assignment rules
  • Configuration settings

Returns: List of CategoryResponse objects containing:

  • id: Unique category identifier
  • name: Category name
  • description: Category description
  • color: Hex color code for UI
  • bookmark_count: Number of bookmarks in category
  • rules: URL pattern rules for auto-assignment
  • auto_assign: Whether auto-assignment is enabled
  • created_at: ISO 8601 creation timestamp

Raises:

  • HTTPException 500: For database or retrieval errors

Usage: GET /api/browser/categories

Example Response:

[
  {
    "id": "cat_1234567890",
    "name": "Research",
    "description": "Academic papers and research content",
    "color": "#3b82f6",
    "bookmarkCount": 42,
    "rules": ["*.edu", "scholar.google.com", "arxiv.org"],
    "autoAssign": true,
    "createdAt": "2024-12-20T10:30:00Z"
  }
]

Successful Response

Response Get Categories Api Browser Categories Get
Array<object>
CategoryResponse

Response model for category data - COMPLETE CATEGORY INFORMATION.

Contains complete category metadata including usage statistics, rules, and configuration for bookmark organization. This is the SINGLE SOURCE OF TRUTH for category structure - frontend consumes this schema.

Fields:

  • id: Unique category identifier
  • name: Category name
  • description: Category description
  • color: Category color in hex format
  • bookmark_count: Number of bookmarks in this category
  • rules: URL pattern rules for auto-assignment
  • auto_assign: Whether auto-assignment is enabled
  • created_at: ISO 8601 timestamp of category creation

Usage Statistics: bookmark_count provides real-time count of bookmarks using this category, updated when bookmarks are created or deleted.

Auto-Assignment: When auto_assign is true, bookmarks matching any rule pattern are automatically assigned to this category during bookmark creation.

Usage: Returned from GET /api/browser/categories and POST /api/browser/categories endpoints.

JSON Example:

{
  "id": "cat_1234567890",
  "name": "Research",
  "description": "Academic papers and research content",
  "color": "#3b82f6",
  "bookmarkCount": 42,
  "rules": ["*.edu", "scholar.google.com", "arxiv.org"],
  "autoAssign": true,
  "createdAt": "2024-12-20T10:30:00Z"
}

Integration:

  • Category Service: Returns category data
  • Bookmark Service: Uses for auto-assignment
  • Frontend: Displays in category management UI
object
id
required
Id

Unique category identifier

string
name
required
Name

Category name

string
description
required
Description

Category description

string
color
required
Color

Category color (hex)

string
bookmarkCount
Bookmarkcount

Number of bookmarks

integer
0
rules
Rules

Auto-assignment URL pattern rules

Array<string>
autoAssign
required
Autoassign

Auto-assignment enabled

boolean
createdAt
required
Createdat

ISO 8601 creation timestamp

string