/services/websites/v1/redirects/edit
Auth
Updates an existing URL redirection for the current website.
| Field | Type | Required | Description | Example |
|---|---|---|---|---|
id |
integer|null | No | Existing redirection ID (for edit only). | 1 |
from_path |
string
max: 500 |
Yes | Source path, must start with /, lowercase, no query strings or fragments. Cannot be the homepage (/). Only valid URL path characters allowed. | /old-page |
to_path |
string|null
max: 500 |
No | Target path (starts with /) or external URL (starts with https://). Required when no target_type is set. No javascript:, data:, mailto:, tel:, vbscript: protocols allowed. | /new-page |
redirect_type |
string
301, 302 |
Yes | HTTP redirect status code. Only 301 (permanent) or 302 (temporary). | 301 |
is_active |
boolean|null | No | Whether this redirect is currently active. | true |
target_type |
string|null
pages, structure_items, structure_categories, products, products_categories |
No | Content type when redirecting to an existing page. | pages |
target_id |
integer|null | No | Content ID when redirecting to an existing page. Required when target_type is set. | 123 |
| 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.redirection |
object |
| 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/redirects/edit" \
-H "Authorization: Bearer YOUR_API_TOKEN" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-d '{
"id": 1,
"from_path": "/old-page",
"to_path": "/new-page",
"redirect_type": "301",
"is_active": true,
"target_type": "pages",
"target_id": 123
}'
fetch('https://api.wemasy.nl/api/services/websites/v1/redirects/edit', {
method: 'POST',
headers: {
'Authorization': 'Bearer YOUR_API_TOKEN',
'Accept': 'application/json',
'Content-Type': 'application/json'
},
body: JSON.stringify({
"id": 1,
"from_path": "/old-page",
"to_path": "/new-page",
"redirect_type": "301",
"is_active": true,
"target_type": "pages",
"target_id": 123
})})
.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/redirects/edit', {
"id": 1,
"from_path": "/old-page",
"to_path": "/new-page",
"redirect_type": "301",
"is_active": true,
"target_type": "pages",
"target_id": 123
});
$data = $response->json();
import requests
headers = {
"Authorization": "Bearer YOUR_API_TOKEN",
"Accept": "application/json"
}
data = {
"id": 1,
"from_path": "/old-page",
"to_path": "/new-page",
"redirect_type": "301",
"is_active": true,
"target_type": "pages",
"target_id": 123
}
r = requests.post("https://api.wemasy.nl/api/services/websites/v1/redirects/edit", headers=headers, json=data)
print(r.json())
{
"error": false,
"message": "string",
"data": {
"redirection": {
"id": 0,
"from_path": "string",
"to_path": "string",
"redirect_type": 0,
"is_active": true,
"sort_order": 0,
"source": "string",
"target_type": "string",
"target_id": 0
}
}
}