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

# Export Task To Url

`POST /tasks/{task_id}/export`

Build the task snapshot and PUT it to a caller-supplied presigned URL.

Use this when the snapshot is too large for a JSON response body (long
conversations, deep reasoning content, many attachments). The upload URL
must be https and resolve to a public address — see SSRF guard.

## Path parameters

- `task_id` string, required

## Request body

- ExportTaskToUrlRequest
  - `upload_url` string, uri, required — Presigned PUT URL where Agentex will upload the task snapshot as JSON. Must be https; must resolve to a public address.

## Response `200`

Successful Response

- ExportTaskToUrlResponse
  - `task_id` string, required
  - `upload_url` string, required
  - `uploaded_bytes` integer, required
  - `messages_count` integer, required
  - `task_states_count` integer, required

## Other responses

- `422` — Validation Error

## Changes

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

- **2026-05-29** `12a516f4d9ac` — 1 info
  - endpoint added

[Change history](https://skmtc.dev/scaleapi/apis/agentex-api/changes/tasks/:task_id/export/post.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)
