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 Site
      • GETList Sites
      • GETGet Site
      • PATCHUpdate Site
      • DELDelete Site
      • POSTDuplicate Site
Sign in
LogoLogo
RESTSites

Create Site

POST
https://api.makeswift.com/v2/sites
POST
/v2/sites
$curl -X POST https://api.makeswift.com/v2/sites \
> -H "x-api-key: <apiKey>" \
> -H "Content-Type: application/json" \
> -d '{
> "workspaceId": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
> "name": "Hearth Furniture Company"
>}'
1{
2 "object": "site",
3 "id": "9b2d7f4e-8c3a-4f1a-9d2e-1a2b3c4d5e6f",
4 "name": "Hearth Furniture Company",
5 "hostOrigin": "https://hearthfurniture.com",
6 "publicApiKey": "550e8400-e29b-41d4-a716-446655440000",
7 "defaultLocale": "en-US",
8 "localeManagementMode": "internal",
9 "defaultLocalePathPrefix": "/en"
10}
Creates a new site in a workspace.
Was this page helpful?
Previous

Authentication

Next

List Sites

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.
workspaceIdstringRequiredformat: "uuid"
The ID of the workspace that contains this site.
namestringRequired
The site name.
hostOriginstringOptionalformat: "uri"
The public URL where your site is hosted. This is the URL that Makeswift uses to render your site for editing.
defaultLocalestringOptionalDefaults to en-US
The primary locale of this site.

Response

objectenum
The type of the object
Allowed values:
idstringformat: "uuid"
namestring
The site name.
hostOriginstring or nullformat: "uri"
The public URL where your site is hosted. This is the URL that Makeswift uses to render your site for editing.
publicApiKeystringformat: "uuid"
The publishable API key that a host can use to get page and component data for rendering your site.
defaultLocalestring
The primary locale of this site.
localeManagementModeenum
Controls whether locales are managed internally via the builder or externally via API.
Allowed values:
defaultLocalePathPrefixstring or null

Errors

400
Bad Request Error
403
Forbidden Error