GRANSKA

Delete a job

DELETEhttps://api.granska.cloud/v1/jobs/:jobId

Deletes a finished job before it would expire on its own.

Bearer tokenSpends no quota

When to call it

Everything here is deleted eventually — the retention sweep removes a job and its stored result within fifteen minutes of the job's last change. This endpoint is for the case where "eventually" 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. An integration that never calls it leaves nothing behind either — it just leaves it behind for a few more minutes.

Request
curl -X DELETE https://api.granska.cloud/v1/jobs/job_7d41c9 \
  -H "Authorization: Bearer $TOKEN"
Response
{
  "success": true,
  "message": "Job deleted."
}

Request

ParameterDescription
jobId
string·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 belonging to another tenant answers 403, and one that never existed — or has already been swept — answers 404.

ErrorWhen
400
BAD_REQUEST
The job is in a state that is neither in progress nor deletable. Not probed: it needs a job in that state.
401
UNAUTHORIZED
The Authorization header is missing, is not a readable bearer token, or names no tenant.
401
TOKEN_EXPIRED
The access token was issued by this gateway and has since expired. Not probed: it needs a token older than its own lifetime.
403
FORBIDDEN
The job exists but belongs to another tenant. Not probed: it needs a job created by a second tenant.
404
NOT_FOUND
No job with that id.
409
CONFLICT
The job is still QUEUED or IN_PROGRESS. Wait for it to reach COMPLETED or FAILED. Not probed: it needs a job mid-flight.
500
INTERNAL_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.