Website Builder API
POST /services/websites/v1/structures/clone Auth

Clone a structure (definition + posts + categories) across projects

Deep-copies the full content tree of a structure type. Idempotent by (website_id, identifier). Posts match on `unique_identifier`/`url`; categories match on `url`/`title`.

Request Body Required

FieldTypeRequiredDescriptionExample
source_project_id integer Yes 102907
target_project_id integer Yes 104449
source_structure_id integer Yes 204
prune boolean|null No When true, posts/categories that exist in target but not source get deleted. Default false — additive merge.

Responses

200
500
422
404
403
401
429
Successful response
Headers
HeaderTypeDescriptionExample
X-RateLimit-Limit integer Maximum number of requests allowed per minute 60
X-RateLimit-Remaining integer Number of requests remaining in the current window 57
FieldTypeDescription
error boolean
message string
data object
data.structure object
data.categories_cloned integer
data.posts_cloned integer
data.pruned boolean
Internal server error
Headers
HeaderTypeDescriptionExample
X-RateLimit-Limit integer Maximum number of requests allowed per minute 60
X-RateLimit-Remaining integer Number of requests remaining in the current window 57
FieldTypeDescription
error boolean
message string
data mixed[]
Validation error
FieldTypeDescription
message string Errors overview.
errors object A detailed description of each field that failed validation.
Resource not found
Headers
HeaderTypeDescriptionExample
X-RateLimit-Limit integer Maximum number of requests allowed per minute 60
X-RateLimit-Remaining integer Number of requests remaining in the current window 57
FieldTypeDescription
error boolean
message string
data mixed[]
Forbidden — insufficient permissions
Headers
HeaderTypeDescriptionExample
X-RateLimit-Limit integer Maximum number of requests allowed per minute 60
X-RateLimit-Remaining integer Number of requests remaining in the current window 57
FieldTypeDescription
error boolean
message string
data mixed[]
Unauthenticated — missing or invalid Bearer token
Headers
HeaderTypeDescriptionExample
X-RateLimit-Limit integer Maximum number of requests allowed per minute 60
X-RateLimit-Remaining integer Number of requests remaining in the current window 57
FieldTypeDescription
error boolean
message string
Too Many Requests — rate limit exceeded
Headers
HeaderTypeDescriptionExample
X-RateLimit-Limit integer Maximum number of requests allowed per minute 60
X-RateLimit-Remaining integer Number of requests remaining in the current window 57
Retry-After integer Seconds until the rate limit resets 60
FieldTypeDescription
error boolean
message string
Base URL
https://api.wemasy.nl/api
Authentication

Request Sample
cURL
JS
PHP
Python
curl -X POST "https://api.wemasy.nl/api/services/websites/v1/structures/clone" \
  -H "Authorization: Bearer YOUR_API_TOKEN" \
  -H "Accept: application/json" \
  -H "Content-Type: application/json" \
  -d '{
    "source_project_id": 102907,
    "target_project_id": 104449,
    "source_structure_id": 204,
    "prune": "string"
}'
fetch('https://api.wemasy.nl/api/services/websites/v1/structures/clone', {
  method: 'POST',
  headers: {
    'Authorization': 'Bearer YOUR_API_TOKEN',
    'Accept': 'application/json',
    'Content-Type': 'application/json'
  },
  body: JSON.stringify({
    "source_project_id": 102907,
    "target_project_id": 104449,
    "source_structure_id": 204,
    "prune": "string"
})})
.then(r => r.json())
.then(data => console.log(data));
$response = Http::withToken('YOUR_API_TOKEN')
    ->accept('application/json')
    ->post('https://api.wemasy.nl/api/services/websites/v1/structures/clone', {
    "source_project_id": 102907,
    "target_project_id": 104449,
    "source_structure_id": 204,
    "prune": "string"
});
$data = $response->json();
import requests

headers = {
    "Authorization": "Bearer YOUR_API_TOKEN",
    "Accept": "application/json"
}
data = {
    "source_project_id": 102907,
    "target_project_id": 104449,
    "source_structure_id": 204,
    "prune": "string"
}
r = requests.post("https://api.wemasy.nl/api/services/websites/v1/structures/clone", headers=headers, json=data)
print(r.json())
Response Example
{
    "error": false,
    "message": "string",
    "data": {
        "structure": {
            "id": 0,
            "identifier": "string",
            "website_id": 0,
            "action": "string"
        },
        "categories_cloned": 0,
        "posts_cloned": 0,
        "pruned": true
    }
}

Try It
Request Body Required

Export