This post refers to a legacy version of Siteleaf.
For the last week publishing in the Siteleaf interface has been powered by our API. This has been a requested feature by some of our users and ourselves. Its behavior is bit different than some of our other API endpoints, so let’s go over it.
To initiate a publish, make an authenticated POST
request to the /sites/:id/publish
endpoint.
$ curl -u "$API_KEY:$API_SECRET" -X POST \
https://api.siteleaf.com/v1/sites/$SITE_ID/publish
{"job_id":"e79af12c79ccd8866902d3dd"}
This triggers a publish and immediately returns a job ID (or returns an already running job ID if one exists). You can stop here if you’d like and Siteleaf will happily chug away in the background.
But the fun doesn’t stop there. You can optionally check in on publish progress using your job_id
from above by making an authenticated GET
request to the new /jobs/:id
endpoint.