Skip to navigation

Manage regions from the REST API

Three new v1 endpoints let you create, list, and read a site’s regions, including their element trees, from the REST API.

GET /v1/regions?siteId={siteId}

Returns a site’s regions for one locale, with cursor-based pagination through limit (1–100, default 20) and startingAfter.

POST /v1/regions

Creates a region in one locale. siteId, id, name, and elements are required. The component type at the root of elements becomes the region’s type. Returns 409 if the region already exists.

GET /v1/regions/{id}?siteId={siteId}

Returns a single region in one locale. URL-encode the id if it contains reserved characters such as /.

  • You choose the ID: Makeswift doesn’t generate region IDs. You assign the ID (for example, site-header), and it must be unique within a site and locale.
  • One locale per request: all three endpoints accept a locale parameter, as either a locale code like en-US or a site locale UUID. If you leave it out, the request uses the site’s default locale. A region has to exist in the default locale before you can create it in another locale.
  • Element trees are optional: pass include=elements to List Regions or Get Region to get each region’s element tree. Without it, elements is null.

The region endpoints are in beta and may change. Requests return 403 until the feature is enabled for your site or workspace. To opt in, contact support: support@makeswift.com.

For details, see List Regions, Create Region, and Get Region.


Runtime v0.29.0

@makeswift/runtime v0.29.0 fetches snapshots faster and rebuilds how Makeswift generates CSS and applies style updates. It also has breaking changes that may require updates to your host.

  • React 19 required. Your host must run React 19. Next.js hosts must be on Next.js 15 or later.
  • cacheKey renamed to classNamePrefix. The cacheKey prop on <RootStyleRegistry> is now classNamePrefix (default ms). Use it to set a custom prefix for Makeswift-generated CSS class names.
  • <RootStyleRegistry> required for Pages Router. Pages Router hosts must now wrap their content in <RootStyleRegistry> inside ReactRuntimeProvider:
src/pages/_app.tsx
<ReactRuntimeProvider runtime={runtime} siteVersion={siteVersion}>
<RootStyleRegistry>
<Component {...pageProps} />
</RootStyleRegistry>
</ReactRuntimeProvider>
  • New forceImportant prop. Set forceImportant on <RootStyleRegistry> to add !important to Makeswift-generated CSS declarations, so they win when your site’s own CSS conflicts with them.

For migration steps, see the v0.29.0 upgrade guide. For component details, see the <RootStyleRegistry> reference.


Manage site typographies from the REST API

Four new v4 endpoints let you create, read, and update a site’s typographies (the text styles in the Visual Builder) from the REST API.

GET /v4/typographies?siteId={siteId}

Returns a site’s typographies in position order, with cursor-based pagination through limit (1–100, default 20) and startingAfter.

POST /v4/typographies

Adds a typography to a site. siteId is required; name and style are optional.

GET /v4/typographies/{id}

Returns a single typography.

PATCH /v4/typographies/{id}

Changes a typography’s name or style. Omitted fields keep their current values. When you send style, it replaces the full per-device array, so entries for individual devices aren’t merged. A / in the name nests the typography in a group, so renaming H1 to Headings / H1 moves it into the Headings group.

  • Per-device styles: style is an array of { deviceId, value } entries. Each value can set fontFamily, fontSize ({ value, unit }), fontWeight, lineHeight, letterSpacing, textAlign, italic, underline, strikethrough, uppercase, and color.
  • Colors come from swatches: color.swatchId takes the id of an existing swatch, so create the swatch first with the Swatch API. color.alpha (0–1) sets opacity.
  • Two IDs: the typography endpoints use id. referenceId is the value a Text element’s typography prop uses in a page’s element tree, so use it to find a typography in page content.

The typography endpoints are in beta and may change. Requests return 403 until the feature is enabled for your site or workspace. To opt in, contact support: support@makeswift.com.

For details, see List Typographies, Create Typography, Get Typography, and Update Typography.