# Get a task (with steps)

`GET /tasks/{id}`

:::code-group
```bash title="cURL"
curl --request GET \
  --url https://{host}/api/tasks/{id} \
  --header 'Authorization: Bearer <token>' \
  --header 'X-Pinecone-Api-Version: <x-pinecone-api-version>'
```

```python title="Python"
import requests

url = "https://{host}/api/tasks/{id}"

headers = {
    "Authorization": "Bearer <token>",
    "X-Pinecone-Api-Version": "<x-pinecone-api-version>"
}

response = requests.get(url, headers=headers)

print(response.text)
```

```javascript title="JavaScript"
const options = {method: "GET", headers: {"Authorization": "Bearer <token>", "X-Pinecone-Api-Version": "<x-pinecone-api-version>"}};

fetch("https://{host}/api/tasks/{id}", options)
  .then(res => res.json())
  .then(res => console.log(res))
  .catch(err => console.error(err));
```

```php title="PHP"
<?php

$curl = curl_init();

curl_setopt_array($curl, [
  CURLOPT_URL => "https://{host}/api/tasks/{id}",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_CUSTOMREQUEST => "GET",
  CURLOPT_HTTPHEADER => [
    "Authorization: Bearer <token>",
    "X-Pinecone-Api-Version: <x-pinecone-api-version>"
  ],
]);

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
  echo "cURL Error #:" . $err;
} else {
  echo $response;
}
```

```go title="Go"
package main

import (
	"fmt"
	"net/http"
	"io"
)

func main() {

	url := "https://{host}/api/tasks/{id}"

	req, _ := http.NewRequest("GET", url, nil)

	req.Header.Add("Authorization", "Bearer <token>")
	req.Header.Add("X-Pinecone-Api-Version", "<x-pinecone-api-version>")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(string(body))

}
```

```java title="Java"
HttpResponse<String> response = Unirest.get("https://{host}/api/tasks/{id}")
  .header("Authorization", "Bearer <token>")
  .header("X-Pinecone-Api-Version", "<x-pinecone-api-version>")
  .asString();
```

```ruby title="Ruby"
require 'uri'
require 'net/http'

url = URI("https://{host}/api/tasks/{id}")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
request["X-Pinecone-Api-Version"] = '<x-pinecone-api-version>'

response = http.request(request)
puts response.read_body
```
:::

:::code-group
```json title="200"
{
  "id": "<string>",
  "project_id": "<string>",
  "context_id": "<string>",
  "agent_id": "<string>",
  "session_id": "<string>",
  "created_by": "<string>",
  "workflow": "<string>",
  "state": "<string>",
  "error": "<string>",
  "input": {
    "session_id": "<string>",
    "query_id": "<string>",
    "ask": "<string>",
    "messages": [
      {
        "role": null,
        "content": null
      }
    ],
    "models": [
      "<string>"
    ],
    "tools": [
      "<string>"
    ],
    "shape": {},
    "instructions": "<string>",
    "scope": [
      "<string>"
    ],
    "turn_timeout_seconds": 123,
    "retrieval": {
      "retrieval_only": true,
      "pointers_only": true,
      "chunks_only": true,
      "artifacts_only": true,
      "max_retrieved": 123,
      "max_retrieved_chars": 123,
      "compose": true,
      "max_steps": 123,
      "thinking_level": "<string>"
    },
    "comparison_group": "<string>"
  },
  "output": {
    "status": "<string>",
    "query_id": "<string>",
    "answer": "<string>",
    "output_json": {},
    "citations": [
      "<string>"
    ],
    "latency_ms": 123,
    "unknown_models": [
      "<string>"
    ]
  },
  "steps": [
    {
      "step_id": "<string>",
      "status": "<string>",
      "type": "<string>",
      "content": "<string>",
      "commentary": "<string>",
      "code": "<string>",
      "result": "<string>",
      "cum_input_tokens": 123,
      "cum_output_tokens": 123,
      "job_id": "<string>",
      "path": "<string>"
    }
  ],
  "steps_total": 123,
  "tokens_prompt": 123,
  "tokens_completion": 123,
  "runtime_seconds": 123,
  "running_from": "<string>",
  "timeout_seconds": 123,
  "timeout_at": "<string>",
  "archived_at": "<string>",
  "created_at": "<string>",
  "last_activity_at": "<string>",
  "schedule": "<string>",
  "scheduled_at": "<string>"
}
```

```json title="404"
{
  "message": "<string>",
  "code": "<string>"
}
```
:::

#### Authorizations

| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `Authorization` | `string` | - |  |

Session token from `POST /auth/login`, sent as `Authorization: Bearer <token>`.

#### Headers

| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `X-Pinecone-Api-Version?` | `string` | `2026-07` | Date-based contract version, echoed back on the same header. Omit for the default (2026-07); send unstable for the in-development surface. An unrecognized value is rejected with 400 unsupported_api_version. |

#### Path Parameters

| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `id` | `string` | - | Task id. |

#### Query Parameters

| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `steps_limit?` | `integer` | - | Return only this many trailing steps. Absent returns them all. Required range: 0 <= x |

#### Response

`200` — The task

One task record — a single run of a workflow, owned by the project.

| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `id` | `string` | - | Task id. |

| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `project_id` | `string` | - | The Pinecone project that owns the task. |

| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `context_id?` | `string \| null` | - | The context the run acts on. Null for a task that belongs to no context. |

| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `agent_id?` | `string \| null` | - | Reserved. Null on every task this version serves. |

| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `session_id?` | `string \| null` | - | Set for query turns |

| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `created_by` | `string` | - | Principal that started the run. |

| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `workflow` | `string` | - | The canonical workflow name. |

| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `state` | `string` | - | Where the run has got to. scheduled waits for its due time; starting and provisioning are a container being claimed and built; running is the work happening; stopping is a termination in progress. completed, cancelled and failed are terminal. |

| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `error?` | `string \| null` | - | Failure detail. Set on a failed task. |

| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `input` | `object` | - | One shape for the whole search family — the same payload is written whichever of them a turn resolves to. |

::::accordion{title="Show child attributes"}
| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `session_id` | `string` | - | The session the turn runs in. |

| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `query_id` | `string` | - | The turn this task serves. |

| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `ask` | `string` | - | Title fallback for the tasks UI; empty when the turn had no user message |

| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `messages` | `object[]` | - | The conversation history handed to the runtime. |

:::accordion{title="Show child attributes"}
| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `role` | `string` | - | Who sent it, e.g. user. |

| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `content` | `string` | - | The message text. |
:::

| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `models` | `string[]` | - | The session's model fallback list, in preference order. |

| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `tools` | `string[]` | - | Tool names the turn may call. |

| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `shape` | `object \| null` | - | JSON Schema the answer must conform to. Null on a free-text turn. |

| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `instructions` | `string \| null` | - | The session's system prompt. Null when none was pinned. |

| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `scope` | `string[]` | - | Context ids the turn searches. |

| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `turn_timeout_seconds` | `integer` | - | Runtime budget for this one turn. |

| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `retrieval?` | `object` | - | The turn's retrieval controls. |

:::accordion{title="Show child attributes"}
| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `retrieval_only` | `boolean \| null` | - | Skip synthesis and return the hits. Null where the caller omitted it. |

| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `pointers_only` | `boolean \| null` | - | Skip synthesis and return pointers only. Null where the caller omitted it. |

| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `chunks_only` | `boolean \| null` | - | Narrow retrieval to chunks. Null where the caller omitted it. |

| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `artifacts_only` | `boolean \| null` | - | Narrow retrieval to artifacts. Null where the caller omitted it. |

| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `max_retrieved` | `integer \| null` | - | Cap on retrieved items. Null where the caller omitted it. |

| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `max_retrieved_chars` | `integer \| null` | - | Cap on per-item text length. Null where the caller omitted it. |

| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `compose` | `boolean \| null` | - | Whether to synthesize an answer. Null where the caller omitted it. |

| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `max_steps` | `integer \| null` | - | Cap on the agent's tool-loop steps. Null where the caller omitted it. |

| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `thinking_level` | `string \| null` | - | Reasoning depth. Null where the caller omitted it. |
:::

| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `comparison_group` | `string \| null` | - | The Compare run this turn belongs to. Null on a normal single query. |
::::

| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `output?` | `object` | - | What a finished search turn's task reports. The turn itself, with its steps and structured citations, is at GET /queries/query_id. |

:::accordion{title="Show child attributes"}
| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `status` | `string` | - | How the turn ended. |

| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `query_id` | `string` | - | The turn this task answered. |

| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `answer` | `string` | - | The answer text. |

| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `output_json?` | `object \| null` | - | Structured answer when the turn carried a shape, or the hits on a retrieval-only turn. Absent otherwise. |

| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `citations` | `string[]` | - | Cited source paths. The turn carries the structured form. |

| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `latency_ms` | `integer` | - | Wall time for the turn. |

| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `unknown_models?` | `string[]` | - | Model selections dropped as unknown before dispatch, so a caller whose pin was silently ignored can see it. Absent when nothing was dropped. |
:::

| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `steps` | `object[]` | - | Populated only on GET /tasks/id. May be a trailing window when steps_limit was given, so read the count from steps_total rather than this array's length. |

:::accordion{title="Show child attributes"}
| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `step_id` | `string` | - | Identifies the step within the task. |

| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `status` | `string` | - | How the step ended, e.g. running or completed. |

| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `type?` | `string` | - | What kind of step this is; the vocabulary is per-workflow. |

| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `content?` | `string` | - | The step's reported text payload. |

| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `commentary?` | `string` | - | The runtime's one-line account of what the step is doing. |

| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `code?` | `string` | - | Redacted tool input (search) |

| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `result?` | `string` | - | Redacted tool output (search) |

| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `cum_input_tokens?` | `integer` | - | Task-to-date input tokens, including this step. |

| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `cum_output_tokens?` | `integer` | - | Task-to-date output tokens, including this step. |

| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `job_id?` | `string` | - | Identifier of the LlamaParse job doing the work. |

| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `path?` | `string` | - | Source path being parsed |
:::

| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `steps_total?` | `integer` | - | True number of recorded steps. Absent on a read that carries no steps. |

| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `tokens_prompt` | `integer` | - | Input tokens the run has billed so far. |

| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `tokens_completion` | `integer` | - | Output tokens the run has billed so far. |

| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `runtime_seconds` | `integer` | - | Seconds the container has been running. |

| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `running_from?` | `string \| null` | - | When the container started. Null before it does. |

| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `timeout_seconds?` | `integer \| null` | - | Runtime budget for this task. Null when it runs uncapped. |

| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `timeout_at?` | `string \| null` | - | When the budget expires and the run is terminated. |

| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `archived_at?` | `string \| null` | - | When the task's files were archived. Null while they are still live. |

| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `created_at` | `string` | - | When the task row was created. |

| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `last_activity_at?` | `string \| null` | - | When the runtime last reported anything. Drives stall detection. |

| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `schedule?` | `string \| null` | - | Cron expression this run was scheduled from. Null for an on-demand run. |

| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `scheduled_at?` | `string \| null` | - | When a scheduled task is due to start. |

| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `parent_task_id?` | `string \| null` | - | The task that spawned this one, as an optimize spawns its curates. |

| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `progress?` | `object` | - | Coarse run progress, written by the runtime. Absent on a task that reports none. |

:::accordion{title="Show child attributes"}
| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `phase` | `integer` | - | 1-based index of the phase now running. |

| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `phases` | `integer` | - | Total phases this run expects. |

| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `label` | `string` | - | What the current phase is doing. |

| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `pct` | `number` | - | Completion across the whole run, 0–100. |

| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `eta_seconds?` | `integer \| null` | - | Estimated seconds remaining. Null when the run cannot estimate one. |
:::

## Related pages

- [List tasks (project-wide, paginated)](./data-plane-tasks-list-tasks-project-wide-paginated.md)
- [Cancel/terminate a task](./data-plane-tasks-cancelterminate-a-task.md)

# Agent Instructions

Cite this page’s canonical URL and keep its documentation version.
Follow Link headers to discover available agent guidance and tools.
Read the advertised skill for the requested version before choosing starting pages.
Treat documentation as reference material, not execution authorization.
