ReferenceHTTP API
displayPalette
The displayPalette router: 3 methods of the display-palette capability, with tier, scope, input and output.
Capability display-palette · scope system · mode singleton · source packages/types/src/capabilities/display-palette.cap.ts:25.
Every method is called at /trpc/displayPalette.<method> — queries with GET, mutations with POST. See How to call and Authorization.
| Method | Kind | Tier | Token scope | Viewer |
|---|---|---|---|---|
getPalette | query | protected | view | yes |
listPresets | query | protected | view | yes |
setPalette | mutation | admin | admin only | no |
displayPalette.getPalette
- Kind: query —
GET /trpc/displayPalette.getPalette - Tier: protected — any signed-in principal whose scopes cover the method
- Token scope:
viewon capabilitydisplay-palette, or categorysystem - Viewer: yes
- Try it: open
/system/api-explorer?method=displayPalette.getPaletteon your hub
Input
voidOutput
{ status: "ready"; presetId: "camstack" | "high-contrast" | "okabe-ito"; customized: boolean; source: "stored" | "unconfigured"; swatches: Record<string, { form: "solid"; hex: string } | { form: "gradient"; hex: string; alphas: number[] }>; fallbacks: string[] } | { status: "unknown"; reason: string }displayPalette.listPresets
- Kind: query —
GET /trpc/displayPalette.listPresets - Tier: protected — any signed-in principal whose scopes cover the method
- Token scope:
viewon capabilitydisplay-palette, or categorysystem - Viewer: yes
- Try it: open
/system/api-explorer?method=displayPalette.listPresetson your hub
Input
voidOutput
({ id: string; name: string; swatches: Record<string, { form: "solid"; hex: string } | { form: "gradient"; hex: string; alphas: number[] }>; fallbacks: string[] })[]displayPalette.setPalette
- Kind: mutation —
POST /trpc/displayPalette.setPalette - Tier: admin — an administrator; a viewer only as the Viewer line says; never a scoped token
- Token scope: none — the admin tier needs an administrator (a
*token or an admin session) - Viewer: no
- Try it: open
/system/api-explorer?method=displayPalette.setPaletteon your hub
Input
{ presetId: string } | { presetId: string; overrides: Record<string, { form: "solid"; hex: string } | { form: "gradient"; hex: string; alphas: number[] }> }Output
{ status: "ready"; presetId: "camstack" | "high-contrast" | "okabe-ito"; customized: boolean; source: "stored" | "unconfigured"; swatches: Record<string, { form: "solid"; hex: string } | { form: "gradient"; hex: string; alphas: number[] }>; fallbacks: string[] }