The /themes endpoint lets you browse available themes and apply or update a page's visual design programmatically — essential for agencies applying consistent branding across multiple client pages.
- Use
GET /themesto list all available themes with their color, typography, and spacing settings. - Apply a theme to any page with
POST /pages/{id}/themeand override specific settings viaPUT /pages/{id}/theme. - Agencies can script consistent brand application across dozens of client pages in minutes instead of hours.
Visual consistency is one of the hardest things to maintain when you manage many UniLink pages on behalf of clients. A brand refresh means visiting every page, applying the new colors, and saving — manually, one page at a time. The themes endpoint eliminates that. You can apply a theme to any page with a single API call, override individual settings like brand colors and font choices with a PUT request, and confirm the result without opening the dashboard. For agencies, this is the difference between a one-hour refresh job and a five-minute script.
What the Themes Endpoint Does
The GET /themes endpoint returns a list of all themes available on the UniLink platform. Each theme object includes a unique id, a human-readable name, and a complete settings object containing colors (background, text, accent, button), typography (heading font, body font, font sizes), border_radius (the curvature applied to buttons and cards), and spacing (padding and gap values used throughout the layout). Platform themes are the built-in options available to all accounts; custom themes created in the dashboard also appear in this list with account-specific IDs.
Applying a theme to a page uses the POST /pages/{id}/theme sub-path. The request body takes a theme_id pointing to the theme you want to apply. On success, the response returns the complete updated theme settings as they now exist on the page — including all default values from the base theme. This is the same as selecting a theme in the dashboard's design panel and saving it. The page is immediately updated; visitors see the new theme on their next page load.
For fine-grained control, PUT /pages/{id}/theme lets you override individual theme settings without swapping the entire theme. Send only the fields you want to change — for example, just the colors.accent value to update a brand color — and the rest of the theme settings remain unchanged. This is distinct from POST (which replaces the whole theme) and is the right tool when you have a standard theme but each client needs their own accent color. The request body mirrors the theme settings object structure; any key you include replaces that setting, any key you omit is left as-is.
How to Get Started
- Generate an API key with write scope from Settings → API at app.unilink.us. Applying and updating themes requires write scope.
- Fetch the theme list:
curl -H "Authorization: Bearer YOUR_KEY" https://unilink.us/api/v1/themes. Review the response to find the theme IDs and understand the settings structure. - Pick a theme from the list and note its
id. Identify the page ID you want to style by callingGET /pages. - Apply the theme to the page:
POST /pages/{page_id}/themewith body{"theme_id": "{theme_id}"}. Confirm the response includes the full theme settings object. - Test a settings override:
PUT /pages/{page_id}/themewith body{"colors": {"accent": "#FF5733"}}. Visit the page to confirm the accent color updated while the rest of the theme remained intact.
How to Use the Themes Endpoint
- Browse available themes:
GET /themes— review thename,colors, andtypographyfields to identify which themes match a client's brand requirements before applying. - Get theme details:
GET /themes/{id}returns the full settings for a single theme — use this to inspect all color, font, and spacing values before applying it to a production page. - Apply a theme:
POST /pages/{id}/themewith{"theme_id": "theme_abc"}— replaces the page's current theme entirely with the specified one. - Override brand colors:
PUT /pages/{id}/themewith{"colors": {"accent": "#3B82F6", "button": "#3B82F6"}}— updates only the specified color values while preserving all other theme settings. - Apply to multiple pages: Loop through your list of page IDs and call
POST /pages/{id}/themewith the sametheme_idfor each — the same script that applies to one page applies to hundreds with a for loop.
Key Settings
| Setting | What It Does | Recommended |
|---|---|---|
colors.accent | Primary brand color used for highlighted elements and calls to action | Set to the client's primary brand color as a hex code for instant brand alignment |
colors.background | Page background color | Use a light neutral for professional pages; match the client's website background for cohesion |
typography.heading_font | Font family used for page headings and name display | Match the client's website heading font if available in the platform font library |
border_radius | Corner curvature value in pixels applied to buttons and block cards | Use 8–12px for modern rounded style; use 0–4px for a sharp, professional look |
typography.body_font | Font family used for body text and link labels | Stick to system fonts or widely available web fonts for consistent rendering across devices |
Get the Most Out Of the Themes Endpoint
For agency workflows, standardize on one or two base platform themes and use PUT overrides for per-client customization rather than creating custom themes for every client. Platform themes are maintained and updated by UniLink — new block types and layouts are designed to work with them. Custom themes require more maintenance when the platform adds new design elements. Start with a clean platform theme and layer brand-specific colors and fonts on top via PUT.
Version your theme configurations in your provisioning codebase. Store each client's theme overrides as a JSON object in your repository alongside their page ID and API key reference. This means any team member can re-apply a client's exact brand configuration, roll back to a previous theme state, or bulk-update all clients when a brand refresh happens. Treating theme configurations as code — with version history and review processes — dramatically reduces configuration drift across a large client portfolio.
When applying themes at scale, check the rate limit headers in each API response and implement adaptive throttling. Theme application triggers a page rebuild on UniLink's side; unlike simple data updates, it is slightly more compute-intensive. Space bulk theme applications across a few seconds rather than firing 50 requests simultaneously. The API will rate-limit aggressive bursts, and spacing requests ensures consistent performance for all pages.
The GET /themes/{id} endpoint is useful for building a theme preview feature in your own client portal. Fetch the theme's color and typography values, then render a mock preview of how the client's page will look before applying the theme. Clients can approve the look in your portal, and only then does your system call POST /pages/{id}/theme — reducing back-and-forth in the dashboard and keeping the approval process in your own interface.
Troubleshooting
| Problem | Cause | Fix |
|---|---|---|
| POST returns 404 for theme_id | The theme ID does not exist or is from a different account | Call GET /themes to get a current list of valid theme IDs available on your account |
| PUT override not visible on page | Browser cached the old page styles | Hard refresh the page (Ctrl+Shift+R) to bypass the cache, then verify the setting with GET /pages/{id}/theme |
| Colors look different than the hex code I sent | Theme applies opacity or blending to some color values | Fetch the current theme settings after applying and compare — some themes apply transparency to certain color roles; use fully opaque hex codes to override this |
| Font not rendering correctly after PUT | Font name does not match the platform's font library exactly | Use GET /themes to see valid font names used in existing themes and reference those exact strings |
- Apply a complete visual design to any page in a single API call — no dashboard navigation required
- PUT partial updates let you override individual brand settings without re-specifying the entire theme
- Theme browsing via GET makes it easy to build a theme picker UI in your own client portal
- Bulk theme application via a simple loop enables instant brand refreshes across dozens of pages
- Custom font options are limited to the platform's font library — you cannot upload arbitrary fonts via the API
- Subscription billing intervals and some advanced layout settings still require the dashboard
- Theme changes are immediately live — there is no staging or preview mode via the API before changes go public
Can I create a custom theme via the API?
Custom theme creation is only available through the dashboard design panel at this time. Once created, custom themes appear in the GET /themes list and can be applied to pages via the API. The API can apply and modify themes but cannot create new theme records.
Does applying a new theme overwrite my existing custom settings?
Yes — POST /pages/{id}/theme replaces all current theme settings with the new theme's defaults. If you have custom overrides you want to preserve, record them before calling POST, then re-apply them via PUT after the new theme is applied.
Can I apply the same theme to multiple pages at once?
There is no bulk-apply endpoint — each page requires an individual POST call. However, looping through page IDs in your code achieves the same result. With a modest rate-limit-aware delay between calls, you can apply a theme to 50 pages in under two minutes.
Can I reset a page to its default theme via the API?
Yes — call GET /themes, find the theme with name: "Default", note its ID, and POST it to the page. This restores the platform default styles.
Are theme changes immediately visible to page visitors?
Yes — theme changes take effect immediately upon a successful API response. Visitors who load the page after the API call see the new theme. Visitors who loaded the page before the change may see the old theme until their browser cache refreshes (typically within the CDN's cache TTL).
- Browse themes at
GET /themes, apply withPOST /pages/{id}/theme, and customize withPUT /pages/{id}/theme. - POST replaces the entire theme; PUT only updates the fields you include — use PUT for brand color overrides on a standard base theme.
- Store each client's brand overrides as JSON in your codebase for repeatable, version-controlled theme management.
- Theme changes are live immediately — there is no preview or staging mode via the API.
- Bulk apply by looping page IDs with a brief delay between calls — a simple pattern that scales to any portfolio size.
Start applying consistent branding to your UniLink pages via API — generate a write-scope key at app.unilink.us under Settings → API and explore your themes with GET /themes.
