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

# Undo the Last Move of an Item

> Move an item back to where its last move took it from. Name the move with move_id (from the move answer or from the history) or name the item by the path it is at now. The item's share link follows it back. It never overwrites or merges into what stands at the old path: when the old path is taken the answer is 409 and nothing changes. It does not restore a file that the original move replaced, and it never rewrites a file's content. A folder moves back as it is now, in steps of up to 200 files a call: while the answer says done false, call again with the same move_id or path, resume true and after set to the answer's next. An undo is one more move in the history and can itself be undone.



## OpenAPI

````yaml /api-reference/openapi.json post /v1/files/undo-move
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/files/undo-move:
    post:
      tags:
        - Moves, Trash & Duplicates
      summary: Undo the Last Move of an Item
      description: >-
        Move an item back to where its last move took it from. Name the move
        with move_id (from the move answer or from the history) or name the item
        by the path it is at now. The item's share link follows it back. It
        never overwrites or merges into what stands at the old path: when the
        old path is taken the answer is 409 and nothing changes. It does not
        restore a file that the original move replaced, and it never rewrites a
        file's content. A folder moves back as it is now, in steps of up to 200
        files a call: while the answer says done false, call again with the same
        move_id or path, resume true and after set to the answer's next. An undo
        is one more move in the history and can itself be undone.
      operationId: undoMove
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                move_id:
                  type: string
                  description: The id of the move to undo. Give this or path.
                path:
                  type: string
                  description: The path the item is at now. Give this or move_id.
                resume:
                  type: boolean
                  description: >-
                    Folders only: true on the calls that carry on an undo the
                    first call began.
                after:
                  type: string
                  description: 'Folders only: the cursor (next) the previous answer gave.'
      responses:
        '200':
          description: >-
            Moved back. ok, source, destination, kind, undone (the move that was
            undone), move_id (this undo's own id, or null), shares_followed,
            replaced_not_restored (true when the original move had replaced a
            file that is not restored), inferred (true when the original move
            was inferred and not confirmed) and, for a folder, done, moved,
            skipped and, while done is false, next and resume true.
          content:
            application/json:
              schema:
                type: object
                properties:
                  ok:
                    type: boolean
                  source:
                    type: string
                  destination:
                    type: string
                  kind:
                    type: string
                    enum:
                      - file
                      - folder
                  undone:
                    type: string
                  move_id:
                    type: string
                    nullable: true
                  shares_followed:
                    type: integer
                  replaced_not_restored:
                    type: boolean
                  inferred:
                    type: boolean
                  done:
                    type: boolean
                  moved:
                    type: integer
                  skipped:
                    type: integer
                  next:
                    type: string
                  resume:
                    type: boolean
        '400':
          description: >-
            Provide move_id or path; Invalid move_id; Invalid path; or Invalid
            'after' cursor
        '404':
          description: >-
            Nothing to undo for that move (a later move follows it, a delete or
            the Trash ended it, or it is not finished), or Item not found where
            the move put it
        '409':
          description: 'Old path already exists: <path>. Nothing was changed.'
        '413':
          description: File is over 5 GiB and cannot be moved
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.