Skip to main content
GET
/
session
/
{session_id}
/
task
Python
from acontext import AcontextClient

client = AcontextClient(api_key='sk_project_token')

# Get tasks from a session
tasks = client.sessions.get_tasks(
    session_id='session-uuid',
    limit=20,
    time_desc=False
)
print(f"Found {len(tasks.items)} tasks")
for task in tasks.items:
    print(f"Task {task.id}: {task.status}")

# If there are more tasks, use the cursor for pagination
if tasks.has_more:
    next_tasks = client.sessions.get_tasks(
        session_id='session-uuid',
        limit=20,
        cursor=tasks.next_cursor
    )
{
  "code": 123,
  "error": "<string>",
  "msg": "<string>",
  "data": {
    "has_more": true,
    "items": [
      {
        "created_at": "<string>",
        "data": {},
        "id": "<string>",
        "is_planning": true,
        "order": 123,
        "project_id": "<string>",
        "session_id": "<string>",
        "space_digested": true,
        "status": "<string>",
        "updated_at": "<string>"
      }
    ],
    "next_cursor": "<string>"
  }
}

Authorizations

Authorization
string
header
required

Project Bearer token (e.g., "Bearer sk-ac-xxxx")

Path Parameters

session_id
string<uuid>
required

Session ID

Query Parameters

limit
integer

Limit of tasks to return, default 20. Max 200.

cursor
string

Cursor for pagination. Use the cursor from the previous response to get the next page.

time_desc
boolean

Order by created_at descending if true, ascending if false (default false)

Response

200 - application/json

OK

code
integer
error
string
msg
string
data
object