/services/websites/v1/structures/{type}/categories/create
Auth
| Name | Type | In | Required | Description |
|---|---|---|---|---|
type |
string | path | Required |
| Field | Type | Required | Description | Example |
|---|---|---|---|---|
title |
string
max: 255 |
Yes | Display name of the category | |
url |
string
max: 500 |
Yes | URL slug for the category page, must be unique across project | |
status |
string|null | No | Published status of the category (e.g. "1" for active, "0" for draft) | |
intro |
string|null | No | Short introduction text for the category | |
image |
string|null | No | Featured image URL for the category | |
content |
string|null | No | Main body content of the category page | |
parent_id |
integer|null | No | ID of the parent category for hierarchical nesting | |
sort_number |
integer|null
min: 0 |
No | Manual sort order position for the category | |
layout_id |
integer|null | No | Template layout ID used to render this category page | |
meta_title |
string|null | No | SEO meta title for the category page | |
meta_image |
string|null | No | SEO meta share image URL for the category page | |
meta_description |
string|null | No | SEO meta description for the category page | |
meta_keyword |
string|null | No | SEO meta keywords for the category page | |
canonical_url |
string|null
max: 500 |
No | Canonical URL to prevent duplicate content in search engines | |
no_index |
string|null | No | Whether search engines should skip indexing this category page | |
disable_single_page |
string|null | No | Whether to disable the individual category page (allows duplicate/external URLs) | |
disable_listing |
string|null | No | Whether to hide this category from listing pages | |
posts |
string|null | No | Comma-separated IDs of structure posts to link to this category |
| Header | Type | Description | Example |
|---|---|---|---|
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 |
| Field | Type | Description |
|---|---|---|
error |
boolean | |
message |
string | |
data |
mixed[] |
| Header | Type | Description | Example |
|---|---|---|---|
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 |
| Field | Type | Description |
|---|---|---|
error |
boolean | |
message |
string | |
data |
object | |
data.id |
integer | |
data.url |
string|null |
| Field | Type | Description |
|---|---|---|
message |
string | Errors overview. |
errors |
object | A detailed description of each field that failed validation. |
| Header | Type | Description | Example |
|---|---|---|---|
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 |
| Field | Type | Description |
|---|---|---|
error |
boolean | |
message |
string |
| Header | Type | Description | Example |
|---|---|---|---|
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 |
| Field | Type | Description |
|---|---|---|
error |
boolean | |
message |
string |
| Header | Type | Description | Example |
|---|---|---|---|
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 |
| Field | Type | Description |
|---|---|---|
error |
boolean | |
message |
string |
curl -X POST "https://api.wemasy.nl/api/services/websites/v1/structures/{type}/categories/create" \
-H "Authorization: Bearer YOUR_API_TOKEN" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-d '{
"title": "string",
"url": "string",
"status": "string",
"intro": "string",
"image": "string",
"content": "string",
"parent_id": "string",
"sort_number": "string",
"layout_id": "string",
"meta_title": "string",
"meta_image": "string",
"meta_description": "string",
"meta_keyword": "string",
"canonical_url": "string",
"no_index": "string",
"disable_single_page": "string",
"disable_listing": "string",
"posts": "string"
}'
fetch('https://api.wemasy.nl/api/services/websites/v1/structures/{type}/categories/create', {
method: 'POST',
headers: {
'Authorization': 'Bearer YOUR_API_TOKEN',
'Accept': 'application/json',
'Content-Type': 'application/json'
},
body: JSON.stringify({
"title": "string",
"url": "string",
"status": "string",
"intro": "string",
"image": "string",
"content": "string",
"parent_id": "string",
"sort_number": "string",
"layout_id": "string",
"meta_title": "string",
"meta_image": "string",
"meta_description": "string",
"meta_keyword": "string",
"canonical_url": "string",
"no_index": "string",
"disable_single_page": "string",
"disable_listing": "string",
"posts": "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/{type}/categories/create', {
"title": "string",
"url": "string",
"status": "string",
"intro": "string",
"image": "string",
"content": "string",
"parent_id": "string",
"sort_number": "string",
"layout_id": "string",
"meta_title": "string",
"meta_image": "string",
"meta_description": "string",
"meta_keyword": "string",
"canonical_url": "string",
"no_index": "string",
"disable_single_page": "string",
"disable_listing": "string",
"posts": "string"
});
$data = $response->json();
import requests
headers = {
"Authorization": "Bearer YOUR_API_TOKEN",
"Accept": "application/json"
}
data = {
"title": "string",
"url": "string",
"status": "string",
"intro": "string",
"image": "string",
"content": "string",
"parent_id": "string",
"sort_number": "string",
"layout_id": "string",
"meta_title": "string",
"meta_image": "string",
"meta_description": "string",
"meta_keyword": "string",
"canonical_url": "string",
"no_index": "string",
"disable_single_page": "string",
"disable_listing": "string",
"posts": "string"
}
r = requests.post("https://api.wemasy.nl/api/services/websites/v1/structures/{type}/categories/create", headers=headers, json=data)
print(r.json())
{
"error": false,
"message": "string",
"data": {
"id": 0,
"url": "string"
}
}