Skip to main content
The Makeswift Public API allows you to programmatically manage your Makeswift resources. Use it to automate workflows, integrate with external systems, or build custom tooling.

Base URL

All API requests should be made to:
https://api.makeswift.com

Authentication

Authenticate requests by including an App API key in the x-api-key header:
curl https://api.makeswift.com/v2/sites \
  -H "x-api-key: your-api-key"
See the Authentication guide to learn how to create an app and get your API key.

Resources

ResourceDescription
SitesCreate, read, update, delete, and duplicate sites
LocalesConfigure localization settings
RoutesDefine external routes for your site

Response format

All responses return JSON. Successful responses include an object field indicating the resource type:
{
  "object": "site",
  "id": "550e8400-e29b-41d4-a716-446655440000",
  "name": "My Site"
}
List endpoints return paginated results:
{
  "object": "list",
  "data": [...],
  "hasMore": true
}

Pagination

List endpoints support cursor-based pagination using the following query parameters:
ParameterTypeDefaultDescription
limitnumber20Number of results to return (max 100)
starting_afterstring-Cursor for fetching results after a specific resource ID
To paginate through results:
  1. Make an initial request without the starting_after parameter
  2. If hasMore is true, use the id of the last item in data as the starting_after parameter for the next request
  3. Repeat until hasMore is false
# First page
curl "https://api.makeswift.com/v2/sites/YOUR_SITE_ID/pages?limit=10" \
  -H "x-api-key: your-api-key"

# Next page (using the last page ID from previous response)
curl "https://api.makeswift.com/v2/sites/YOUR_SITE_ID/pages?limit=10&starting_after=550e8400-e29b-41d4-a716-446655440000" \
  -H "x-api-key: your-api-key"

Errors

The API uses standard HTTP status codes and returns consistent error responses:
StatusDescription
200Success
201Created
400Bad request - check your parameters
401Unauthorized - invalid or missing API key
403Forbidden - insufficient permissions
404Not found
409Conflict - resource already exists

400 Bad Request

Returned when the request body or query parameters are invalid.
{
  "object": "error",
  "code": "bad_request",
  "message": "Invalid request parameters",
  "details": [
    {
      "field": "name",
      "message": "Name is required"
    }
  ]
}

401 Unauthorized

Returned when the API key is missing or invalid.
{
  "object": "error",
  "code": "unauthorized",
  "message": "Invalid or missing API key"
}

403 Forbidden

Returned when the API key is valid but lacks permission to access the resource.
{
  "object": "error",
  "code": "forbidden",
  "message": "You do not have permission to access this resource"
}

404 Not Found

Returned when the requested resource doesn’t exist.
{
  "object": "error",
  "code": "not_found",
  "message": "Site not found"
}

409 Conflict

Returned when attempting to create a resource that already exists.
{
  "object": "error",
  "code": "conflict",
  "message": "A page with this path already exists"
}