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

# Request cleaning on a dataset

> Request a cleaning job for the specified dataset.



## OpenAPI

````yaml /api-reference/openapi.yml post /agents/{username}/{namespace}/{datasetName}/requestCleaning
openapi: 3.0.3
info:
  title: DataLinks
  version: 2.2.3
servers:
  - url: https://api.datalinks.com/api/v1
    description: production server
security:
  - bearerAuth: []
  - openId:
      - implicit
paths:
  /agents/{username}/{namespace}/{datasetName}/requestCleaning:
    post:
      tags:
        - agents
      summary: Request cleaning on a dataset
      description: Request a cleaning job for the specified dataset.
      operationId: requestCleaning
      parameters:
        - name: namespace
          in: path
          description: Namespace for the dataset.
          required: true
          schema:
            type: string
          example: cinematography
        - name: datasetName
          in: path
          description: Name of the dataset.
          required: true
          schema:
            type: string
          examples:
            movies:
              summary: Movies
              value: movies
            actors:
              summary: Actors
              value: actors
        - name: username
          in: path
          description: The username associated with the request.
          required: true
          schema:
            type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/RequestCleaningRequest'
        required: true
      responses:
        '201':
          description: Schedules a new cleaning task.
        '400':
          description: Request body is invalid or malformed JSON.
        '404':
          description: The dataset does not exist or the user cannot modify it.
        '409':
          description: >-
            A dataset with the specified name already exists in the target
            namespace.
        '422':
          $ref: '#/components/responses/UnprocessableContent'
components:
  schemas:
    RequestCleaningRequest:
      required:
        - outputDatasetName
        - outputNamespace
        - prompts
      type: object
      properties:
        prompts:
          maxItems: 10
          minItems: 1
          type: array
          description: Prompts that describe each cleaning step in the intended order.
          example:
            - Remove extra spaces from firstName and lastName fields.
            - Remove empty values from the age field.
          items:
            type: string
        outputNamespace:
          type: string
          description: Target namespace where the cleaned dataset will be created.
          example: all_about_movies
        outputDatasetName:
          type: string
          description: >-
            Specifies the name of the cleaned dataset. The service creates this
            dataset when the cleaning job starts, and the name must be unused in
            the target namespace.
          example: movies_cleaned
    ErrorResponse:
      required:
        - error_code
        - message
      type: object
      properties:
        error_code:
          type: string
          example: UNAUTHORIZED
        error_message:
          type: string
          example: ''
        message:
          type: string
          example: Missing authentication token
        sub_errors:
          type: array
          items:
            required:
              - code
              - message
            type: object
            properties:
              code:
                type: string
              message:
                type: string
  responses:
    UnprocessableContent:
      description: The request could not be processed.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
  securitySchemes:
    bearerAuth:
      type: http
      description: >
        Use a Bearer token for authentication. Submit the token using the
        `Authorization`

        header: `Authorization: Bearer <token>`.
      scheme: bearer
    openId:
      type: oauth2
      flows:
        implicit:
          authorizationUrl: >-
            https://login.datalinks.com/realms/datalinks-realm/protocol/openid-connect/auth
          scopes:
            openid: openid

````