API

Jobs

Overview

The Jobs endpoint can be used to monitor long running tasks, such as publishing a site. It uses Server Sent Events (SSE) to comunicate with the client.

Listen to a job

Events are streamed to the client in real time, with event data encoded as JSON. When the job completes or fails the server will close the connection. The last event is available for 30 minutes, after which the job id expires.

Endpoint

GET https://api.siteleaf.com/v2/jobs/:job_id

Response

Status: 200 OK
Content-Type: text/event-stream
event:status
data:{"status":"working","message":"Working...","updated_at":"1452890740"}

event:status
data:{"status":"working","message":"Working...","updated_at":"1452890744"}

event:status
data:{"status":"complete","message":"Done!","updated_at":"1452890745"}

Response after job expires

Status: 410 Gone
Content-Type: text/event-stream
event:status
data:{"status":"error","message":"Job not found"}

Help improve this page