Delete a job
https://api.granska.cloud/v1/jobs/:jobIdDeletes a finished job before it would expire on its own.
When to call it
Scheduled cleanup normally removes a job and its stored result between fifteen and thirty minutes after the job's last change when a successful run reaches that job within its per-run capacity. Two missed four-minute sweep runs fit within thirty minutes, including execution, only if the next run succeeds and reaches the job. Further failed runs or a backlog beyond that run's capacity can delay removal beyond thirty minutes and require later successful runs. This endpoint is for the case where waiting is not good enough: you have read the result, written it to your own store, and want the copy here gone now.
It deletes the job record and the payload together. The response is a plain acknowledgement; there is
nothing to read afterwards, and a second delete answers 404.
Calling it is optional. Without that call, scheduled cleanup normally removes the job between fifteen and thirty minutes after its last change when a successful run reaches that job within its per-run capacity. Two missed four-minute sweep runs fit within thirty minutes, including execution, only if the next run succeeds and reaches the job. Further failed runs or a backlog beyond that run's capacity can delay removal beyond thirty minutes and require later successful runs.
curl -X DELETE https://api.granska.cloud/v1/jobs/job_7d41c9 \
-H "Authorization: Bearer $TOKEN"{
"success": true,
"message": "Job deleted."
}Request
| Parameter | Description |
|---|---|
jobIdstring·path·required | The id of a job that has reached COMPLETED or FAILED. |
Errors
A job still running cannot be deleted. QUEUED and IN_PROGRESS answer 409 CONFLICT; wait for
COMPLETED or FAILED and try again. There is no cancel operation — this endpoint does not stop
work in flight, and a run already spent is not refunded by deleting the job it paid for.
A job your credential did not start answers 403: another organisation's job, one another API
client of yours started, or one a person started in the web application or the API tester. One that
never existed — or has already been swept — answers 404.
| Error | When |
|---|---|
400BAD_REQUEST | The job is in a state that is neither in progress nor deletable. Not probed: it needs a job in that state. |
401UNAUTHORIZED | The Authorization header is missing, is not a readable bearer token, or names no tenant. |
401TOKEN_EXPIRED | The access token was issued by this gateway and has since expired. Not probed: it needs a token older than its own lifetime. |
403FORBIDDEN | The job exists but your credential did not start it: another organisation's job, one another API client of yours started, or one a person started in the web application or the API tester. Not probed: it needs a job started by a second credential. |
404NOT_FOUND | No job with that id. |
409CONFLICT | The job is still QUEUED or IN_PROGRESS. Wait for it to reach COMPLETED or FAILED. Not probed: it needs a job mid-flight. |
500INTERNAL_ERROR | An unexpected server-side failure. Not probable from outside — reaching it means something is wrong. |
Send it without writing a client
If your organisation already has an account, an administrator can send this call from the API tester
at /admin/api-tester. It deletes real data, so point it at a job you have
already read. The tester reaches the jobs it started itself, with the credential it holds; a
colleague's job answers 403.