BIO.RE
Content

List Help Categories

Public list of published help center categories with article counts. Optional locale filter. Ordered by admin-set sortOrder. CDN 5min/10min SWR.

GET /api/v1/public/help/categories โ€” ๐ŸŒ Public ยท Rate limit: 60 req / minute

Returns published help center categories โ€” the top-level groupings shown on the help center landing page. Each category includes the count of published articles within it (so the UI can render "Payments (12)" without a second query). Optional ?locale= filter; otherwise returns categories across all locales.

Article count is published-only. The articleCount field counts only HelpArticle rows where status = PUBLISHED. Draft / archived articles aren't counted, so the number matches what the user will actually see when clicking into a category.

Request

Query parameters

ParamTypeDefaultNotes
localestringโ€”Filter by locale (e.g. en, tr). Omit for all locales.

No headers required.

Response headers

HeaderValue
Cache-Controlpublic, s-maxage=300, stale-while-revalidate=600

Response

200 OK โ€” ArrayApiResponseOf<PublicHelpCategoryDto>

{
  "success": true,
  "data": [
    {
      "id": "hc1a2b3c4-d5e6-7890-abcd-ef1234567890",
      "slug": "payments",
      "name": "Payments & Billing",
      "description": "Wallet, payouts, refunds",
      "icon": "credit-card",
      "iconBackground": "#F0F4FF",
      "sortOrder": 1,
      "articleCount": 12
    }
  ]
}

Item fields

FieldTypeNotes
idstring (UUID)HelpCategory.id
slugstringPass to GET /public/help/articles?category=<slug> to drill in
namestringDisplay name
descriptionstring | nullShort description for the category card
iconstring | nullIcon identifier (your design system maps this to a glyph)
iconBackgroundstring | nullHex color for the icon background tile
sortOrdernumberAdmin-set ordering โ€” server returns rows ordered sortOrder ASC
articleCountnumberCount of HelpArticle rows where categoryId matches AND status = PUBLISHED

Errors

HTTPcode / i18nKeyReason
429(throttle)Rate limit exceeded (60 req/min)

Side effects

  1. Build where = { status: PUBLISHED, ...(locale ? { locale } : {}) }.
  2. prisma.helpCategory.findMany({ where, orderBy: sortOrder asc, include: { _count: { select: { articles: { where: { status: PUBLISHED } } } } } }).
  3. Project the _count.articles aggregate into the flat articleCount field.
  4. Return the array. No mutations.

Code samples

curl https://api.bio.re/api/v1/public/help/categories
curl 'https://api.bio.re/api/v1/public/help/categories?locale=tr'
type PublicHelpCategory = {
  id: string;
  slug: string;
  name: string;
  description: string | null;
  icon: string | null;
  iconBackground: string | null;
  sortOrder: number;
  articleCount: number;
};

async function listHelpCategories(locale?: string): Promise<PublicHelpCategory[]> {
  const url = new URL('https://api.bio.re/api/v1/public/help/categories');
  if (locale) url.searchParams.set('locale', locale);
  const res = await fetch(url);
  const json = await res.json();
  if (!res.ok || !json.success) {
    throw Object.assign(new Error(json?.error?.message ?? 'Help categories fetch failed'), {
      code: json?.error?.code,
    });
  }
  return json.data;
}
import { useQuery } from '@tanstack/react-query';

export const contentKeys = {
  helpCategories: (locale?: string) =>
    ['content', 'help', 'categories', locale ?? 'all'] as const,
};

export function useHelpCategories(locale?: string) {
  return useQuery({
    queryKey: contentKeys.helpCategories(locale),
    queryFn: async () => {
      const url = new URL('/api/v1/public/help/categories', window.location.origin);
      if (locale) url.searchParams.set('locale', locale);
      const res = await fetch(url);
      const json = await res.json();
      if (!res.ok || !json.success) {
        throw Object.assign(new Error(json?.error?.message ?? 'Help categories fetch failed'), {
          code: json?.error?.code,
          i18nKey: json?.error?.i18nKey,
        });
      }
      return json.data as PublicHelpCategory[];
    },
    staleTime: 5 * 60_000,
  });
}

Try it

GET
/api/v1/public/help/categories

Query Parameters

locale?string

Response Body

application/json

curl -X GET "https://loading/api/v1/public/help/categories"
{
  "success": true,
  "data": [
    {
      "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
      "slug": "payments",
      "name": "Payments & Billing",
      "description": "string",
      "icon": "credit-card",
      "iconBackground": "#F0F4FF",
      "sortOrder": 1,
      "articleCount": 12
    }
  ]
}

Source

SourcePathLines
Controllerapps/api-core/src/modules/content/public-content.controller.ts291โ€“308 (listPublishedHelpCategories)
DTO (response item)apps/api-core/src/modules/content/dto/content-public-response.dto.ts172โ€“196 (PublicHelpCategoryDto)
Serviceapps/api-core/src/modules/content/content.service.ts740โ€“749 (listPublishedHelpCategories)
Prisma modelpackages/prisma/prisma/schema.prismaHelpCategory (filter status = PUBLISHED), HelpArticle (joined for _count aggregate)

On this page