Earlier this year, we added some site endpoints for HTTPS, PHP versions, and additional domains, and promised more were on the way. We’ve now added the rest, so you can automate almost everything on a site’s settings screens:
- Backups – Update a site’s backup settings and schedule.
- Page cache – Enable and disable page caching, and update the cache settings.
- Git – Connect or disconnect a repository, and change the repository, branch, deploy script, or push-to-deploy setting.
- Path redirects – List, add, and remove path redirects.
- Nginx – Change the public folder, disallow PHP execution in the uploads folder, disable XML-RPC, and toggle multisite subdirectory rewrites.
- Cron – Enable, disable, and change the interval of the server cron that runs WP-Cron.
- Basic auth – Password protect a site, update the credentials, or remove it.
- Site user – Switch the site user between SSH key and password authentication, and choose which SSH keys have access.
We’ve also added two new list endpoints to help with the above: one for the SSH keys on your account and one for your storage providers, so you can look up the IDs you need without leaving the API.
Endpoints that make a change on the server return an event ID, so you can use the events endpoint to track its progress, just like the existing site endpoints.
All of the new endpoints are also available in the PHP SDK as of version 1.3.0.
See the REST API docs for the full details.