Skip to main content

List Agent Tasks

GET /agent-tasks
Retrieve all task executions in your workspace with comprehensive filtering and pagination options.

Headers

x-api-key
string
required
Your API key for authentication
current-workspace-id
string
required
Your workspace ID

Query Parameters

pageNum
number
default:"1"
Page number for pagination
pageSize
number
default:"10"
Number of items per page
agentId
string
Filter tasks by specific agent ID
status
string
Filter by task status: “pending”, “running”, “completed”, “failed”
startDate
string
Filter tasks created after this date (ISO 8601 format)
endDate
string
Filter tasks created before this date (ISO 8601 format)
sortBy
string
Field to sort by (e.g., “createdAt”, “completedAt”)
sortOrder
string
Sort order: “asc” or “desc”

Response

data
array
Array of task objects
pagination
object
Pagination information

Example Request

curl -X GET "https://api.beamstudio.ai/agent-tasks?status=completed&pageSize=20" \
  -H "x-api-key: your-api-key" \
  -H "current-workspace-id: your-workspace-id"

Example Response

{
  "data": [
    {
      "id": "task_abc123",
      "agentId": "agent_123456",
      "agentName": "Customer Support Agent",
      "status": "completed",
      "input": {
        "customerEmail": "customer@example.com",
        "issueType": "billing"
      },
      "output": {
        "resolution": "Issue resolved - refund processed",
        "ticketId": "TICKET-001"
      },
      "createdAt": "2024-03-21T10:30:00Z",
      "completedAt": "2024-03-21T10:35:00Z",
      "duration": 300,
      "url": "https://app.beam.ai/tasks/task_abc123"
    }
  ],
  "pagination": {
    "total": 150,
    "pageNum": 1,
    "pageSize": 20,
    "totalPages": 8
  }
}

Task Status Values

  • pending: Task has been created but not yet started
  • running: Task is currently executing
  • completed: Task finished successfully
  • failed: Task encountered an error and failed to complete
  • cancelled: Task was cancelled by the user