Localization with the CMS API
Webflow localization provides an end-to-end solution for adapting your site for a global audience. The API gives you programmatic control over localizing both dynamic CMS Content and Static Page Content.
- CMS content localization enables you to create variants of a single CMS item for each locale.
- Static content localization uses the Pages API to update DOM elements and localize SEO metadata. Learn more about localizing pages →.
This guide covers the core concepts of CMS localization.
Key concepts
Understanding a few key concepts is essential for working with localization via the API. At its core, a single CMS item becomes a group of item variants when you add locales.
When you create an item in multiple locales, all variants are linked by a shared itemId, which represents the entire item group.
The cmsLocaleId is a unique locale identifier when working with CMS resources. Use locale IDs to target specific locales when creating, updating, and retrieving CMS items.
Getting locale identifiers
To get the localeId and cmsLocaleId for your site’s configured locales, use the Get Site endpoint. The response will include a locales object containing the primary locale and any secondary locales. Before using these endpoints, you must first enable localization in the Site settings within the Designer.
Managing localized content
You can create and update localized CMS items via the API, as well as independently publish items in each locale.
Creating localized items
Creating a new localized item is a two-step process:
-
Create items across all locales
Call the Create Items endpoint with one entry in
items. SetallCmsLocales: trueon that entry and provide the primary locale’s content infieldData. The API creates a variant in every current site locale, including the primary locale. The variants share an item ID and the same initial content.To target selected locales, use
cmsLocaleIdsinstead. Omit both selectors to create the item in the primary locale only.This example shows a site with two locales. The two variants count as two items toward the 100-item request limit.
-
Update each variant with translated content
After creating the locale-specific variants, make a request to the
Update Itemendpoint. In the request, pass the shareditemId, the specificcmsLocaleIdfor the variants you are updating, and its unique, translatedfieldData.
To add a secondary locale to an item that already exists, call Create Items with the item’s id and the new locale in cmsLocaleIds. The new variant shares the existing item’s ID. To give the variant translated content in the same request, put it in that entry’s fieldData.
allCmsLocales applies only to new items and can’t accompany id or cmsLocaleIds. See Creating collection items for the selector rules and an example.
Retrieving localized items
To get localized items, use the List Items endpoint and pass the desired cmsLocaleId as a query parameter. If you omit the cmsLocaleId, the API will return items from the primary locale.
To read several locales at once, pass a comma separated list of CMS locale IDs. To get every variant of one item, combine that with filter[id][eq] and the item’s ID.
Get Item returns a single item, so it accepts one locale. Use List Items for the multi-locale read.
Locale-specific publishing
Each locale maintains its own independent publishing state. This means you can have a version of an item live in your primary locale while the version for a secondary locale is still in a draft state. Publishing changes in one locale doesn’t affect the status of that item in any other locale. See the publishing guide for more details →.
Next steps
To ensure your site is completely localized, follow the guides for localizing pages and components.