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

# Preview Export Workspace Sync

> Project which resources an export would commit, without writing to Git.



## OpenAPI

````yaml https://platform.tracecat.com/api/openapi.json post /workspaces/{workspace_id}/workflows/sync/export/preview
openapi: 3.1.0
info:
  title: Tracecat API
  summary: Tracecat API
  description: The open source AI automation platform for security teams and agents.
  termsOfService: >-
    https://docs.google.com/document/d/e/2PACX-1vQvDe3SoVAPoQc51MgfGCP71IqFYX_rMVEde8zC4qmBCec5f8PLKQRdxa6tsUABT8gWAR9J-EVs2CrQ/pub
  contact:
    name: Tracecat Founders
    email: founders@tracecat.com
  license:
    name: AGPL-3.0
    url: https://www.gnu.org/licenses/agpl-3.0.html
  version: '1'
servers:
  - url: /api
security: []
tags:
  - name: public
    description: Public facing endpoints
  - name: workflows
    description: Workflow management
  - name: actions
    description: Action management
  - name: triggers
    description: Workflow triggers
  - name: secrets
    description: Secret management
  - name: variables
    description: Workspace variable management
paths:
  /workspaces/{workspace_id}/workflows/sync/export/preview:
    post:
      tags:
        - workflows
      summary: Preview Export Workspace Sync
      description: Project which resources an export would commit, without writing to Git.
      operationId: workflows-preview_export_workspace_sync
      parameters:
        - name: workspace_id
          in: path
          required: true
          schema:
            type: string
            format: uuid
            title: Workspace Id
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/WorkspaceSyncExportPreviewRequest'
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/WorkspaceSyncExportPreview'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      security:
        - APIKeyCookie: []
        - ServiceAccountApiKeyBearer: []
components:
  schemas:
    WorkspaceSyncExportPreviewRequest:
      properties:
        resources:
          anyOf:
            - items:
                $ref: '#/components/schemas/ResourceRef'
              type: array
            - type: 'null'
          title: Resources
          description: Specific resources to preview, or ``None`` for all.
        include_schedules:
          type: boolean
          title: Include Schedules
          description: Whether to include workflow schedules in the preview.
          default: false
        compare_ref:
          anyOf:
            - type: string
            - type: 'null'
          title: Compare Ref
          description: >-
            Repository ref to compare the projected export against. When
            omitted, the preview only returns the export manifest summary.
      type: object
      title: WorkspaceSyncExportPreviewRequest
      description: Request a dry-run projection of what an export would push to Git.
    WorkspaceSyncExportPreview:
      properties:
        resource_counts:
          additionalProperties:
            type: integer
          type: object
          title: Resource Counts
          description: Count of resources to commit, keyed by resource type.
        files:
          items:
            type: string
          type: array
          title: Files
          description: Repository-relative paths the export would write.
        resources:
          items:
            $ref: '#/components/schemas/WorkspaceSyncPreviewResource'
          type: array
          title: Resources
          description: Displayable resources included in the export preview.
        resource_diffs:
          items:
            $ref: '#/components/schemas/PullResourceDiff'
          type: array
          title: Resource Diffs
          description: >-
            Per-resource file diffs between the comparison ref and projected
            export.
      type: object
      required:
        - resource_counts
        - files
      title: WorkspaceSyncExportPreview
      description: |-
        Projection summary of the resources an export would commit.

        Mirrors the pull dry-run preview: it projects the selected resources
        locally without writing to Git or mutating sync mappings.
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    ResourceRef:
      properties:
        resource_type:
          $ref: '#/components/schemas/SyncResourceType'
          description: Type of the referenced resource.
        source_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Source Id
          description: Git source id of the resource, if referenced by source id.
        local_id:
          anyOf:
            - type: string
              format: uuid
            - type: 'null'
          title: Local Id
          description: Local database id of the resource, if referenced by local id.
      type: object
      required:
        - resource_type
      title: ResourceRef
      description: Reference to a single resource by type and either source or local id.
    WorkspaceSyncPreviewResource:
      properties:
        resource_type:
          $ref: '#/components/schemas/SyncResourceType'
          description: Type of resource included in the preview.
        source_id:
          type: string
          title: Source Id
          description: Stable Git source id for the resource.
        name:
          type: string
          title: Name
          description: Human-readable resource name.
        path:
          type: string
          title: Path
          description: Primary repository path written for the resource.
      type: object
      required:
        - resource_type
        - source_id
        - name
        - path
      title: WorkspaceSyncPreviewResource
      description: One resource included in a workspace sync export preview.
    PullResourceDiff:
      properties:
        resource_type:
          type: string
          title: Resource Type
        source_id:
          type: string
          title: Source Id
        source_path:
          type: string
          title: Source Path
        change_type:
          type: string
          enum:
            - added
            - modified
            - deleted
          title: Change Type
        title:
          anyOf:
            - type: string
            - type: 'null'
          title: Title
        diff:
          type: string
          title: Diff
        truncated:
          type: boolean
          title: Truncated
          default: false
      type: object
      required:
        - resource_type
        - source_id
        - source_path
        - change_type
        - title
        - diff
      title: PullResourceDiff
    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
    SyncResourceType:
      type: string
      enum:
        - workflow
        - agent_preset
        - skill
        - table
        - case_tag
        - case_field
        - case_dropdown
        - case_duration
        - variable
        - secret_metadata
      title: SyncResourceType
      description: Kind of workspace resource that can be synced to and from Git.
  securitySchemes:
    APIKeyCookie:
      type: apiKey
      in: cookie
      name: fastapiusersauth
    ServiceAccountApiKeyBearer:
      type: http
      description: Tracecat service account API key.
      scheme: bearer

````