Ploi API

Create redirect

Create a certificate in your site

POST api/servers/{server}/sites/{site}/redirects

Parameters

Parameter Type Status Description
redirect_from string required The path where you want to redirect from
redirect_to string required The path where you want to redirect to
type string required Possible values: permantent, redirect

Example request:

curl -X POST "https://ploi.io/api/servers/{server}/sites/{site}/certificates" \
-H "Authorization: Bearer {token}" \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
   --data '{ 
         "redirect_from": "/",
         "redirect_to": "/home", 
         "type": "permantent"
    }'

Example response:

HTTP/1.1 201 CREATED
Content-Type: application/json

{
    "data": {
        "id": 1,
        "status": "created",
        "redirect_from": "/",
        "redirect_to": "/home",
        "type": "permanent"
    }
}