Skip to main content
GET
/
agent-tasks
/
iterate
Get Next Task
curl --request GET \
  --url https://api.beamstudio.ai/agent-tasks/iterate \
  --header 'Authorization: Bearer <token>' \
  --header 'current-workspace-id: <current-workspace-id>'
{
  "previous": {
    "id": "node_123e4567",
    "agentGraph": {
      "agentId": "123e4567-e89b-12d3-a456-426614174000"
    }
  },
  "next": {
    "id": "node_123e4567",
    "agentGraph": {
      "agentId": "123e4567-e89b-12d3-a456-426614174000"
    }
  }
}

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Headers

current-workspace-id
string
required

Query Parameters

agentId
string

Filter tasks for a specific agent

Example:

"123e4567-e89b-12d3-a456-426614174000"

taskId
string

The current task ID to find the next task relative to

Example:

"123e4567-e89b-12d3-a456-426614174001"

statuses
string

Comma-separated list of task statuses to include

Example:

"pending,in_progress"

searchQuery
string

Search query to filter tasks

Example:

"email"

ordering
enum<string>
default:asc

Sort order direction

Available options:
asc,
desc
Example:

"asc"

createdAt
string

Filter by task creation date

Example:

"2024-01-01T00:00:00Z"

updatedAt
string

Filter by task last update date

Example:

"2024-01-31T23:59:59Z"

grouping
enum<string>
Available options:
status,
agent

Response

200 - application/json

Next task retrieved successfully

previous
object
required

The previous node in the task navigation sequence, null if at the beginning

next
object
required

The next node in the task navigation sequence, null if at the end