Repositories

Install repository

Install a repository in your site

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

Parameters

Parameter Type Status Description
provider string required Maximum: 100 Must be: "bitbucket", "github", "gitlab", or "custom"
branch string required
name string required Must be either: 'username/repository' or a custom GIT url ending with .git

Example request:

curl -X POST "https://ploi.io/api/servers/{server}/sites/{site}/repository" \
-H "Authorization: Bearer {token}" \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
   --data '{"provider":"bitbucket","branch":"master","name":"user/repository"}' \
   

Example response:

HTTP/1.1 200 OK
Content-Type: application/json

{
    "data": {
        "id": 90,
        "domain": "domain.com",
        "web_directory": "/public",
        "wordpress": false,
        "laravel": false,
        "project_root": "/",
        "last_deploy_at": "2018-09-14 20:36:05",
        "created_at": "2018-09-14 11:40:01",
        "repository": {
            "branch": "master",
            "user": "username",
            "provider": "bitbucket"
        }
    }
}

Delete repository

Delete a repository in your site

DELETE api/servers/{server}/sites/{site}/repository

Example request:

curl -X DELETE "https://ploi.io/api/servers/{server}/sites/{site}/repository" \
-H "Authorization: Bearer {token}" \
-H "Content-Type: application/json" \
-H "Accept: application/json" \

Example response:

HTTP/1.1 200 OK
Content-Type: application/json

{
    "data": {
        "id": 90,
        "domain": "domain.com",
        "web_directory": "/public",
        "wordpress": false,
        "laravel": false,
        "project_root": "/",
        "last_deploy_at": "2018-09-14 20:43:11",
        "created_at": "2018-09-14 11:40:01"
    }
}