---
title: "Export Task"
method: GET
path: "/tasks/{task_id}/export"
tags: ["task-retention"]
---

# Export Task

`GET /tasks/{task_id}/export`

Build a self-contained snapshot of a task's content surfaces.

Returns the exact payload format that POST /rehydrate accepts, so
export → clean → rehydrate is a round-trip-equivalent operation.

## Path parameters

- `task_id` string, required

## Response `200`

Successful Response

- ExportTaskResponse — Wire format mirrors the entity directly — schema parity is intentional.
  - `task_id` string, required
  - `messages` TaskMessageEntity[]
    - `id` string, nullable — The task message's unique id
    - `task_id` string, required — ID of the task this message belongs to
    - `content` union, required — The content of the message. This content is not OpenAI compatible. These are messages that are meant to be displayed to the user.
      - TextContentEntity
        - `type` 'text' — The type of the message, in this case `text`.
        - `author` 'user' | 'agent', required
        - `style` 'static' | 'active'
        - `format` 'markdown' | 'plain' | 'code'
        - `content` string, required — The contents of the text message.
        - `attachments` FileAttachmentEntity[], nullable — Optional list of file attachments with structured metadata.
          - `file_id` string, required — The unique ID of the attached file
          - `name` string, required — The name of the file
          - `size` integer, required — The size of the file in bytes
          - `type` string, required — The MIME type or content type of the file
      - DataContentEntity
        - `type` 'data' — The type of the message, in this case `data`.
        - `author` 'user' | 'agent', required
        - `style` 'static' | 'active'
        - `data` object, required — The contents of the data message.
      - ToolRequestContentEntity
        - `type` 'tool_request' — The type of the message, in this case `tool_request`.
        - `author` 'user' | 'agent', required
        - `style` 'static' | 'active'
        - `tool_call_id` string, required — The ID of the tool call that is being requested.
        - `name` string, required — The name of the tool that is being requested.
        - `arguments` object, required — The arguments to the tool.
      - ToolResponseContentEntity
        - `type` 'tool_response' — The type of the message, in this case `tool_response`.
        - `author` 'user' | 'agent', required
        - `style` 'static' | 'active'
        - `tool_call_id` string, required — The ID of the tool call that is being responded to.
        - `name` string, required — The name of the tool that is being responded to.
        - `content` unknown, required
        - `is_error` boolean, nullable — Whether the tool call resulted in an error. `None` when the harness does not report a status.
      - ReasoningContentEntity
        - `type` 'reasoning' — The type of the message, in this case `reasoning`.
        - `author` 'user' | 'agent', required
        - `style` 'static' | 'active'
        - `summary` string[], required — A list of short reasoning summaries
        - `content` string[], nullable — The reasoning content or chain-of-thought text
    - `streaming_status` 'IN_PROGRESS' | 'DONE', nullable
    - `created_at` string, date-time, nullable — The timestamp when the message was created
    - `updated_at` string, date-time, nullable — The timestamp when the message was last updated
  - `task_states` StateEntity[]
    - `id` string, nullable — The task state's unique id
    - `task_id` string, required — ID of the task this state belongs to. The combination of task_id and agent_id is globally unique.
    - `agent_id` string, required — ID of the agent this state belongs to. The combination of task_id and agent_id is globally unique.
    - `state` object, required — The state object that contains arbitrary data
    - `created_at` string, date-time, nullable — The timestamp when the state was created
    - `updated_at` string, date-time, nullable — The timestamp when the state was last updated

## Other responses

- `422` — Validation Error

## Changes

> 55 revisions in range; 4 could not be searched.

- **2026-07-10** `fbecbdbd7dc5` — 1 info
  - added the optional property `messages/items/content/oneOf[subschema #4: ToolResponseContentEntity]/is_error` to the response with the `200` status
- **2026-06-23** `94d73d46952b` — 1 warning
  - removed the optional property `messages/items/content/oneOf[subschema #4: ToolResponseContentEntity]/is_error` from the response with the `200` status
- **2026-06-22** `28b893025743` — 1 info
  - added the optional property `messages/items/content/oneOf[subschema #4: ToolResponseContentEntity]/is_error` to the response with the `200` status
- **2026-05-29** `12a516f4d9ac` — 1 info
  - endpoint added

[Change history](https://skmtc.dev/scaleapi/apis/agentex-api/changes/tasks/:task_id/export/get.md)

---

[API](https://skmtc.dev/scaleapi/apis/agentex-api.md) · [All operations](https://skmtc.dev/scaleapi/apis/agentex-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/scaleapi/agentex-api/revisions/1e0aaafd5780/schema)
