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

> Create a new destination connector for data export.

## Request Body

| Field             | Type                  | Description                                      |
|-------------------|-----------------------|--------------------------------------------------|
| `connector_name`  | `str`                 | The profile name of the destination to create.   |
| `connector_body`  | `DestinationConfigs`  | Configuration object for the destination.        |

## Response

- **200**: Destination created successfully  
    - Returns: `{ "profile_id": str }`
- **500**: Internal Server Error (e.g., failed to store secret)

## Example

```json
{
  "connector_name": "my-destination",
  "connector_body": {
    "type": "s3",
    "config": {
      "bucket": "my-bucket",
      "region": "us-east-1"
    }
  }
}
```



## OpenAPI

````yaml /deasy-openapi-stainless.yml post /destination/create
openapi: 3.1.0
info:
  title: FastAPI
  version: 0.1.0
servers:
  - url: /rest/unstructured
security: []
paths:
  /destination/create:
    post:
      tags:
        - Destinations
      summary: Create
      description: >-
        Create a new destination connector for data export.


        ## Request Body


        | Field             | Type                  |
        Description                                      |

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

        | `connector_name`  | `str`                 | The profile name of the
        destination to create.   |

        | `connector_body`  | `DestinationConfigs`  | Configuration object for
        the destination.        |


        ## Response


        - **200**: Destination created successfully  
            - Returns: `{ "profile_id": str }`
        - **500**: Internal Server Error (e.g., failed to store secret)


        ## Example


        ```json

        {
          "connector_name": "my-destination",
          "connector_body": {
            "type": "s3",
            "config": {
              "bucket": "my-bucket",
              "region": "us-east-1"
            }
          }
        }

        ```
      operationId: create_destination_route_destination_create_post
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateDestinationConnectorRequest'
        required: true
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ConnectorResponse'
        '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'
      security:
        - BasicAuth: []
        - BearerAuth: []
          UserIdAuth: []
      x-codeSamples:
        - lang: Python
          source: |-
            import os
            from unstructured import UnstructuredClient

            client = UnstructuredClient(
                username=os.environ.get("UNSTRUCTURED_USERNAME"),  # This is the default and can be omitted
                password=os.environ.get("UNSTRUCTURED_PASSWORD"),  # This is the default and can be omitted
            )
            connector_response = client.destination.create(
                connector_body={
                    "client_id": "client_id",
                    "client_secret": "client_secret",
                    "documents_library_folder_name": "documents_library_folder_name",
                    "name": "name",
                    "sharepoint_site_name": "sharepoint_site_name",
                    "tenant_id": "tenant_id",
                    "type": "SharepointNodeDestinationManager",
                },
                connector_name="connector_name",
            )
            print(connector_response.profile_id)
        - lang: JavaScript
          source: |-
            import UnstructuredClient from 'unstructured-sdk';

            const client = new UnstructuredClient({
              authMethod: 'My Auth Method',
              username: process.env['UNSTRUCTURED_USERNAME'], // This is the default and can be omitted
              password: process.env['UNSTRUCTURED_PASSWORD'], // This is the default and can be omitted
            });

            const connectorResponse = await client.destination.create({
              connector_body: {
                client_id: 'client_id',
                client_secret: 'client_secret',
                documents_library_folder_name: 'documents_library_folder_name',
                name: 'name',
                sharepoint_site_name: 'sharepoint_site_name',
                tenant_id: 'tenant_id',
                type: 'SharepointNodeDestinationManager',
              },
              connector_name: 'connector_name',
            });

            console.log(connectorResponse.profile_id);
components:
  schemas:
    CreateDestinationConnectorRequest:
      properties:
        connector_name:
          type: string
          title: Connector Name
        connector_body:
          oneOf:
            - $ref: '#/components/schemas/SharepointDestinationConfig'
            - $ref: '#/components/schemas/OnedriveDestinationConfig'
            - $ref: '#/components/schemas/PostgresDestinationConfig'
            - $ref: '#/components/schemas/AzureSQLDestinationConfig'
            - $ref: '#/components/schemas/S3DestinationConfig'
          title: Connector Body
          discriminator:
            propertyName: type
            mapping:
              AzureSQLNodeDestinationManager:
                $ref: '#/components/schemas/AzureSQLDestinationConfig'
              OnedriveNodeDestinationManager:
                $ref: '#/components/schemas/OnedriveDestinationConfig'
              PostgresNodeDestinationManager:
                $ref: '#/components/schemas/PostgresDestinationConfig'
              S3NodeDestinationManager:
                $ref: '#/components/schemas/S3DestinationConfig'
              SharepointNodeDestinationManager:
                $ref: '#/components/schemas/SharepointDestinationConfig'
      type: object
      required:
        - connector_name
        - connector_body
      title: CreateDestinationConnectorRequest
    ConnectorResponse:
      properties:
        profile_id:
          type: string
          title: Profile Id
      type: object
      required:
        - profile_id
      title: ConnectorResponse
    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
    SharepointDestinationConfig:
      properties:
        type:
          type: string
          enum:
            - SharepointNodeDestinationManager
          const: SharepointNodeDestinationManager
          title: Type
          default: SharepointNodeDestinationManager
        name:
          type: string
          title: Name
        client_id:
          type: string
          title: Client Id
        client_secret:
          type: string
          title: Client Secret
        tenant_id:
          type: string
          title: Tenant Id
        sharepoint_site_name:
          type: string
          title: Sharepoint Site Name
        documents_library_folder_name:
          type: string
          title: Documents Library Folder Name
        drives:
          anyOf:
            - items:
                type: string
              type: array
            - type: 'null'
          title: Drives
      type: object
      required:
        - name
        - client_id
        - client_secret
        - tenant_id
        - sharepoint_site_name
        - documents_library_folder_name
      title: SharepointDestinationConfig
    OnedriveDestinationConfig:
      properties:
        type:
          type: string
          enum:
            - OnedriveNodeDestinationManager
          const: OnedriveNodeDestinationManager
          title: Type
          default: OnedriveNodeDestinationManager
        name:
          type: string
          title: Name
        client_id:
          type: string
          title: Client Id
        client_secret:
          type: string
          title: Client Secret
        tenant_id:
          type: string
          title: Tenant Id
        onedrive_site_name:
          type: string
          title: Onedrive Site Name
        documents_library_folder_name:
          type: string
          title: Documents Library Folder Name
        drives:
          anyOf:
            - items:
                type: string
              type: array
            - type: 'null'
          title: Drives
      type: object
      required:
        - name
        - client_id
        - client_secret
        - tenant_id
        - onedrive_site_name
        - documents_library_folder_name
      title: OnedriveDestinationConfig
    PostgresDestinationConfig:
      properties:
        type:
          type: string
          enum:
            - PostgresNodeDestinationManager
          const: PostgresNodeDestinationManager
          title: Type
          default: PostgresNodeDestinationManager
        name:
          type: string
          title: Name
        url:
          type: string
          title: Url
        database_name:
          type: string
          title: Database Name
        collection_name:
          type: string
          title: Collection Name
        db_user:
          type: string
          title: Db User
        port:
          type: integer
          title: Port
        password:
          type: string
          title: Password
        id_key:
          type: string
          title: Id Key
          default: id
        tags_key:
          type: string
          title: Tags Key
          default: tags
        filename_key:
          type: string
          title: Filename Key
          default: filename
        text_key:
          type: string
          title: Text Key
          default: text
        dimension_threshold:
          anyOf:
            - type: integer
            - type: 'null'
          title: Dimension Threshold
          default: 384
        page_num_key:
          anyOf:
            - type: string
            - type: 'null'
          title: Page Num Key
        create_new_collection:
          type: boolean
          title: Create New Collection
          default: false
      type: object
      required:
        - name
        - url
        - database_name
        - collection_name
        - db_user
        - port
        - password
      title: PostgresDestinationConfig
    AzureSQLDestinationConfig:
      properties:
        type:
          type: string
          enum:
            - AzureSQLNodeDestinationManager
          const: AzureSQLNodeDestinationManager
          title: Type
          default: AzureSQLNodeDestinationManager
        server:
          type: string
          title: Server
        database:
          type: string
          title: Database
        username:
          type: string
          title: Username
        password:
          type: string
          title: Password
        table_name:
          type: string
          title: Table Name
        port:
          type: integer
          title: Port
          default: 1433
        dimension_threshold:
          anyOf:
            - type: integer
            - type: 'null'
          title: Dimension Threshold
          default: 384
        filename_key:
          type: string
          title: Filename Key
          default: filename
        text_key:
          type: string
          title: Text Key
          default: text
        id_key:
          type: string
          title: Id Key
          default: id
        driver:
          anyOf:
            - type: string
            - type: 'null'
          title: Driver
        create_new_table:
          type: boolean
          title: Create New Table
          default: false
      type: object
      required:
        - server
        - database
        - username
        - password
        - table_name
      title: AzureSQLDestinationConfig
    S3DestinationConfig:
      properties:
        type:
          type: string
          enum:
            - S3NodeDestinationManager
          const: S3NodeDestinationManager
          title: Type
          default: S3NodeDestinationManager
        name:
          type: string
          title: Name
        bucket_name:
          type: string
          title: Bucket Name
        aws_access_key_id:
          type: string
          title: Aws Access Key Id
        aws_secret_access_key:
          type: string
          title: Aws Secret Access Key
        region:
          anyOf:
            - type: string
            - type: 'null'
          title: Region
        deasy_tag_prefix:
          type: string
          title: Deasy Tag Prefix
          default: deasy_
      type: object
      required:
        - name
        - bucket_name
        - aws_access_key_id
        - aws_secret_access_key
      title: S3DestinationConfig
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
      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

````