> ## Documentation Index
> Fetch the complete documentation index at: https://domoinc-openapi-sync-dataflows.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Create Export

> Initiates an export of a DataSet to an S3 bucket (asynchronous).
Only one active export can run per DataSet at a time.
Returns previous export info if data hasn't changed.




## OpenAPI

````yaml /openapi/product/export.yaml post /api/query/v1/export/{DATASOURCE_ID}
openapi: 3.0.0
info:
  title: Export to S3 API
  version: v1
  description: API for exporting Domo Datasets to an AWS S3 bucket.
servers:
  - url: https://{instance}.domo.com
    description: Domo Instance
    variables:
      instance:
        default: api
        description: Your specific Domo instance name (e.g., mycompany)
security:
  - developerToken: []
tags:
  - name: Exports
    description: Manage dataset exports to S3.
paths:
  /api/query/v1/export/{DATASOURCE_ID}:
    parameters:
      - name: DATASOURCE_ID
        in: path
        required: true
        description: The ID of the Dataset.
        schema:
          type: string
          example: aa7d9422-9abe-4581-bbf3-4a8cb5d3fc25
    post:
      tags:
        - Export to S3 API
      summary: Create Export
      description: |
        Initiates an export of a DataSet to an S3 bucket (asynchronous).
        Only one active export can run per DataSet at a time.
        Returns previous export info if data hasn't changed.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ExportRequest'
            example:
              awsAccessKey: <AWS_KEY>
              awsAccessSecret: <AWS_SECRET>
              bucket: <BUCKET>
              path: <PATH>
              region": <REGION>
              queryRequest:
                includeBOM: true
                useCache: true
                query:
                  columns:
                    - column: Customer ID
                      exprType: COLUMN
                    - column: Date Filled
                      exprType: COLUMN
                  groupByColumns": []
                  orderByColumns": []
      responses:
        '200':
          description: OK. Export initiated or previous export info returned.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ExportStatus'
        '400':
          description: Invalid request. Export cannot be created.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '401':
          description: Access denied. Token is invalid or expired.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '403':
          description: Insufficient permissions for export access.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '404':
          description: Dataset ID not found.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '500':
          description: Unexpected server error.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
components:
  schemas:
    ExportRequest:
      type: object
      required:
        - awsAccessKey
        - awsAccessSecret
        - bucket
        - path
        - region
        - queryRequest
      properties:
        awsAccessKey:
          type: string
          description: AWS Access Key ID.
        awsAccessSecret:
          type: string
          description: AWS Secret Access Key.
        bucket:
          type: string
          description: The target S3 bucket name.
        path:
          type: string
          description: The path within the bucket.
        region:
          type: string
          description: The AWS region of the bucket.
        queryRequest:
          $ref: '#/components/schemas/QueryRequest'
    ExportStatus:
      type: object
      description: Represents the status of a dataset export.
      properties:
        bucket:
          type: string
        compression:
          type: string
          example: none
        errorCode:
          type: string
          nullable: true
        exportFormat:
          type: string
          example: csv
        exportId:
          type: string
          format: uuid
        exportStatus:
          type: string
          enum:
            - none
            - success
            - running
            - failed
          example: success
        finished:
          type: string
          format: date-time
        message:
          type: string
          nullable: true
        started:
          type: string
          format: date-time
        urlRowCountMap:
          $ref: '#/components/schemas/UrlRowCountMap'
    ErrorResponse:
      type: object
      properties:
        errorCode:
          type: string
        message:
          type: string
          description: A human-readable error message.
    QueryRequest:
      type: object
      properties:
        includeBOM:
          type: boolean
        useCache:
          type: boolean
        query:
          $ref: '#/components/schemas/QueryDefinition'
    UrlRowCountMap:
      type: object
      additionalProperties:
        type: integer
      example:
        additionalProp1: 0
        additionalProp2: 0
    QueryDefinition:
      type: object
      properties:
        columns:
          type: array
          items:
            $ref: '#/components/schemas/QueryColumn'
        groupByColumns:
          type: array
          items: {}
        orderByColumns:
          type: array
          items: {}
    QueryColumn:
      type: object
      properties:
        column:
          type: string
        exprType:
          type: string
          enum:
            - COLUMN
  securitySchemes:
    developerToken:
      type: apiKey
      in: header
      name: X-DOMO-Developer-Token
      description: Domo Developer Token for authentication.

````