← Home
POST/hyax-api/v1/posts/:id/redirects

Add a redirect to a post

Adds an old address that leads to this post. Permanent (`301`) unless you say otherwise, and it keeps following the post if its slug or URL prefix changes.

Base URL: https://platform.hyax.com · Replace YOUR_API_KEY with your team API key.

Request body

FieldRequiredDescription
from Required Old path or full URL
statusCodeNo`301` | `302` | `307` | `308`. Default `301`.

Request

curl -X POST 'https://platform.hyax.com/hyax-api/v1/posts/clx_example_id/redirects' \
  -H 'Authorization: Bearer YOUR_API_KEY' \
  -H 'Content-Type: application/json' \
  -d '{
    "from": "/old-category/old-post-name"
  }'

Response

{
  "success": true,
  "data": [
    { "id": "clx…", "from": "/old-category/old-post-name", "to": "/article/new-post", "statusCode": 301, "postId": "clx…" }
  ],
  "rejected": [],
  "summary": { "created": 1, "rejected": 0 }
}