Skip to content

The Agent Jobs endpoints let you poll the status and result of async work dispatched through the agent (session inputs, workflow runs, long tool calls, headless runs), and cancel a still-active job or delete a terminal record. Use GET /jobs/{id} for the full job record, GET /jobs/{id}/result for a lean status-and-payload view, and DELETE /jobs/{id} to stop a pending or running job, or purge a finished one.


GET /api/v1/agent/jobs/{id}

Returns the gateway-minted job record for an async dispatch, workflow run, or long tool call.

NameInTypeRequiredDescription
idpathstringYesPath identifier.
X-Hoody-CwdheaderstringNoPer-request working-directory scope (§6.1): the .hoody project layer / record cwd / tool+workflow cwd.
X-Hoody-Config-DirheaderstringNoPer-request --config-dir override (§6.1) selecting which on-disk .hoody install a stateless read/write resolves.
X-Hoody-ContainerheaderstringNoPer-request bound remote container (§6.1; omitted = local). Rejected (400) on routes with no container dimension.
X-Hoody-RealmheaderstringNoPer-request realm selector (§6.1): "global" or a 24-hex id. Rejected (400 realm_scope_unsupported) on active-only / no-realm routes.
realmquerystringNoPer-request realm selector (§6.1) — the query-string alias of the X-Hoody-Realm header, read only when the header is absent.

This endpoint accepts no body.

{
"job_id": "job_5f3c1a7b9d2e4f6a8b0c1d2e",
"kind": "session.workflow",
"session_id": "sess_8a7b6c5d4e3f2a1b0c9d8e7f",
"run_id": "run_2a3b4c5d6e7f8a9b0c1d2e3f",
"status": "running",
"created_at": "2025-11-14T09:32:18.512Z",
"updated_at": "2025-11-14T09:32:24.118Z"
}
const job = await client.agent.jobs.getJob({
id: "job_5f3c1a7b9d2e4f6a8b0c1d2e",
});
Terminal window
curl -X GET "https://api.hoody.ai/api/v1/agent/jobs/job_5f3c1a7b9d2e4f6a8b0c1d2e" \
-H "Authorization: Bearer $HOODY_TOKEN"

GET /api/v1/agent/jobs/{id}/result

Returns the terminal status and payload of a completed job, or the running status if the job is still in flight. Dispatch jobs are observed on the session stream — the result body carries terminal status only for those.

NameInTypeRequiredDescription
idpathstringYesPath identifier.
X-Hoody-CwdheaderstringNoPer-request working-directory scope (§6.1).
X-Hoody-Config-DirheaderstringNoPer-request --config-dir override (§6.1).
X-Hoody-ContainerheaderstringNoPer-request bound remote container (§6.1; omitted = local).
X-Hoody-RealmheaderstringNoPer-request realm selector (§6.1): "global" or a 24-hex id.
realmquerystringNoPer-request realm selector (§6.1) — the query-string alias of the X-Hoody-Realm header.

This endpoint accepts no body.

{
"status": "succeeded",
"result": {
"answer_id": "ans_4f2a1b3c5d6e7f8a9b0c1d2e",
"summary": "Reviewed the 3 pending TODOs and ranked them by impact."
},
"session_id": "sess_8a7b6c5d4e3f2a1b0c9d8e7f"
}
const result = await client.agent.jobs.getJobResult({
id: "job_5f3c1a7b9d2e4f6a8b0c1d2e",
});
Terminal window
curl -X GET "https://api.hoody.ai/api/v1/agent/jobs/job_5f3c1a7b9d2e4f6a8b0c1d2e/result" \
-H "Authorization: Bearer $HOODY_TOKEN"

DELETE /api/v1/agent/jobs/{id}

Cancels a pending or running async job, or deletes a terminal (succeeded / failed / canceled) job’s immutable historical record.

  • A pending/running job transitions to canceled and its work is stopped at the source: a sessionless run (headless / long tool call) has its bounded context cancelled; a session dispatch / workflow turn is stopped via session.cancel (the active turn is cancelled, the session and its background tasks are spared).
  • A terminal job’s record is removed.
  • Returns {status:"ok", canceled:true} on a cancel and {status:"ok", deleted:true} on a terminal-record delete; 404 when the job id is unknown.
  • The cancel is authoritative — a late terminator never flips a canceled job back to succeeded / failed.
NameInTypeRequiredDescription
idpathstringYesPath identifier.
X-Hoody-CwdheaderstringNoPer-request working-directory scope (§6.1).
X-Hoody-Config-DirheaderstringNoPer-request --config-dir override (§6.1).
X-Hoody-ContainerheaderstringNoPer-request bound remote container (§6.1; omitted = local).
X-Hoody-RealmheaderstringNoPer-request realm selector (§6.1): "global" or a 24-hex id.
realmquerystringNoPer-request realm selector (§6.1) — the query-string alias of the X-Hoody-Realm header.

This endpoint accepts no body.

{
"status": "ok",
"canceled": true
}
{
"status": "ok",
"deleted": true
}
// Cancel a still-active job
const result = await client.agent.jobs.deleteJob({
id: "job_5f3c1a7b9d2e4f6a8b0c1d2e",
});
// result: { status: "ok", canceled: true } — for pending/running
// result: { status: "ok", deleted: true } — for terminal
Terminal window
curl -X DELETE "https://api.hoody.ai/api/v1/agent/jobs/job_5f3c1a7b9d2e4f6a8b0c1d2e" \
-H "Authorization: Bearer $HOODY_TOKEN"