Skip to content
Get started

List objective tasks

objectives.tasks.list(objective_id, **kwargs) -> CursorPagination<ObjectiveTask { data, metadata } >
GET/v1/workspaces/{workspaceId}/objectives/{objectiveId}/tasks

Lists all tasks for an objective

ParametersExpand Collapse
workspace_id: String
objective_id: String
cursor: String

Pagination cursor from previous response

limit: Integer

Maximum number of results to return

formatint32
sort_order: String

Sort order for results

ReturnsExpand Collapse
class ObjectiveTask { data, metadata }

ObjectiveTask represents a task within an objective, typically created and managed by an AI agent to track progress toward completing the objective.

data: ObjectiveTaskData { completed, number, task, completed_at }
completed: bool

Whether the task has been completed

number: Integer

The sequential number of this task within the objective (auto-assigned, 1-based)

formatint32
task: String

Description of the task to be completed

completed_at: Time

Timestamp when the task was marked as completed

formatdate-time
metadata: BareMetadata { id, name }

BareMetadata contains the minimal metadata for a resource: the ID and an optional human-readable name. These are used for reference fields where the full metadata (account scoping, timestamps, labels, external IDs) is not needed — e.g., the tool references inside an agent variation spec or the tools assigned to an objective. Both fields are server-populated; clients provide IDs through sibling fields rather than by constructing a BareMetadata themselves.

id: String
name: String

Human-readable name of the referenced resource, populated by the server on reads for convenience. Absent on references to resources that do not have a name (e.g., objective tasks).

List objective tasks

require "cadenya"

cadenya = Cadenya::Client.new(api_key: "My API Key")

page = cadenya.objectives.tasks.list("objectiveId", workspace_id: "workspaceId")

puts(page)
{
  "items": [
    {
      "data": {
        "completed": true,
        "number": 0,
        "task": "task",
        "completedAt": "2019-12-27T18:11:19.117Z"
      },
      "metadata": {
        "id": "id",
        "name": "name"
      }
    }
  ],
  "pagination": {
    "nextCursor": "nextCursor",
    "total": 0
  }
}
Returns Examples
{
  "items": [
    {
      "data": {
        "completed": true,
        "number": 0,
        "task": "task",
        "completedAt": "2019-12-27T18:11:19.117Z"
      },
      "metadata": {
        "id": "id",
        "name": "name"
      }
    }
  ],
  "pagination": {
    "nextCursor": "nextCursor",
    "total": 0
  }
}