Install repository
Clone a Git repository into a subdirectory of a WordPress site.
POST/api/servers/{server}/sites/{id}/wordpress/repositories
Install repository
Clones a Git repository into the specified target directory within the WordPress installation. Useful for managing themes or plugins via Git. Not instant - the clone is processed in the background.
Required attributes
- Name
provider- Type
- string
- Description
The repository provider. Must be:
github,gitlab,bitbucket, orcustom.
- Name
name- Type
- string
- Description
The repository in
username/repositoryformat, or a custom Git URL for custom providers.
- Name
branch- Type
- string
- Description
The branch to clone.
- Name
target_directory- Type
- string
- Description
Relative path from the site root where the repository will be cloned (e.g.
public/wp-content/themes/my-theme).
Optional attributes
- Name
source_provider_id- Type
- integer
- Description
The ID of a specific source control provider account to use.
Request
POST
/api/servers/{server}/sites/{id}/wordpress/repositoriescurl -X POST "https://ploi.io/api/servers/{server}/sites/{id}/wordpress/repositories" \
-H "Authorization: Bearer {token}" \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-d '{
"provider": "github",
"name": "acme/custom-theme",
"branch": "main",
"target_directory": "public/wp-content/themes/custom-theme"
}'
Response
{
"status": "ok",
"message": "Repository is being installed."
}