For AI agents: a documentation index is available at the root level at /llms.txt and /llms-full.txt. Append /llms.txt to any URL for a page-level index, or .md for the markdown version of any page.
Sign in
DocsAPI ReferenceChangelog
DocsAPI ReferenceChangelog
    • Overview
    • Authentication
  • REST
      • POSTCreate Locale
      • GETList Locales
      • GETGet Locale
      • PATCHUpdate Locale
      • DELDelete Locale
      • POSTRestore Locale
Sign in
LogoLogo
RESTLocales

Create Locale

POST
https://api.makeswift.com/v2/locales
POST
/v2/locales
$curl -X POST https://api.makeswift.com/v2/locales \
> -H "x-api-key: <apiKey>" \
> -H "Content-Type: application/json" \
> -d '{
> "siteId": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
> "locale": "fr-FR"
>}'
1{
2 "object": "locale",
3 "id": "7c9e6679-7425-40de-944b-e07fc1f90ae7",
4 "locale": "fr-FR",
5 "domain": "https://frenchcuisine.example.com",
6 "pathPrefix": "french",
7 "isDefault": false
8}
Creates a new locale for a site.
Was this page helpful?
Previous

Duplicate Site

Next

List Locales

Built with

Authentication

x-api-keystring

API key authentication. Accepts either:

  • App API key (e.g. sk_eczMHVBY9fV6GYFhvs53qcnxq7yptlXL3ABKOZtn6dQ)
  • Site API key (UUID format, e.g. 550e8400-e29b-41d4-a716-446655440000)

Request

This endpoint expects an object.
siteIdstringRequiredformat: "uuid"
The site ID to create the locale for.
localestringRequired
Locale of the site locale.
domainstringOptionalformat: "uri"

The domain URL for domain-based localization. This URL must include the protocol.

Response

objectenum
Allowed values:
idstringformat: "uuid"
The ID of the created locale.
localestring
We support the subset of locales specified with ISO 3166 that are composed of language and optionally a region.
domainstring or nullformat: "uri"

The domain URL for domain-based localization.

pathPrefixstring or null
Custom URL path prefix. Null means the locale code is used as the default prefix.
isDefaultboolean
The flag that indicates whether this locale is the default locale for the site.

Errors

400
Bad Request Error
403
Forbidden Error
404
Not Found Error
409
Conflict Error