> ## 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.

# Export

> Export dataslice metadata and/or nodes to a configured destination.

This endpoint supports exporting data from a dataslice or data connector to a destination 
system. For small datasets (fewer than 100 files), the export runs synchronously. For larger 
datasets, the export is processed in the background and returns a tracker ID for monitoring progress.

## Request Body

| Field                      | Type                       | Required | Description                                                                                       |
|----------------------------|----------------------------|----------|---------------------------------------------------------------------------------------------------|
| `dataslice_id`             | `str`                      | No       | The ID of the dataslice to export. Required if `datasource_id` is not provided.                  |
| `datasource_id`            | `UUID`                     | No       | The id of the data connector to export from. Required if `dataslice_id` is not provided.         |
| `destination_id`           | `UUID`                     | Yes      | The id of the configured destination to export to.                                                |
| `export_tag_ids`           | `List[str]`                | No       | Ids of the tags to export. If empty, all tags are exported.                                      |
| `export_level`             | `ExportLevel`              | No       | Level of export: `"file"`, `"chunk"`, or `"both"` (default: `"both"`).                          |
| `export_nodes`             | `bool`                     | No       | Whether to export node data (default: `true`).                                                    |
| `export_metadata`          | `bool`                     | No       | Whether to export metadata (default: `true`).                                                     |
| `copy_originals`           | `bool`                     | No       | Databricks only: copy original file bytes into the UC Volume (default: `false`).                 |
| `metadata_format`          | `MetadataStorageFormat`    | No       | Format for metadata storage: `"column_store"` or `"json_store"`.                                |

## Response

- **200**: Export completed or initiated successfully
    - Returns: `ExportDatasliceDestinationResponse` with:
        - `message`: Status message
        - `success`: Number of successfully exported items
        - `failed`: Number of failed exports
        - `failed_items`: List of items that failed to export
        - `failed_tags`: List of tags that failed to export (if applicable)
        - `tracker_id`: Progress tracker ID for background exports (only for large datasets)
- **400**: Bad Request (e.g., missing required parameters)
- **500**: Internal Server Error

## Example Request

```json
{
  "dataslice_id": "550e8400-e29b-41d4-a716-446655440000",
  "destination_id": "9a1e3c5b-7d2f-4b6a-8e0c-3f5d7b9a1c2e",
  "export_tag_ids": ["2d9b1f4e-8c3a-4e7b-a1d6-5f0c9e2b7a48"],
  "export_level": "both",
  "export_nodes": true,
  "export_metadata": true,
  "metadata_format": "column_store"
}
```

## Example Response (Synchronous)

```json
{
  "message": "Export completed successfully",
  "success": 45,
  "failed": 0,
  "failed_items": [],
  "failed_tags": null,
  "tracker_id": null
}
```

## Example Response (Background Processing)

```json
{
  "message": "Export started in background. Use tracker_id to monitor progress.",
  "success": 0,
  "failed": 0,
  "failed_items": [],
  "failed_tags": null,
  "tracker_id": "export-12345678-90ab-cdef-1234-567890abcdef"
}
```



## OpenAPI

````yaml /deasy-openapi.yml post /dataslice/export/metadata/destination
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: Deduplication
    description: Endpoints for deduplication
paths:
  /dataslice/export/metadata/destination:
    post:
      tags:
        - Destinations
      summary: Export
      description: >-
        Export dataslice metadata and/or nodes to a configured destination.


        This endpoint supports exporting data from a dataslice or data connector
        to a destination 

        system. For small datasets (fewer than 100 files), the export runs
        synchronously. For larger 

        datasets, the export is processed in the background and returns a
        tracker ID for monitoring progress.


        ## Request Body


        | Field                      | Type                       | Required |
        Description                                                                                      
        |

        |----------------------------|----------------------------|----------|---------------------------------------------------------------------------------------------------|

        | `dataslice_id`             | `str`                      | No       |
        The ID of the dataslice to export. Required if `datasource_id` is not
        provided.                  |

        | `datasource_id`            | `UUID`                     | No       |
        The id of the data connector to export from. Required if `dataslice_id`
        is not provided.         |

        | `destination_id`           | `UUID`                     | Yes      |
        The id of the configured destination to export
        to.                                                |

        | `export_tag_ids`           | `List[str]`                | No       |
        Ids of the tags to export. If empty, all tags are
        exported.                                      |

        | `export_level`             | `ExportLevel`              | No       |
        Level of export: `"file"`, `"chunk"`, or `"both"` (default:
        `"both"`).                          |

        | `export_nodes`             | `bool`                     | No       |
        Whether to export node data (default:
        `true`).                                                    |

        | `export_metadata`          | `bool`                     | No       |
        Whether to export metadata (default:
        `true`).                                                     |

        | `copy_originals`           | `bool`                     | No       |
        Databricks only: copy original file bytes into the UC Volume (default:
        `false`).                 |

        | `metadata_format`          | `MetadataStorageFormat`    | No       |
        Format for metadata storage: `"column_store"` or
        `"json_store"`.                                |


        ## Response


        - **200**: Export completed or initiated successfully
            - Returns: `ExportDatasliceDestinationResponse` with:
                - `message`: Status message
                - `success`: Number of successfully exported items
                - `failed`: Number of failed exports
                - `failed_items`: List of items that failed to export
                - `failed_tags`: List of tags that failed to export (if applicable)
                - `tracker_id`: Progress tracker ID for background exports (only for large datasets)
        - **400**: Bad Request (e.g., missing required parameters)

        - **500**: Internal Server Error


        ## Example Request


        ```json

        {
          "dataslice_id": "550e8400-e29b-41d4-a716-446655440000",
          "destination_id": "9a1e3c5b-7d2f-4b6a-8e0c-3f5d7b9a1c2e",
          "export_tag_ids": ["2d9b1f4e-8c3a-4e7b-a1d6-5f0c9e2b7a48"],
          "export_level": "both",
          "export_nodes": true,
          "export_metadata": true,
          "metadata_format": "column_store"
        }

        ```


        ## Example Response (Synchronous)


        ```json

        {
          "message": "Export completed successfully",
          "success": 45,
          "failed": 0,
          "failed_items": [],
          "failed_tags": null,
          "tracker_id": null
        }

        ```


        ## Example Response (Background Processing)


        ```json

        {
          "message": "Export started in background. Use tracker_id to monitor progress.",
          "success": 0,
          "failed": 0,
          "failed_items": [],
          "failed_tags": null,
          "tracker_id": "export-12345678-90ab-cdef-1234-567890abcdef"
        }

        ```
      operationId: export_destination_route_dataslice_export_metadata_destination_post
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ExportDatasliceDestinationRequest'
        required: true
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ExportDatasliceDestinationResponse'
        '400':
          description: >-
            Invalid request: missing dataslice_id/datasource_id, an unresolvable
            or inaccessible source/destination connector, a destination that
            doesn't support the requested node/metadata export capability, or a
            dataslice identifier that can't be sanitized into a valid Unity
            Catalog identifier (Databricks only).
        '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'
        '409':
          description: >-
            Another export is already in progress for this destination's table
            (a genuine Delta or BigQuery write conflict) -- retry.
        '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"],
            )

            response = client.destination.export(
                destination_name="example_destination_name",
            )
            print(response.message)
components:
  schemas:
    ExportDatasliceDestinationRequest:
      properties:
        dataslice_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Dataslice Id
        datasource_id:
          anyOf:
            - type: string
              format: uuid
            - type: 'null'
          title: Datasource Id
        destination_id:
          type: string
          format: uuid
          title: Destination Id
        job_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Job Id
        export_tag_ids:
          items:
            type: string
          type: array
          title: Export Tag Ids
          default: []
        export_level:
          $ref: '#/components/schemas/ExportLevel'
          default: both
        export_nodes:
          type: boolean
          title: Export Nodes
          default: true
        export_metadata:
          type: boolean
          title: Export Metadata
          default: true
        copy_originals:
          type: boolean
          title: Copy Originals
          default: false
        metadata_format:
          anyOf:
            - $ref: '#/components/schemas/MetadataStorageFormat'
            - type: 'null'
        apply_purview_labels:
          type: boolean
          title: Apply Purview Labels
          default: false
      type: object
      required:
        - destination_id
      title: ExportDatasliceDestinationRequest
    ExportDatasliceDestinationResponse:
      properties:
        message:
          type: string
          title: Message
        success:
          type: integer
          title: Success
        failed:
          type: integer
          title: Failed
        failed_items:
          items:
            type: string
          type: array
          title: Failed Items
        failed_tags:
          anyOf:
            - items:
                type: string
              type: array
            - type: 'null'
          title: Failed Tags
        tracker_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Tracker Id
      type: object
      required:
        - message
        - success
        - failed
        - failed_items
      title: ExportDatasliceDestinationResponse
    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
    ExportLevel:
      type: string
      enum:
        - file
        - chunk
        - both
      title: ExportLevel
    MetadataStorageFormat:
      type: string
      enum:
        - column_store
        - json_store
      title: MetadataStorageFormat
    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

````

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