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

> ## Agent Instructions
> Hosted remote MCP endpoint: https://api.zerodrive.dev/mcp (OAuth 2.0 PKCE or Bearer token).
> REST API base URL: https://api.zerodrive.dev with OpenAPI 3.1.0 specification at https://api.zerodrive.dev/openapi.json.
> S3-compatible gateway: https://api.zerodrive.dev/s3 (AWS Signature V4, region auto).
> Local command-line tool: zd (or zerodrive) and local stdio MCP server: zerodrive mcp.
> Token prefixes: zdk_ (Personal API Key), zdt_ (device session token), zda_ (OAuth access token), zdr_ (OAuth refresh token), zdx_ (temporary sandbox key). Never paste real keys into prompts or code.
> Be honest about platform boundaries: cloud files require internet access, files are encrypted at rest and in transit by Cloudflare rather than end-to-end encrypted, ZeroDrive is not a replacement for an independent backup, Windows 11 support is an unsigned x64 beta, and the 7-day Pro free trial requires a card and charges automatically when it ends.

# Remove the Extra Copies of Duplicate Files

> Keeps one file of each group and removes the others, following the account's web delete setting: Trash by default (the space comes back when Trash is emptied), or a real delete. The request must carry the person's confirm: true when the setting is Trash, the word DELETE when it is Delete right away; otherwise the answer is 400 confirm_required with the mode. It never trusts the scan: each file is read again and an extra moves only when its size and content match the kept file's. A request does a bounded amount of work: when the answer says done is false, repeat the call with groups.slice(next_group). Repeating a request is safe: removed files answer already_gone. This route is for the ZeroDrive apps and zd (a device token); an AI connector (an OAuth token) is refused with 403.



## OpenAPI

````yaml /api-reference/openapi.json post /v1/duplicates/remove
openapi: 3.1.0
info:
  title: ZeroDrive REST & MCP API
  version: 3.7.1
  description: >-
    Complete REST API and 24/7 hosted Model Context Protocol (MCP) specification
    for ZeroDrive (`https://api.zerodrive.dev`). Covers vault file I/O, moves,
    30-day Trash, duplicates, Knowledge Brain v2 hybrid search/corpora/graph,
    file version history, copy-on-write branches, snapshots, sandboxes,
    connected clouds, and fleet nodes.
  contact:
    name: ZeroDrive Support
    url: https://app.zerodrive.dev/support/
    email: support@zerodrive.dev
servers:
  - url: https://api.zerodrive.dev
    description: Production Edge API
security:
  - BearerAuth: []
tags:
  - name: Files & Folders
    description: >-
      Read, write, edit, copy, batch, byte-range stream, convert, and organize
      vault files and folders.
  - name: Moves, Trash & Duplicates
    description: >-
      Move items with share-link preservation, track or undo moves, scan/remove
      duplicates, and restore from 30-day Trash.
  - name: Search & Knowledge Brain
    description: >-
      Full-text keyword and semantic hybrid search, custom corpora, Knowledge
      Graph, bucket rules, media-transcript links, and white-label brains.
  - name: Versions, Drives & Workspaces
    description: >-
      File version history and diffs, multi-drive partitioning and recovery,
      workspaces, and async operations.
  - name: Branches, Snapshots & Primitives
    description: >-
      Copy-on-write drive branches, point-in-time snapshots, and atomic
      JSON/JSONL/CSV/Markdown/YAML operations.
  - name: Sandboxes & Coordination
    description: Temporary restricted keys (zdx_), temporary file locks, and task handoffs.
  - name: Connected Clouds, Connectors & Archive
    description: >-
      1-click OAuth clouds (Google Drive, Dropbox, Notion, OneDrive), read-only
      data connectors, and InfrequentAccess cold archive.
  - name: Skills, Prompts & MCP
    description: >-
      Reusable agent skills (_SKILLS/), ready-made prompts, and the 24/7
      JSON-RPC 2.0 MCP endpoint.
  - name: Devices, Nodes & Events
    description: >-
      Connected devices, self-hosted node pairing and commands, symlinks,
      activity feed, and SSE real-time streams.
  - name: Auth, Account, Billing & Releases
    description: >-
      PKCE sign-in handoff, credentials, usage, capabilities, public billing
      tiers, releases, roadmap, and support tickets.
paths:
  /v1/duplicates/remove:
    post:
      tags:
        - Moves, Trash & Duplicates
      summary: Remove the Extra Copies of Duplicate Files
      description: >-
        Keeps one file of each group and removes the others, following the
        account's web delete setting: Trash by default (the space comes back
        when Trash is emptied), or a real delete. The request must carry the
        person's confirm: true when the setting is Trash, the word DELETE when
        it is Delete right away; otherwise the answer is 400 confirm_required
        with the mode. It never trusts the scan: each file is read again and an
        extra moves only when its size and content match the kept file's. A
        request does a bounded amount of work: when the answer says done is
        false, repeat the call with groups.slice(next_group). Repeating a
        request is safe: removed files answer already_gone. This route is for
        the ZeroDrive apps and zd (a device token); an AI connector (an OAuth
        token) is refused with 403.
      operationId: removeDuplicates
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - scan_id
                - groups
                - confirm
              properties:
                scan_id:
                  type: string
                  description: The scan_id of a finished scan.
                groups:
                  type: array
                  description: At most 100 groups and 400 paths in all; no path twice.
                  items:
                    type: object
                    required:
                      - keep
                      - remove
                    properties:
                      keep:
                        type: string
                        description: The path that stays.
                      remove:
                        type: array
                        items:
                          type: string
                        description: The paths to remove.
                confirm:
                  description: >-
                    true when the account's web delete setting is trash; the
                    string DELETE when it is delete_now.
      responses:
        '200':
          description: >-
            done, mode, message, results (one for each group, with the status of
            each file), removed, shared_removed and next_group
        '400':
          description: Invalid request, or confirm_required (with the mode)
        '403':
          description: An AI connector token, or an account that can not write
        '404':
          description: Scan not found
        '409':
          description: scan_not_finished
components:
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      bearerFormat: API_KEY / OAuth Token
      description: >-
        ZeroDrive Personal API Key (zdk_), device token, or OAuth 2.0 Bearer
        token

````

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