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

# Create Ai Ready Slice

> Create an AI-ready data slice by tagging duplicate files as redundant.

1. Ensures the 'Data Quality Status' tag exists
2. Tags non-representative duplicate files as 'redundant', but only when
   the caller chose to exclude 'redundant' (see ``exclude_statuses``) —
   tagging is a persistent side effect and must follow the caller's
   selection rather than running unconditionally
3. Creates a data slice with condition excluding the caller's chosen
   Data Quality Status values (see ``exclude_statuses``)



## OpenAPI

````yaml /deasy-openapi.yml post /dedup/create_slice
openapi: 3.1.0
info:
  title: Collibra Unstructured API
  description: >
    REST API for Collibra Unstructured.


    ## Authentication


    Every endpoint accepts either HTTP Basic credentials, or a bearer token sent
    together with the

    `X-User-ID` header identifying the user the call runs as.


    ## Base URL


    Your Unstructured deployment, for example
    `https://unstructured.your-company.com/rest/unstructured`.
  version: 0.1.14
servers:
  - url: /rest/unstructured
security:
  - BasicAuth: []
  - BearerAuth: []
    UserIdAuth: []
tags:
  - name: Core
    description: Endpoints for core functionality
  - name: Data
    description: Endpoints for source data
  - name: Metadata
    description: Endpoints for metadata management
  - name: Tags
    description: Endpoints for tag management
  - name: Taxonomy
    description: Endpoints for taxonomy management
  - name: Dataslice
    description: Endpoints for dataslice management
  - name: Progress Tracker
    description: Endpoints for tracking progress
  - name: Classification
    description: Endpoints for classification
  - name: Ingestion
    description: Endpoints for document ingestion
  - name: Workflows
    description: Endpoints for workflow management
  - name: Projects
    description: Endpoints for project management
  - name: Versioning
    description: Endpoints for metadata versioning
  - name: Deduplication
    description: Endpoints for deduplication
paths:
  /dedup/create_slice:
    post:
      tags:
        - Deduplication
      summary: Create Ai Ready Slice
      description: |-
        Create an AI-ready data slice by tagging duplicate files as redundant.

        1. Ensures the 'Data Quality Status' tag exists
        2. Tags non-representative duplicate files as 'redundant', but only when
           the caller chose to exclude 'redundant' (see ``exclude_statuses``) —
           tagging is a persistent side effect and must follow the caller's
           selection rather than running unconditionally
        3. Creates a data slice with condition excluding the caller's chosen
           Data Quality Status values (see ``exclude_statuses``)
      operationId: create_ai_ready_slice_dedup_create_slice_post
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/DedupCreateSliceRequest'
        required: true
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema: {}
        '403':
          description: Missing token
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPError'
        '404':
          description: Resource not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPError'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
        '429':
          description: Too many requests
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPError'
        '500':
          description: >-
            Internal Server Error. An unexpected error occurred while processing
            the request.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPError'
      x-codeSamples:
        - lang: Python
          source: |
            # pip install deasy-sdk
            import os
            from deasy import DeasyClient

            client = DeasyClient(
                base_url=os.environ["UNSTRUCTURED_CLIENT_BASE_URL"],
                username=os.environ["UNSTRUCTURED_USERNAME"],
                password=os.environ["UNSTRUCTURED_PASSWORD"],
                auth_method="basic",
            )

            response = client.dedup.create_slice(
                data_connector_name="example_data_connector_name",
                slice_name="example_slice_name",
            )
            print(response)
components:
  schemas:
    DedupCreateSliceRequest:
      properties:
        data_connector_name:
          type: string
          title: Data Connector Name
        dataslice_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Dataslice Id
        slice_name:
          type: string
          title: Slice Name
        description:
          type: string
          title: Description
          default: ''
        rejected_group_ids:
          items:
            type: string
          type: array
          title: Rejected Group Ids
          default: []
        rejected_file_ids:
          items:
            type: string
          type: array
          title: Rejected File Ids
          default: []
        exclude_statuses:
          anyOf:
            - items:
                type: string
              type: array
            - type: 'null'
          title: Exclude Statuses
        require_safe:
          type: boolean
          title: Require Safe
          default: false
      type: object
      required:
        - data_connector_name
        - slice_name
      title: DedupCreateSliceRequest
    HTTPError:
      properties:
        detail:
          type: string
          title: Detail
      type: object
      required:
        - detail
      title: HTTPError
    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
  securitySchemes:
    BasicAuth:
      type: http
      scheme: basic
    BearerAuth:
      type: http
      scheme: bearer
    UserIdAuth:
      type: apiKey
      in: header
      name: X-User-ID

````