Background jobs
Use when the user wants to stop a background operation. A running job stops at its next checkpoint, so it may still finish. Cancelling a finished job changes nothing.
semestra_session<token>Set by the sign-in endpoints for the web app. Requests other than GET, HEAD and OPTIONS also need the X-Semestra-CSRF header set to the semestra_csrf cookie.
job_id*Job IdJob id, as returned when the job was started.
Successful Response
application/json- response
id*Idkind*Kindstatus*Status"pending""running""succeeded""failed""cancelled"progress*Progressstep*string|nullstep_current*integer|nullstep_total*integer|nullresult*|nullerror_code*string|nullerror_params*|nullattempts*Attemptsmax_attempts*Max Attemptscancel_requested*Cancel Requestedcreated_at*Created Atdate-timestarted_at*|nullfinished_at*|nullwaiting?|nullcurl -X POST 'https://example.com/jobs/string/cancel'{ "id": "string", "kind": "string", "status": "pending", "progress": 0, "step": "string", "step_current": 0, "step_total": 0, "result": {}, "error_code": "string", "error_params": {}, "attempts": 0, "max_attempts": 0, "cancel_requested": true, "created_at": "2019-08-24T14:15:22Z", "started_at": "2019-08-24T14:15:22Z", "finished_at": "2019-08-24T14:15:22Z", "waiting": { "reason": "string", "until": "2019-08-24T14:15:22Z" }}Use to check on a long-running operation (file parsing, imports, syncs) that another capability started and returned a job id for.
semestra_session<token>Set by the sign-in endpoints for the web app. Requests other than GET, HEAD and OPTIONS also need the X-Semestra-CSRF header set to the semestra_csrf cookie.
job_id*Job IdJob id, as returned when the job was started.
Successful Response
application/json- response
id*Idkind*Kindstatus*Status"pending""running""succeeded""failed""cancelled"progress*Progressstep*string|nullstep_current*integer|nullstep_total*integer|nullresult*|nullerror_code*string|nullerror_params*|nullattempts*Attemptsmax_attempts*Max Attemptscancel_requested*Cancel Requestedcreated_at*Created Atdate-timestarted_at*|nullfinished_at*|nullwaiting?|nullcurl -X GET 'https://example.com/jobs/string'{ "id": "string", "kind": "string", "status": "pending", "progress": 0, "step": "string", "step_current": 0, "step_total": 0, "result": {}, "error_code": "string", "error_params": {}, "attempts": 0, "max_attempts": 0, "cancel_requested": true, "created_at": "2019-08-24T14:15:22Z", "started_at": "2019-08-24T14:15:22Z", "finished_at": "2019-08-24T14:15:22Z", "waiting": { "reason": "string", "until": "2019-08-24T14:15:22Z" }}Use to find recent or running background operations and their outcome. Do not use to read the data a job produced; use the capability of the module that owns it.
semestra_session<token>Set by the sign-in endpoints for the web app. Requests other than GET, HEAD and OPTIONS also need the X-Semestra-CSRF header set to the semestra_csrf cookie.
status?|Only jobs in this state.
kind?|Only jobs of this kind, e.g. files.parse.
cursor?|next_cursor of the previous page.
limit?LimitPage size.
20Successful Response
application/json- response
items*array<>next_cursor*string|nullcurl -X GET 'https://example.com/jobs'{ "items": [ { "id": "string", "kind": "string", "status": "pending", "progress": 0, "step": "string", "step_current": 0, "step_total": 0, "result": {}, "error_code": "string", "error_params": {}, "attempts": 0, "max_attempts": 0, "cancel_requested": true, "created_at": "2019-08-24T14:15:22Z", "started_at": "2019-08-24T14:15:22Z", "finished_at": "2019-08-24T14:15:22Z", "waiting": { "reason": "string", "until": "2019-08-24T14:15:22Z" } } ], "next_cursor": "string"}