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

# Start a dataset export

> Send field names or IDs in `fields`. Returns an export to poll for a download link. The file is a JSON array of dataset values; it does not contain pipeline run outputs.



## OpenAPI

````yaml /api-reference/openapi.json post /datasets/{datasetId}/exports
openapi: 3.1.0
info:
  description: >-
    Manage projects, datasets, labeling pipelines, and model training. **Beta:**
    endpoints, request and response shapes, and error contracts can change
    without notice or a backward-compatibility promise.
  title: Toloka Platform API
  version: 2.0.0
servers:
  - url: https://platform.toloka.ai/api/v2-beta
security:
  - apiKeyAuth: []
  - scopedTokenAuth: []
tags:
  - description: The authenticated API key owner.
    name: Account
  - description: A project is the container for pipelines, datasets, and files.
    name: Projects
  - description: Rows and typed fields. Field schemas are immutable once created.
    name: Datasets
  - description: Append rows to a dataset from a file.
    name: Dataset uploads
  - description: Read a dataset out as a file.
    name: Dataset exports
  - description: A pipeline is a graph of nodes that processes each dataset item.
    name: Pipelines
  - description: The nodes, connections, fields, and version of a pipeline graph.
    name: Pipeline graph
  - description: Execute a pipeline over a dataset and inspect each item.
    name: Runs
  - description: Per-node checks that a pipeline must pass before deployment.
    name: Checks
  - description: Named credentials available to pipeline code.
    name: Secrets
  - description: Project files available to pipeline code and labeling interfaces.
    name: Files
  - description: >-
      Global, read-only catalog of the models a synthetic generation node can
      use, with their budget bounds.
    name: Generation models
  - description: >-
      Global, read-only catalog of the expert audience: the values a node
      `audience` filter can use.
    name: Audience
  - description: >-
      Project lists of experts a node can take its workforce from with
      `audienceMode: service`. Available only to teams with the audience service
      enabled.
    name: Expert lists
  - description: >-
      Experts banned in a project: they cannot be invited and are removed from
      the work they are in. Available only to teams with expert bans enabled.
    name: Expert ban list
  - description: Global, read-only base model catalog.
    name: Base models
  - description: Project-owned mutable model-training drafts.
    name: Trainings
  - description: Project-owned Models and immutable Model Versions.
    name: Models
  - name: Batch inference
paths:
  /datasets/{datasetId}/exports:
    post:
      tags:
        - Dataset exports
      summary: Start a dataset export
      description: >-
        Send field names or IDs in `fields`. Returns an export to poll for a
        download link. The file is a JSON array of dataset values; it does not
        contain pipeline run outputs.
      operationId: createDatasetExport
      parameters:
        - in: path
          name: datasetId
          required: true
          schema:
            $ref: '#/components/schemas/DatasetId'
      requestBody:
        content:
          application/json:
            schema:
              description: Select dataset fields to export as a JSON array.
              properties:
                fields:
                  description: >-
                    Fields to include in the export, identified by field name or
                    id.
                  items:
                    type: string
                  minItems: 1
                  type: array
                format:
                  default: json-array
                  description: >-
                    Emit the selected fields as one JSON array. The default when
                    format is omitted.
                  enum:
                    - json-array
                  type: string
              required:
                - fields
              type: object
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ExportJob'
          description: Export started
          headers:
            RateLimit-Limit:
              $ref: '#/components/headers/RateLimit-Limit'
            RateLimit-Policy:
              $ref: '#/components/headers/RateLimit-Policy'
            RateLimit-Remaining:
              $ref: '#/components/headers/RateLimit-Remaining'
            RateLimit-Reset:
              $ref: '#/components/headers/RateLimit-Reset'
            X-Request-Id:
              $ref: '#/components/headers/X-Request-Id'
        '400':
          description: Unknown field name or id
          headers:
            RateLimit-Limit:
              $ref: '#/components/headers/RateLimit-Limit'
            RateLimit-Policy:
              $ref: '#/components/headers/RateLimit-Policy'
            RateLimit-Remaining:
              $ref: '#/components/headers/RateLimit-Remaining'
            RateLimit-Reset:
              $ref: '#/components/headers/RateLimit-Reset'
            X-Request-Id:
              $ref: '#/components/headers/X-Request-Id'
        '404':
          description: Dataset not found
          headers:
            RateLimit-Limit:
              $ref: '#/components/headers/RateLimit-Limit'
            RateLimit-Policy:
              $ref: '#/components/headers/RateLimit-Policy'
            RateLimit-Remaining:
              $ref: '#/components/headers/RateLimit-Remaining'
            RateLimit-Reset:
              $ref: '#/components/headers/RateLimit-Reset'
            X-Request-Id:
              $ref: '#/components/headers/X-Request-Id'
        '429':
          description: Rate limit exceeded
          headers:
            RateLimit-Limit:
              $ref: '#/components/headers/RateLimit-Limit'
            RateLimit-Policy:
              $ref: '#/components/headers/RateLimit-Policy'
            RateLimit-Remaining:
              $ref: '#/components/headers/RateLimit-Remaining'
            RateLimit-Reset:
              $ref: '#/components/headers/RateLimit-Reset'
            X-Request-Id:
              $ref: '#/components/headers/X-Request-Id'
      x-codeSamples:
        - label: TypeScript SDK
          lang: typescript
          source: |
            import { createClient } from "@toloka-platform/sdk";

            const client = createClient({
              baseUrl: "https://platform.toloka.ai",
              apiKey: process.env.TOLOKA_API_KEY!,
            });

            const exportJob = await client.datasets.startExport({
              datasetId: "ds.019a0000-0000-7000-8000-000000000001",
              fields: [
                "text"
              ]
            });
            console.log(exportJob);
components:
  schemas:
    DatasetId:
      description: Dataset ID with prefix `ds.`.
      pattern: >-
        ^ds\.[0-9a-f]{8}-[0-9a-f]{4}-[7][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$
      type: string
    ExportJob:
      description: >-
        An asynchronous dataset export job. Failed jobs include an error.
        Successful file exports include a download URL; exports prepared for
        training cost estimates include a validation report and a null download
        URL.
      properties:
        createdAt:
          description: Time the export was requested, as an ISO 8601 timestamp.
          format: date-time
          pattern: >-
            ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d:[0-5]\d(?:\.\d+)?(?:Z))$
          type: string
        datasetId:
          $ref: '#/components/schemas/DatasetId'
        error:
          anyOf:
            - properties:
                code:
                  description: >-
                    Failure category: `empty_selection` when no rows match,
                    `size_limit_exceeded` when the export is too large, or
                    `assembly_failed` when preparation fails.
                  enum:
                    - empty_selection
                    - size_limit_exceeded
                    - assembly_failed
                  type: string
                message:
                  description: Explanation of why the export failed.
                  maxLength: 500
                  minLength: 1
                  type: string
                timestamp:
                  description: Time the export failed, as an ISO 8601 timestamp.
                  format: date-time
                  pattern: >-
                    ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d:[0-5]\d(?:\.\d+)?(?:Z))$
                  type: string
              required:
                - timestamp
                - code
                - message
              type: object
            - type: 'null'
          description: Failure details, or null when the export has not failed.
        id:
          $ref: '#/components/schemas/ExportId'
        report:
          anyOf:
            - $ref: '#/components/schemas/DatasetExportReport'
            - type: 'null'
          description: >-
            Training-example validation report, or null for ordinary file
            exports or before validation finishes.
        result:
          description: Download details for the export.
          properties:
            downloadUrl:
              description: >-
                Signed file download URL, or null before completion, after
                failure, or for validation-only exports.
              type:
                - string
                - 'null'
          required:
            - downloadUrl
          type: object
        status:
          description: >-
            Export state: `running` while preparing, `succeeded` when complete,
            or `failed` after an error.
          enum:
            - running
            - succeeded
            - failed
          type: string
      required:
        - id
        - datasetId
        - status
        - createdAt
        - result
        - report
        - error
      type: object
    ExportId:
      description: Dataset export ID with prefix `dex.`.
      pattern: >-
        ^dex\.[0-9a-f]{8}-[0-9a-f]{4}-[7][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$
      type: string
    DatasetExportReport:
      additionalProperties: false
      description: >-
        Counts of rows included in or excluded from training examples, exclusion
        reasons, and token statistics.
      properties:
        errors:
          description: Sample of validation errors, up to 50 entries.
          items:
            additionalProperties: false
            properties:
              itemIndex:
                description: Index of the dataset item with a validation error.
                maximum: 9007199254740991
                minimum: 0
                type: integer
              reason:
                description: Reason the example failed validation.
                type: string
            required:
              - itemIndex
              - reason
            type: object
          maxItems: 50
          type: array
        invalidCount:
          description: Number of examples rejected during validation.
          maximum: 9007199254740991
          minimum: 0
          type: integer
        tokens:
          additionalProperties: false
          description: Token-count statistics for the valid examples.
          properties:
            estimatorVersion:
              anyOf:
                - enum:
                    - utf16-code-units-div-4-v1
                    - script-weighted-v1
                  type: string
                - type: 'null'
              description: >-
                Token estimator version used for these statistics, or null when
                unavailable.
            max:
              description: Largest token count among valid examples.
              maximum: 9007199254740991
              minimum: 0
              type: integer
            p50:
              description: Median number of tokens per valid example.
              maximum: 9007199254740991
              minimum: 0
              type: integer
            p95:
              description: 95th percentile of tokens per valid example.
              maximum: 9007199254740991
              minimum: 0
              type: integer
            total:
              anyOf:
                - maximum: 9007199254740991
                  minimum: 0
                  type: integer
                - type: 'null'
              default: null
              description: Total tokens across valid examples, or null when unavailable.
          required:
            - p50
            - p95
            - max
            - estimatorVersion
          type: object
        validCount:
          description: Number of valid training examples in the selection.
          maximum: 9007199254740991
          minimum: 0
          type: integer
      required:
        - validCount
        - invalidCount
        - errors
        - tokens
      type: object
  headers:
    RateLimit-Limit:
      description: The maximum number of requests allowed in the current window.
      schema:
        type: integer
    RateLimit-Policy:
      description: The rate limit policy (e.g., "60;w=60").
      schema:
        type: string
    RateLimit-Remaining:
      description: The number of requests remaining in the current window.
      schema:
        type: integer
    RateLimit-Reset:
      description: The number of seconds until the current window resets.
      schema:
        type: integer
    X-Request-Id:
      description: >-
        The request id: the X-Request-Id you sent when it is 1-128 characters of
        letters, digits, ".", "_" or "-", otherwise a generated UUID. Present on
        every response, including errors; quote it when reporting a problem.
      schema:
        type: string
  securitySchemes:
    apiKeyAuth:
      description: >-
        Enter `ApiKey <your-api-key>` in Authorization, including the `ApiKey `
        prefix. In cURL and Python samples, `<api-key>` means this full value.
        The TypeScript SDK adds the prefix for you.
      in: header
      name: Authorization
      type: apiKey
    scopedTokenAuth:
      description: >-
        Enter the project-scoped token as `pst_...` in X-Scoped-Token, without
        an `ApiKey ` prefix. Create a token with POST
        /projects/{projectId}/tokens.
      in: header
      name: X-Scoped-Token
      type: apiKey

````

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