Cancel a job
September 29, 2026
Table of contents
Stop tracking a running job and free the maxJobs slot it holds on its account (see GET /jobs). The job record turns failed with error code cancelled, and no replyUrl webhook is sent for it.
Cancelling a Studio artifact job does not stop Google. Once Google has started an artifact it keeps generating it, the quota it spends is spent, and the finished artifact shows up in the notebook: find it with GET /artifacts or read it by the job’s artifact id with GET /artifacts/artifact. To remove it, delete the artifact once it exists.
A research job from POST /research is different: the run is stopped at Google too, and its record’s message is Cancelled: the research run was stopped. If Google could not be told to stop it, the job is still cancelled and its slot freed, and the message reads Cancelled: the slot is freed, but Google could not be told to stop the research run. A cancelled research job cannot be imported with POST /research/import.
A one-shot job (a POST /artifacts with urls / text instead of notebook) cancelled before its artifact was created also deletes the notebook that was made for it, since that notebook holds nothing you asked for.
Cancelling a job that already completed or failed changes nothing and also answers 204.
https://api.useapi.net/v1/gemini-notebook/jobs/
jobid
jobidis URL-encoded in the path (it contains:and@).
Request Headers
Authorization: Bearer {API token}
API tokenis required, see Setup useapi.net for details.
Responses
-
The job is cancelled (or was already finished). The response has no body. GET /jobs/
jobidnow shows, for a Studio artifact job:{ "jobid": "job:09112e70-e1f3-422d-a1af-955de87508e4-user:[email protected]:gemini_notebook", "status": "failed", "completed_at": "2026-09-28T03:23:42.561Z", "error": { "code": "cancelled", "message": "Cancelled: the slot is freed. Google may still finish the artifact in the notebook." }, "...": "..." }For a research job:
{ "jobid": "job:0645b31d-ea2b-4c26-8754-a3b7876a21d0-user:[email protected]:gemini_notebook", "type": "research", "status": "failed", "completed_at": "2026-09-29T04:15:42.251Z", "error": { "code": "cancelled", "message": "Cancelled: the research run was stopped." }, "...": "..." } -
The path value is not a Gemini Notebook jobid.
{ "error": "Path parameter jobid (…) is not a valid jobid", "code": 400 } -
Invalid API token.
{ "error": "useapi.net ⁝ Unauthorized", "code": 401 } -
{ "error": "jobid does not belong to this API token", "code": 403 } -
No such job, or its record is older than 30 days.
{ "error": "Job job:09112e70-…-bot:gemini_notebook not found", "code": 404 }
Model
A successful cancel returns 204 with no body. The cancelled record is the job record with status: 'failed' and error.code: 'cancelled'. Errors return:
{ // TypeScript, all fields are optional
error: string
code: number
}
Examples
-
JOBID="job:09112e70-e1f3-422d-a1af-955de87508e4-user:[email protected]:gemini_notebook" curl -X DELETE "https://api.useapi.net/v1/gemini-notebook/jobs/$(python3 -c "import urllib.parse,sys;print(urllib.parse.quote(sys.argv[1],safe=''))" "$JOBID")" \ -H "Authorization: Bearer …" -
const token = "API token"; const jobid = "job:09112e70-e1f3-422d-a1af-955de87508e4-user:[email protected]:gemini_notebook"; const apiUrl = `https://api.useapi.net/v1/gemini-notebook/jobs/${encodeURIComponent(jobid)}`; const response = await fetch(apiUrl, { method: "DELETE", headers: { "Authorization": `Bearer ${token}`, }, }); console.log("response", response.status); -
import requests, urllib.parse token = "API token" jobid = "job:09112e70-e1f3-422d-a1af-955de87508e4-user:[email protected]:gemini_notebook" apiUrl = "https://api.useapi.net/v1/gemini-notebook/jobs/" + urllib.parse.quote(jobid, safe="") headers = { "Authorization" : f"Bearer {token}" } response = requests.delete(apiUrl, headers=headers) print(response.status_code)