Skip to content
Get started

List task turns

tasks.list_turns(task_id) -> TaskTurnList { items, task_id }
GET/api/tasks/{taskId}/turns

List the individual turns for a task in execution order.

ParametersExpand Collapse
task_id: String
ReturnsExpand Collapse
class TaskTurnList { items, task_id }
items: Array[Turn { id, completed_at, credits, 12 more } ]
id: String
completed_at: String
credits: Integer
duration_ms: Integer
files: Array[File{ filename, media_type, url, size}]

Files published by this turn.

filename: String
media_type: String
url: String
formaturi
size: Integer
minimum0
input: String
input_tokens: Integer
output_text: String
output_tokens: Integer
role: String
seq: Integer
started_at: String
status: String
structured_output: Hash[Symbol, untyped]

Structured JSON payload when the worker is configured with an output schema. null otherwise.

task_id: String
task_id: String

List task turns

require "handinger"

handinger = Handinger::Client.new(api_key: "My API Key")

task_turn_list = handinger.tasks.list_turns("tsk_01HZY31W2SZJ8MJ2FQTR3M1K9D")

puts(task_turn_list)
{
  "items": [
    {
      "id": "trn_4Hq-9Vk2pLm8Rx",
      "completedAt": "2026-05-11T09:14:48.000Z",
      "credits": 42,
      "durationMs": 25812,
      "files": [
        {
          "filename": "filename",
          "mediaType": "mediaType",
          "url": "https://example.com",
          "size": 0
        }
      ],
      "input": "What's the weather today in Barcelona?",
      "inputTokens": 1842,
      "outputText": "It's currently 21°C and sunny in Barcelona with a light breeze from the south-east.",
      "outputTokens": 312,
      "role": "assistant",
      "seq": 0,
      "startedAt": "2026-05-11T09:14:22.000Z",
      "status": "completed",
      "structuredOutput": {
        "temperatureCelsius": "bar",
        "conditions": "bar"
      },
      "taskId": "tsk_2Z-YWz3hFq6VlW"
    }
  ],
  "taskId": "tsk_2Z-YWz3hFq6VlW"
}
Returns Examples
{
  "items": [
    {
      "id": "trn_4Hq-9Vk2pLm8Rx",
      "completedAt": "2026-05-11T09:14:48.000Z",
      "credits": 42,
      "durationMs": 25812,
      "files": [
        {
          "filename": "filename",
          "mediaType": "mediaType",
          "url": "https://example.com",
          "size": 0
        }
      ],
      "input": "What's the weather today in Barcelona?",
      "inputTokens": 1842,
      "outputText": "It's currently 21°C and sunny in Barcelona with a light breeze from the south-east.",
      "outputTokens": 312,
      "role": "assistant",
      "seq": 0,
      "startedAt": "2026-05-11T09:14:22.000Z",
      "status": "completed",
      "structuredOutput": {
        "temperatureCelsius": "bar",
        "conditions": "bar"
      },
      "taskId": "tsk_2Z-YWz3hFq6VlW"
    }
  ],
  "taskId": "tsk_2Z-YWz3hFq6VlW"
}