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

# New Sync Dataset



## OpenAPI

````yaml https://api.truestate.io/openapi.json post /datasets/sync/
openapi: 3.1.0
info:
  title: TrueState Backend API
  summary: >-
    TrueState is an AI platform for business users to create high-impact AI
    solutions.
  description: >

    This **[TrueState](https://www.truestate.io/)** backend API allows our
    clients to automate and more powerfully retrieve and modify data from the
    TrueState platform.


    Example use cases include:


    - Accessing embeddings for a dataset.

    - Automating the process of dataset creation and model retraining as your
    data changes.

    - Much more.


    Our backend is built using the [FastAPI](https://fastapi.tiangolo.com/)
    framework in python

    using [Auth0](https://auth0.com/) and [Client API
    Keys](https://docs.truestate.io/docs/api/client-api-keys) for internal an
    external authentication, respectively.

    Our backend is designed to be secure, scalable, easy to use and well
    documented _(each router with its own linked docs page)_.

    Clients can only access data from their own organisation, as setup in Auth0
    our the Client API Keys. See how
    **[here](https://docs.truestate.io/docs/api/overview)**.


    **PS**: You can view this API documentation in either
    **[Swagger](swagger/docs)** or **[Redoc](redoc/)**, but only the swagger
    lets you test calls.
  contact:
    name: True State Support
    url: http://docs.truestate.io/
    email: support@truestate.io
  license:
    name: Private
    url: https://www.apache.org/licenses/LICENSE-2.0.html
  version: 0.11.78
servers: []
security: []
tags:
  - name: assistants
    description: Management of assistants
  - name: api-keys
    description: Management of each user personal Client API Keys, used to access this API.
  - name: models
    description: Management of models
  - name: secrets
    description: Management of client secrets for accessing external services
  - name: deployments
    description: Management of deployments.
  - name: pipelines
    description: Management of pipelines.
  - name: pipeline-runs
    description: Management of pipeline runs.
  - name: automations
    description: Management of Automations.
  - name: automation-sessions
    description: Management of Automation Sessions.
  - name: chatbots
    description: Chatbot endpoints.
  - name: check-auto-recharge
    description: ''
  - name: classification-classes
    description: >-
      Management of zero shot classifications (using ai to apply new categories
      to a dataset).
  - name: conversations
    description: Management of conversations
  - name: conventions
    description: Management of conventions - best practices for actuators and agents
  - name: credit-usage
    description: Management of Credits.
  - name: dashboards
    description: Management of Dashboards.
  - name: data
    description: Bigquery inference services
  - name: data-dictionary
    description: Data Dictionary endpoints.
  - name: datasets
    description: Dataset endpoints.
  - name: documents
    description: Document endpoints.
  - name: default
    description: Default health checks.
  - name: embedding-search
    description: ''
  - name: inference
    description: Model inference services
  - name: messages
    description: Management of messages
  - name: notebooks
    description: ''
  - name: notebook-services
    description: ''
  - name: organisations
    description: Management of Organisations.
  - name: payment-methods
    description: Management of Payment methods.
  - name: private-tasks
    description: ''
  - name: private-pipelines
    description: ''
  - name: private-data
    description: ''
  - name: renew-seats
    description: ''
  - name: tagging-lists
    description: Management of Tagging Lists.
  - name: tasks
    description: ''
  - name: task-templates
    description: Management of task templates (definitions and schedules).
  - name: agents
    description: ''
  - name: user
    description: Management of User.
  - name: user-context
    description: Management of User Context.
  - name: private-messages
    description: ''
  - name: private-llm-call
    description: ''
  - name: admin-organisations
    description: ''
  - name: private-warehouser
    description: ''
  - name: private-pipeline-tracking
    description: ''
  - name: private-pipeline-runs
    description: ''
  - name: private-reports
    description: ''
  - name: private-bootstrap
    description: ''
  - name: reports
    description: ''
  - name: private-conversations
    description: ''
  - name: private-datasets
    description: ''
  - name: private-dashboards
    description: ''
  - name: private-conventions
    description: ''
  - name: private-documents
    description: ''
paths:
  /datasets/sync/:
    post:
      tags:
        - datasets
      summary: New Sync Dataset
      operationId: new_sync_dataset_datasets_sync__post
      parameters:
        - name: Api-key
          in: header
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            title: Api-Key
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/SyncDatasetRequest'
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema: {}
        '404':
          description: Not found
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      security:
        - HTTPBearer: []
components:
  schemas:
    SyncDatasetRequest:
      properties:
        id:
          type: string
          title: Id
        name:
          type: string
          title: Name
        description:
          anyOf:
            - type: string
            - type: 'null'
          title: Description
        sync:
          $ref: '#/components/schemas/DatasetSyncConfig'
      type: object
      required:
        - id
        - name
        - sync
      title: SyncDatasetRequest
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    DatasetSyncConfig:
      properties:
        schedule_enabled:
          type: boolean
          title: Schedule Enabled
        cron_schedule:
          type: string
          title: Cron Schedule
        import_config:
          $ref: '#/components/schemas/IntegrationConfig-Input'
      type: object
      required:
        - schedule_enabled
        - cron_schedule
        - import_config
      title: DatasetSyncConfig
    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
    IntegrationConfig-Input:
      properties:
        job_type:
          type: string
          const: integration
          title: Job Type
          default: integration
        integration_config:
          oneOf:
            - $ref: '#/components/schemas/SalesforceIntegrationParams'
            - $ref: '#/components/schemas/GoogleCloudStorageIntegrationParams'
            - $ref: '#/components/schemas/AzureBlobStorageIntegrationParams'
            - $ref: '#/components/schemas/AwsS3IntegrationParams'
            - $ref: '#/components/schemas/SqlServerIntegrationParams'
            - $ref: '#/components/schemas/SharepointIntegrationParams'
            - $ref: '#/components/schemas/BigqueryIntegrationParams'
            - $ref: '#/components/schemas/FabricWarehouseIntegrationParams'
            - $ref: '#/components/schemas/SnowflakeIntegrationParams'
            - $ref: '#/components/schemas/TaboolaIntegrationParams'
            - $ref: '#/components/schemas/OutbrainIntegrationParams'
            - $ref: '#/components/schemas/D365BusinessCentralIntegrationParams'
          title: Integration Config
          discriminator:
            propertyName: source
            mapping:
              aws-s3: '#/components/schemas/AwsS3IntegrationParams'
              azure-blob-storage: '#/components/schemas/AzureBlobStorageIntegrationParams'
              bigquery: '#/components/schemas/BigqueryIntegrationParams'
              dynamics-365-business-central: '#/components/schemas/D365BusinessCentralIntegrationParams'
              fabric-warehouse: '#/components/schemas/FabricWarehouseIntegrationParams'
              google-cloud-storage: '#/components/schemas/GoogleCloudStorageIntegrationParams'
              outbrain: '#/components/schemas/OutbrainIntegrationParams'
              salesforce: '#/components/schemas/SalesforceIntegrationParams'
              sharepoint: '#/components/schemas/SharepointIntegrationParams'
              snowflake: '#/components/schemas/SnowflakeIntegrationParams'
              sql-server: '#/components/schemas/SqlServerIntegrationParams'
              taboola: '#/components/schemas/TaboolaIntegrationParams'
        credential_secret:
          type: string
          title: Credential Secret
        output_dataset:
          type: string
          title: Output Dataset
      type: object
      required:
        - integration_config
        - credential_secret
        - output_dataset
      title: IntegrationConfig
    SalesforceIntegrationParams:
      properties:
        source:
          type: string
          const: salesforce
          title: Source
          default: salesforce
        domain:
          type: string
          title: Domain
        query_type:
          $ref: '#/components/schemas/SalesforceQueryType'
        query:
          type: string
          title: Query
      type: object
      required:
        - domain
        - query_type
        - query
      title: SalesforceIntegrationParams
    GoogleCloudStorageIntegrationParams:
      properties:
        source:
          type: string
          const: google-cloud-storage
          title: Source
          default: google-cloud-storage
        path:
          type: string
          title: Path
        filetype:
          $ref: '#/components/schemas/IntegrationFileType'
      type: object
      required:
        - path
        - filetype
      title: GoogleCloudStorageIntegrationParams
    AzureBlobStorageIntegrationParams:
      properties:
        source:
          type: string
          const: azure-blob-storage
          title: Source
          default: azure-blob-storage
        path:
          type: string
          title: Path
        filetype:
          $ref: '#/components/schemas/IntegrationFileType'
      type: object
      required:
        - path
        - filetype
      title: AzureBlobStorageIntegrationParams
    AwsS3IntegrationParams:
      properties:
        source:
          type: string
          const: aws-s3
          title: Source
          default: aws-s3
        path:
          type: string
          title: Path
        filetype:
          $ref: '#/components/schemas/IntegrationFileType'
      type: object
      required:
        - path
        - filetype
      title: AwsS3IntegrationParams
    SqlServerIntegrationParams:
      properties:
        source:
          type: string
          const: sql-server
          title: Source
          default: sql-server
        server:
          type: string
          title: Server
        database:
          type: string
          title: Database
        query:
          type: string
          title: Query
        table_name:
          anyOf:
            - type: string
            - type: 'null'
          title: Table Name
      type: object
      required:
        - server
        - database
        - query
      title: SqlServerIntegrationParams
    SharepointIntegrationParams:
      properties:
        source:
          type: string
          const: sharepoint
          title: Source
          default: sharepoint
        tenant_id:
          type: string
          title: Tenant Id
        site_name:
          type: string
          title: Site Name
        file_path:
          type: string
          title: File Path
          default: ''
      type: object
      required:
        - tenant_id
        - site_name
      title: SharepointIntegrationParams
    BigqueryIntegrationParams:
      properties:
        source:
          type: string
          const: bigquery
          title: Source
          default: bigquery
        query:
          type: string
          title: Query
        bq_location:
          type: string
          title: Bq Location
          default: ''
      type: object
      required:
        - query
      title: BigqueryIntegrationParams
    FabricWarehouseIntegrationParams:
      properties:
        source:
          type: string
          const: fabric-warehouse
          title: Source
          default: fabric-warehouse
        sql_endpoint:
          type: string
          title: Sql Endpoint
        warehouse_name:
          type: string
          title: Warehouse Name
        query:
          type: string
          title: Query
      type: object
      required:
        - sql_endpoint
        - warehouse_name
        - query
      title: FabricWarehouseIntegrationParams
    SnowflakeIntegrationParams:
      properties:
        source:
          type: string
          const: snowflake
          title: Source
          default: snowflake
        account_identifier:
          type: string
          title: Account Identifier
        database:
          type: string
          title: Database
        query:
          type: string
          title: Query
        database_schema:
          type: string
          title: Database Schema
          default: public
        warehouse:
          anyOf:
            - type: string
            - type: 'null'
          title: Warehouse
        role:
          anyOf:
            - type: string
            - type: 'null'
          title: Role
      type: object
      required:
        - account_identifier
        - database
        - query
      title: SnowflakeIntegrationParams
    TaboolaIntegrationParams:
      properties:
        source:
          type: string
          const: taboola
          title: Source
          default: taboola
        level:
          type: string
          enum:
            - campaign
            - item
          title: Level
        account_id:
          type: string
          title: Account Id
        start_date:
          anyOf:
            - type: string
            - type: 'null'
          title: Start Date
        end_date:
          anyOf:
            - type: string
            - type: 'null'
          title: End Date
        last_n_days:
          anyOf:
            - type: integer
            - type: 'null'
          title: Last N Days
          default: 30
      type: object
      required:
        - level
        - account_id
      title: TaboolaIntegrationParams
    OutbrainIntegrationParams:
      properties:
        source:
          type: string
          const: outbrain
          title: Source
          default: outbrain
        marketer_id:
          type: string
          title: Marketer Id
        include_archived:
          type: boolean
          title: Include Archived
          default: true
        start_date:
          anyOf:
            - type: string
            - type: 'null'
          title: Start Date
        end_date:
          anyOf:
            - type: string
            - type: 'null'
          title: End Date
        last_n_days:
          anyOf:
            - type: integer
            - type: 'null'
          title: Last N Days
      type: object
      required:
        - marketer_id
      title: OutbrainIntegrationParams
    D365BusinessCentralIntegrationParams:
      properties:
        source:
          type: string
          const: dynamics-365-business-central
          title: Source
          default: dynamics-365-business-central
        tenant:
          type: string
          title: Tenant
        environment:
          type: string
          title: Environment
        entity:
          type: string
          title: Entity
        is_company_child:
          type: boolean
          title: Is Company Child
        query_params:
          anyOf:
            - type: string
            - type: 'null'
          title: Query Params
        publisher:
          anyOf:
            - type: string
            - type: 'null'
          title: Publisher
        group:
          anyOf:
            - type: string
            - type: 'null'
          title: Group
      type: object
      required:
        - tenant
        - environment
        - entity
        - is_company_child
      title: D365BusinessCentralIntegrationParams
    SalesforceQueryType:
      type: string
      enum:
        - soql
      title: SalesforceQueryType
    IntegrationFileType:
      type: string
      enum:
        - csv
        - parquet
      title: IntegrationFileType
  securitySchemes:
    HTTPBearer:
      type: http
      scheme: bearer

````