Manage site swatches from the REST API
Five new v4 endpoints let you create, read, update, and delete a site’s colors from the REST API.
List Swatches
Returns a site’s swatches, with cursor-based pagination through limit (1–100, default 20) and startingAfter.
Create Swatch
Adds a swatch to a site. siteId, hue, saturation, and lightness are required; name is optional.
Get Swatch
Returns a single swatch.
Update Swatch
Changes a swatch’s name, hue, saturation, or lightness. Omitted fields keep their current values. Swatches are grouped by name prefix, so renaming White to Neutrals / White moves the swatch into the Neutrals group.
Delete Swatch
Removes a swatch.
Each swatch stores its color as HSL values: hue (0–360), saturation (0–100), and lightness (0–100).
The GET apis both provide id and referenceId for each swatch returned. All 5 endpoints above use id. referenceId is the value that appears as swatchId in a page’s element tree (GET /v6/pages/:id?expand=elements). Use it as a reference to find swatches in page content.
The swatch endpoints are part of the Resource APIs project, currently in Beta, and may change. Requests return 403 until the feature is enabled for your site or workspace. To opt-in, please contact support: support@makeswift.com.
For details, see List Swatches, Create Swatch, Get Swatch, Update Swatch, and Delete Swatch.