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

# Post apidatasets versions preprocess

> POST /datasets/{datasetId}/versions/{versionId}/preprocess —
enqueue a preprocessing job.

Allowed source states: UPLOADED, PREPROCESSING_FAILED. Anything
else returns 409. On success, returns 202 with the queued job;
poll the version status endpoint to follow the QUEUED → RUNNING
→ SUCCEEDED|FAILED transitions.



## OpenAPI

````yaml /api-reference/openapi.yaml post /api/datasets/{dataset_pk}/versions/{version_pk}/preprocess/
openapi: 3.0.3
info:
  title: Console API
  version: 1.0.0
  description: Central control plane API for the Dataerai platform.
servers:
  - url: https://{server}
    description: Your Dataerai deployment (the API is served under /api)
    variables:
      server:
        default: your-deployment.dataerai.com
        description: Host of your Dataerai deployment
security: []
paths:
  /api/datasets/{dataset_pk}/versions/{version_pk}/preprocess/:
    post:
      tags:
        - api
      description: |-
        POST /datasets/{datasetId}/versions/{versionId}/preprocess —
        enqueue a preprocessing job.

        Allowed source states: UPLOADED, PREPROCESSING_FAILED. Anything
        else returns 409. On success, returns 202 with the queued job;
        poll the version status endpoint to follow the QUEUED → RUNNING
        → SUCCEEDED|FAILED transitions.
      operationId: api_datasets_versions_preprocess_create
      parameters:
        - in: path
          name: dataset_pk
          schema:
            type: string
            format: uuid
          required: true
        - in: path
          name: version_pk
          schema:
            type: string
            format: uuid
          required: true
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PreprocessRequest'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/PreprocessRequest'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/PreprocessRequest'
      responses:
        '202':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PreprocessingJob'
          description: ''
      security:
        - cookieAuthCsrfExempt: []
components:
  schemas:
    PreprocessRequest:
      type: object
      description: |-
        POST /datasets/.../preprocess — open-shape preprocessing parameters.

        The schema of ``parameters`` is open-shape JSON: each preprocessing
        module owns and validates the shape of its own parameters.

        Two layered size caps apply; requests exceeding either cap are
        rejected with 400:

        - ``PARAMETERS_MAX_BYTES`` caps the encoded JSON of ``parameters``
          as a whole — a guard against runaway payloads.
        - ``MAX_RAW_TEXT_BYTES`` caps the ``raw_text`` carrier
          specifically. The tabular module reads file contents from
          ``parameters['raw_text']``, so this cap applies at much larger
          sizes than the general parameters cap. Tunable via the
          ``DATAERAI_MAX_RAW_TEXT_BYTES`` env var for self-hosted
          deployments (e.g. to let dev fixtures override the default).
      properties:
        parameters: {}
    PreprocessingJob:
      type: object
      properties:
        id:
          type: string
          format: uuid
          readOnly: true
        status:
          allOf:
            - $ref: '#/components/schemas/PreprocessingJobStatusEnum'
          readOnly: true
        job_runner_id:
          type: string
          readOnly: true
        queued_at:
          type: string
          format: date-time
          readOnly: true
        started_at:
          type: string
          format: date-time
          readOnly: true
          nullable: true
        completed_at:
          type: string
          format: date-time
          readOnly: true
          nullable: true
        parameters:
          readOnly: true
      required:
        - completed_at
        - id
        - job_runner_id
        - parameters
        - queued_at
        - started_at
        - status
    PreprocessingJobStatusEnum:
      enum:
        - QUEUED
        - RUNNING
        - SUCCEEDED
        - FAILED
        - CANCELLED
      type: string
      description: |-
        * `QUEUED` - Queued
        * `RUNNING` - Running
        * `SUCCEEDED` - Succeeded
        * `FAILED` - Failed
        * `CANCELLED` - Cancelled

````