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

# Create a task export job

> Starts an asynchronous export of a Workstation/App's tasks to CSV (default) or JSON. The job snapshots the current time: only tasks created at or before job creation are included.



## OpenAPI

````yaml POST /task/export-job
openapi: 3.0.1
info:
  title: Tela API
  license:
    name: MIT
  version: 1.0.0
servers:
  - url: https://api.tela.com
security: []
paths:
  /task/export-job:
    post:
      tags:
        - Task
      summary: Create a task export job
      description: >
        Starts an asynchronous export of a Workstation/App's tasks to CSV
        (default) or JSON. The job snapshots the current time: only tasks
        created at or before job creation are included. Poll `GET
        /task/export-job/{id}` until `status` is `completed`, then call `GET
        /task/export-job/{id}/download` for a signed URL. The generated file
        expires 24 hours after completion.


        Export jobs are scoped to the requesting identity: a job can only be
        read back by the same user (email) that created it.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/TaskExportCreateRequest'
            example:
              promptApplicationId: 95cec438-6080-44fe-8275-28b16bd40178
              filterCriteria:
                status:
                  - completed
                approvedDate:
                  - '2025-01-01T00:00:00Z'
                  - '2025-01-31T23:59:59Z'
                approvedBy:
                  - reviewer@company.com
              options:
                format: csv
                common:
                  includeMetadata: true
                csv:
                  separator: ;
                  singleCell: false
                  downloadType: combined
      responses:
        '201':
          description: Export job created
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TaskExportJob'
              example:
                id: 0d5a5f3e-2c1b-4e9a-8f7d-6a5b4c3d2e10
                status: pending
                totalTasks: 142
                processedTasks: 0
                hasFile: false
                createdAt: '2025-01-15T12:00:00.000Z'
        '400':
          description: Invalid payload
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '401':
          description: Missing or invalid API key
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '404':
          description: App not found or not accessible
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
      security:
        - bearerAuth: []
components:
  schemas:
    TaskExportCreateRequest:
      type: object
      properties:
        promptApplicationId:
          type: string
          format: uuid
        filterCriteria:
          $ref: '#/components/schemas/TaskExportFilterCriteria'
        options:
          $ref: '#/components/schemas/TaskExportOptions'
      required:
        - promptApplicationId
    TaskExportJob:
      type: object
      title: Export job
      properties:
        id:
          type: string
          format: uuid
        status:
          type: string
          description: >-
            `pending` → `processing` → `completed` | `failed`. `expired` once
            the file has been cleaned up.
          enum:
            - pending
            - processing
            - completed
            - failed
            - expired
        totalTasks:
          type: integer
          description: Number of tasks matched at creation time. Omitted when unknown.
        processedTasks:
          type: integer
        hasFile:
          type: boolean
          description: Whether an export file has been generated.
        errorMessage:
          type: string
          description: Present when `status` is `failed`.
        createdAt:
          type: string
          format: date-time
        completedAt:
          type: string
          format: date-time
        expiresAt:
          type: string
          format: date-time
          description: >-
            When the generated file stops being downloadable (24 hours after
            completion).
      required:
        - id
        - status
        - processedTasks
        - hasFile
        - createdAt
    Error: {}
    TaskExportFilterCriteria:
      type: object
      title: Export filters
      description: >-
        Date ranges are `[since, until]` tuples of ISO 8601 strings. As with
        `GET /task`, multiple date ranges are combined with OR, and
        `approvedBy`/`createdBy` are combined with OR.
      properties:
        status:
          type: array
          items:
            $ref: '#/components/schemas/TaskStatus'
        approvedDate:
          type: array
          minItems: 2
          maxItems: 2
          items:
            type: string
            format: date-time
        createdDate:
          type: array
          minItems: 2
          maxItems: 2
          items:
            type: string
            format: date-time
        updatedDate:
          type: array
          minItems: 2
          maxItems: 2
          items:
            type: string
            format: date-time
        approvedBy:
          type: array
          items:
            type: string
        createdBy:
          type: array
          items:
            type: string
        appVersion:
          type: string
          format: uuid
          description: >-
            Restrict to tasks executed with this Canvas version
            (`promptVersionId`).
        taskName:
          type: string
          description: Case-insensitive substring match on the task name.
    TaskExportOptions:
      type: object
      title: Export options
      description: >-
        Prefer the nested `common`/`csv`/`json` groups. The flat `singleCell`,
        `includeMetadata`, `separator`, `downloadType` and `columnOrder` fields
        are legacy aliases and are used only when the nested equivalent is
        absent.
      properties:
        format:
          type: string
          default: csv
          enum:
            - csv
            - json
        common:
          type: object
          properties:
            includeMetadata:
              type: boolean
              description: Include task metadata columns/fields in the export.
        csv:
          type: object
          properties:
            singleCell:
              type: boolean
              description: >-
                When `true`, array values are kept in a single cell instead of
                being expanded into rows.
            separator:
              type: string
              description: Column separator. Defaults to `,`.
            downloadType:
              type: string
              description: >-
                `combined` produces one file; `separate` produces one file per
                section bundled as a `.zip`.
              enum:
                - combined
                - separate
            columnOrder:
              type: array
              items:
                $ref: '#/components/schemas/TaskExportColumnOrderEntry'
        json:
          type: object
          description: No JSON-specific options are defined at the moment.
        singleCell:
          type: boolean
          deprecated: true
        includeMetadata:
          type: boolean
          deprecated: true
        separator:
          type: string
          deprecated: true
        downloadType:
          type: string
          deprecated: true
          enum:
            - combined
            - separate
        columnOrder:
          type: array
          deprecated: true
          items:
            $ref: '#/components/schemas/TaskExportColumnOrderEntry'
    TaskStatus:
      type: string
      description: >-
        Task lifecycle status. `created` (agent tasks awaiting execution) →
        `running` → `validating` (output ready, awaiting review) → `completed`
        (approved). `failed` and `cancelled` are terminal.
      enum:
        - created
        - running
        - validating
        - completed
        - failed
        - cancelled
    TaskExportColumnOrderEntry:
      type: object
      properties:
        key:
          type: string
          description: Column key (an output field name or a task attribute).
        included:
          type: boolean
        label:
          type: string
          description: Header label override.
      required:
        - key
        - included
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT or UUID

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.