Skip to content
中文

List Session Background Tasks (Extension)

GET/agent/v1/sessions/{session_id}/background_tasks● Supported

Request parameters

  • session_idstringrequired

    path: Session id (sesn_...), as returned by sessions.create or sessions.list. The same id is also accepted as the session_id query parameter on resource and thread calls, where it must equal the path value.

Returns

200

Own-face extension. Returns { data: BackgroundTask[] }. Each task has id, kind, title, thread_id, status, started_at, ended_at, cancellable, notified_at and trigger_count. Subagent rows link to their child thread via thread_id; other kinds have null. kind is an open string; tolerate unknown kinds. Status is running, result_pending, completed, failed, cancelled or lost. Only completed tasks with pending delivery are result_pending. Timestamps are RFC3339; ended_at is null while running. notified_at is the admission time of the latest system notification batch, or null. trigger_count counts admitted monitor event batches, or is null without records and for other kinds. Only supported running tasks without stop intent are cancellable. Missing or inaccessible sessions return 404.

Errors follow the Anthropic error format (type / message / request_id) — see error codes

Request

curl
curl https://api.deepraxis.com/agent/v1/sessions/sesn_example/background_tasks \
  -H "Authorization: Bearer $PRAXIS_API_KEY"
Python
import requests

opts = dict(
    base_url="https://api.deepraxis.com/agent",
    api_key="$PRAXIS_API_KEY",
)

# /agent 是我们自己的 Managed Agents 形状,直接发 HTTP 请求(Bearer 认证)
resp = requests.get(
    f"{opts['base_url']}/v1/sessions/sesn_example/background_tasks",
    headers={"Authorization": f"Bearer {opts['api_key']}"},
)
print(resp.status_code, resp.json())
TypeScript
const opts = {
  baseURL: "https://api.deepraxis.com/agent",
  apiKey: "$PRAXIS_API_KEY",
};

// /agent 是我们自己的 Managed Agents 形状,直接发 HTTP 请求(Bearer 认证)
const resp = await fetch(`${opts.baseURL}/v1/sessions/sesn_example/background_tasks`, {
  headers: { Authorization: `Bearer ${opts.apiKey}` },
});
console.log(resp.status, await resp.json());

Response 200

{
  "data": [
    {
      "id": "task_example",
      "kind": "bash",
      "thread_id": null,
      "title": "Build application",
      "status": "running",
      "started_at": "2026-10-05T14:00:00.000Z",
      "ended_at": null,
      "cancellable": true,
      "notified_at": null,
      "trigger_count": null
    }
  ]
}

Response

HTTP 200

Session background tasks

application/json

Name Type Description
data array<object> Items of this page, in the order requested by the call.
data[].id string Identifier of the object, as returned by the API; pass it in the path of follow-up calls on the same resource.
data[].kind string Kind of background task: bash for a command started with run_in_background, monitor for a monitor watch.
data[].title string Short human-readable title of the task or object.
data[].thread_id string | null Execution thread the task belongs to; null for the primary thread.
data[].status string Current lifecycle state.
data[].started_at string RFC 3339 time at which the task started.
data[].ended_at string | null RFC 3339 time at which the task ended; null while it is running.
data[].cancellable boolean Whether the task can still be stopped.
data[].notified_at string | null RFC 3339 time of the latest run that the task's notification started; null while no notification has been delivered.
data[].trigger_count integer | null For a monitor task, how many times its matches woke the session; null for other kinds or before the first notification.