> ## Documentation Index
> Fetch the complete documentation index at: https://docs.gp.scale.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Export Task To Url

> 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.



## OpenAPI

````yaml https://agentex.dev-sgp.scale.com/openapi.json post /tasks/{task_id}/export
openapi: 3.1.0
info:
  title: Agentex API
  version: 0.1.0
servers: []
security: []
paths:
  /tasks/{task_id}/export:
    post:
      tags:
        - task-retention
      summary: Export Task To Url
      description: |-
        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.
      operationId: export_task_to_url_tasks__task_id__export_post
      parameters:
        - name: task_id
          in: path
          required: true
          schema:
            type: string
            title: Task Id
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ExportTaskToUrlRequest'
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ExportTaskToUrlResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
components:
  schemas:
    ExportTaskToUrlRequest:
      properties:
        upload_url:
          type: string
          maxLength: 2083
          minLength: 1
          format: uri
          title: Upload Url
          description: >-
            Presigned PUT URL where Agentex will upload the task snapshot as
            JSON. Must be https; must resolve to a public address.
      type: object
      required:
        - upload_url
      title: ExportTaskToUrlRequest
    ExportTaskToUrlResponse:
      properties:
        task_id:
          type: string
          title: Task Id
        upload_url:
          type: string
          title: Upload Url
        uploaded_bytes:
          type: integer
          title: Uploaded Bytes
        messages_count:
          type: integer
          title: Messages Count
        task_states_count:
          type: integer
          title: Task States Count
      type: object
      required:
        - task_id
        - upload_url
        - uploaded_bytes
        - messages_count
        - task_states_count
      title: ExportTaskToUrlResponse
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
        input:
          title: Input
        ctx:
          type: object
          title: Context
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError

````