## List objective tasks `client.Objectives.Tasks.List(ctx, objectiveID, query) (*CursorPagination[ObjectiveTask], error)` **get** `/v1/objectives/{objectiveId}/tasks` Lists all tasks for an objective ### Parameters - `objectiveID string` - `query ObjectiveTaskListParams` - `Cursor param.Field[string]` Pagination cursor from previous response - `Limit param.Field[int64]` Maximum number of results to return - `SortOrder param.Field[string]` Sort order for results ### Returns - `type ObjectiveTask struct{…}` 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 bool` Whether the task has been completed - `Number int64` The sequential number of this task within the objective (auto-assigned, 1-based) - `Task string` Description of the task to be completed - `CompletedAt Time` Timestamp when the task was marked as completed - `Metadata BareMetadata` 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). ### Example ```go package main import ( "context" "fmt" "github.com/cadenya/cadenya-go" "github.com/cadenya/cadenya-go/option" ) func main() { client := cadenya.NewClient( option.WithAPIKey("My API Key"), ) page, err := client.Objectives.Tasks.List( context.TODO(), "objectiveId", cadenya.ObjectiveTaskListParams{ }, ) if err != nil { panic(err.Error()) } fmt.Printf("%+v\n", page) } ``` #### Response ```json { "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 } } ```