---
title: "Get a task with its questions, approvals and artifacts"
url: https://hexelstudio.com/docs/api/harness/tasks/get
---

# Get a task with its questions, approvals and artifacts

**GET** `/harness/tasks/{id}`

## Headers

- `Authorization: string`

  `Bearer <token>`. A Hexel Studio access token for your organization.

- `X-Workspace-Id: string`

  The workspace the request acts in (`ws_...`). It never grants access by itself.

- `X-Environment-Id: string`

  The environment the request acts in (`env_...`). It never grants access by itself.

## Returns

`200` The task and its details. (`TaskDetails`)

- `task: Task`

  - `agent: string`

  - `agent_id: string`

  - `budget: any`

    Any JSON value.

  - `bundle_digest: string`

  - `cost_usd: number`

  - `created_at: string`

  - `created_by: string`

  - `end_reason: optional string`

  - `environment_id: string`

  - `erased_at: optional string`

  - `goal: string`

  - `goal_digest: optional string`

  - `held_at: optional string`

  - `id: string`

  - `inputs: any`

    Any JSON value.

  - `inputs_digest: optional string`

  - `last_seq: integer`

  - `org_id: string`

  - `outputs: optional object`

    - `text: optional string`

      The agent's last message.

    - `result: optional any`

      The structured result, when the agent gave one.

  - `run_id: string`

  - `sandbox_template: optional string`

  - `state: string`

    One of: `"queued"`, `"running"`, `"waiting"`, `"paused"`, `"succeeded"`, `"failed"`, `"budget_exhausted"`, `"cancelled"`

  - `swarm_id: optional string`

  - `tokens_in: integer`

  - `tokens_out: integer`

  - `updated_at: string`

  - `version: integer`

  - `waiting_reason: optional string`

  - `workspace_id: string`

- `questions: array of Question`

  - `answer: optional any`

    Any JSON value.

  - `answer_digest: optional string`

  - `answered_by: optional string`

  - `created_at: string`

  - `id: string`

  - `options: optional any`

    Any JSON value.

  - `options_digest: optional string`

  - `prompt: string`

  - `prompt_digest: optional string`

  - `run_id: string`

  - `task_id: string`

- `approvals: array of Approval`

  - `call_id: optional string`

  - `capability: optional string`

  - `created_at: string`

  - `id: string`

  - `run_id: string`

  - `status: string`

  - `task_id: string`

  - `tool: optional string`

- `artifacts: array of Artifact`

  - `content_type: optional string`

  - `created_at: string`

  - `id: string`

  - `name: string`

  - `name_digest: optional string`

  - `object_ref: string`

  - `run_id: string`

  - `size: optional integer`

  - `task_id: string`

- `chain: optional ChainView`

  - `after: optional array of string`

  - `checkin: optional object`

    - `every_s: integer`

  - `inputs_from: optional map[string]`

- `fork: optional object`

  The run and step this task was forked from.

## Errors

- `default` 

## Example

```bash
curl --request GET \
  --url 'https://api.hexelstudio.com/v1/harness/tasks/{id}' \
  --header "Authorization: Bearer $ACCESS_TOKEN" \
  --header 'X-Workspace-Id: X_WORKSPACE_ID' \
  --header 'X-Environment-Id: X_ENVIRONMENT_ID'
```

### Response (200)

```json
{
  "task": {
    "agent": "string",
    "agent_id": "string",
    "budget": "string",
    "bundle_digest": "string",
    "cost_usd": 0,
    "created_at": "2026-01-01T00:00:00Z",
    "created_by": "string",
    "end_reason": "string",
    "environment_id": "string",
    "erased_at": "2026-01-01T00:00:00Z",
    "goal": "string",
    "goal_digest": "string",
    "held_at": "2026-01-01T00:00:00Z",
    "id": "string",
    "inputs": "string",
    "inputs_digest": "string",
    "last_seq": 0,
    "org_id": "string",
    "outputs": {
      "text": "string",
      "result": "string"
    },
    "run_id": "string",
    "sandbox_template": "string",
    "state": "queued",
    "swarm_id": "string",
    "tokens_in": 0,
    "tokens_out": 0,
    "updated_at": "2026-01-01T00:00:00Z",
    "version": 0,
    "waiting_reason": "string",
    "workspace_id": "string"
  },
  "questions": [
    {
      "answer": "string",
      "answer_digest": "string",
      "answered_by": "string",
      "created_at": "2026-01-01T00:00:00Z",
      "id": "string",
      "options": "string",
      "options_digest": "string",
      "prompt": "string",
      "prompt_digest": "string",
      "run_id": "string",
      "task_id": "string"
    }
  ],
  "approvals": [
    {
      "call_id": "string",
      "capability": "string",
      "created_at": "2026-01-01T00:00:00Z",
      "id": "string",
      "run_id": "string",
      "status": "string",
      "task_id": "string",
      "tool": "string"
    }
  ],
  "artifacts": [
    {
      "content_type": "string",
      "created_at": "2026-01-01T00:00:00Z",
      "id": "string",
      "name": "string",
      "name_digest": "string",
      "object_ref": "string",
      "run_id": "string",
      "size": 0,
      "task_id": "string"
    }
  ],
  "chain": {
    "after": [
      "string"
    ],
    "checkin": {
      "every_s": 0
    },
    "inputs_from": {
      "key": "string"
    }
  },
  "fork": {}
}
```
