List Theme Presets
Public list of PUBLISHED theme presets for the creator bio editor / client-web theming. Sanitized output — only id/name/slug + light/dark/typography tokens.
GET /api/v1/themes — 🌐 Public
Returns the published theme presets for client-web theming — typically used to render a theme picker in the creator's bio editor. PUBLISHED-only filter; DRAFT / ARCHIVED never leak. Internal metadata (status, isActive, tokenSchema, layout, assets, description, thumbnail, createdBy, publishedBy, activatedBy, all timestamps) is stripped from the response.
Sanitized list shape. This endpoint returns ONLY { id, name, slug, lightTokens, darkTokens, typography } per preset. To get the active preset for live application (which includes layout + assets), use GET /themes/active. The list is for picker UI only — render a thumbnail-style card from name + slug and let the user click to apply.
Request
Query parameters
| Param | Type | Default | Notes |
|---|---|---|---|
target | string | CLIENT | Always omit — server defaults to CLIENT (the only target relevant to client-web / creator bio editor). |
No headers required.
Response
200 OK — ApiResponseOf<PublicThemeListResponseDto>
{
"success": true,
"data": {
"themes": [
{
"id": "tp1a2b3c4-d5e6-7890-abcd-ef1234567890",
"name": "Default Light",
"slug": "default-light",
"lightTokens": { "color": { "bg": "#FFFFFF", "fg": "#0F172A" } },
"darkTokens": { "color": { "bg": "#0F172A", "fg": "#FFFFFF" } },
"typography": { "fontFamily": "Inter, sans-serif" }
}
]
}
}Item fields
| Field | Type | Notes |
|---|---|---|
id | string (UUID) | ThemePreset.id |
name | string | Display name |
slug | string | URL-friendly identifier |
lightTokens | object | JSON design-token tree (light mode) |
darkTokens | object | JSON design-token tree (dark mode) |
typography | object | JSON typography settings (fonts, scales) |
Stripped fields
status (always PUBLISHED here, filter excludes), isActive, tokenSchema, layout, assets, description, thumbnail, createdBy, publishedBy, activatedBy, publishedAt, activatedAt, createdAt, updatedAt — all internal-only, excluded.
Errors
This endpoint has no documented error responses beyond infrastructure failures.
Side effects
prisma.themePreset.findMany({ where: { target: 'CLIENT', status: 'PUBLISHED' }, orderBy: createdAt desc, take: 500 }).- Map each row to the sanitized 6-field projection. No mutations.
Code samples
curl https://api.bio.re/api/v1/themestype PublicThemePreset = {
id: string;
name: string;
slug: string;
lightTokens: object;
darkTokens: object;
typography: object;
};
async function listThemes(): Promise<PublicThemePreset[]> {
const res = await fetch('https://api.bio.re/api/v1/themes');
const json = await res.json();
if (!res.ok || !json.success) {
throw Object.assign(new Error(json?.error?.message ?? 'Themes fetch failed'), {
code: json?.error?.code,
});
}
return json.data.themes;
}import { useQuery } from '@tanstack/react-query';
export const themeKeys = {
list: () => ['themes', 'list'] as const,
};
export function useThemeList() {
return useQuery({
queryKey: themeKeys.list(),
queryFn: async () => {
const res = await fetch('/api/v1/themes');
const json = await res.json();
if (!res.ok || !json.success) {
throw Object.assign(new Error(json?.error?.message ?? 'Themes fetch failed'), {
code: json?.error?.code,
i18nKey: json?.error?.i18nKey,
});
}
return json.data.themes as PublicThemePreset[];
},
// Catalog rarely changes within a session
staleTime: 5 * 60_000,
});
}Try it
Query Parameters
Theme target (CLIENT or ADMIN)
"CLIENT" | "ADMIN"Response Body
application/json
curl -X GET "https://loading/api/v1/themes"{
"success": true,
"data": {
"themes": [
{
"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
"name": "Default Light",
"slug": "default-light",
"lightTokens": {},
"darkTokens": {},
"typography": {}
}
]
}
}Source
| Source | Path | Lines |
|---|---|---|
| Controller | apps/api-core/src/modules/theme-preset/theme-preset-public.controller.ts | 21–38 (listPublished) |
| DTO (response) | apps/api-core/src/modules/theme-preset/dto/theme-preset-response.dto.ts | 116–119 (PublicThemeListResponseDto), 91–109 (PublicThemePresetDto) |
| Service | apps/api-core/src/modules/theme-preset/theme-preset.service.ts | 119–129 (findAll(target, status)) |
| Prisma model | packages/prisma/prisma/schema.prisma | ThemePreset (filter target = CLIENT + status = PUBLISHED) |
Reopen Ticket
Move a RESOLVED or CLOSED ticket back to OPEN. Clears resolvedAt + closedAt. Owner-only. Fails if the ticket is in any other status.
Get Active Theme
Public read of the platform's currently active client-web theme preset. Includes layout + assets (full theming surface). MUST pass ?target=CLIENT — default differs.