---
title: "POST /api/files/copy"
method: POST
path: "/api/files/copy"
---

# POST /api/files/copy

`POST /api/files/copy`

## Request body

- FileCopyRequest
  - `newPath` string, required
  - `path` string, required

## Response `200`

Copy a file or directory

- FileCopyResponse
  - `info` FileInfo
    - `children` FileInfo[]
    - `id` string, required
    - `isDirectory` boolean, required
    - `isMarimoFile` boolean, required
    - `lastModified` number, nullable
    - `name` string, required
    - `opengraph` OpenGraphMetadata — OpenGraph-style metadata for a notebook. The `image` field may be either: - a relative path (typically under `__marimo__/`), or - an absolute HTTPS URL.
      - `description` string, nullable
      - `image` string, nullable
      - `title` string, nullable
    - `path` string, required
    - `size` integer, nullable
  - `message` string, nullable
  - `success` boolean, required

## Changes

> 60 revisions in range; 3 could not be searched.

- **2026-07-24** `a6054d54dad6` — 1 info
  - added the optional property `info/anyOf[subschema #2: FileInfo]/size` to the response with the `200` status
- **2026-04-17** `c74de14b778c` — 1 info
  - endpoint added
- **2026-03-18** `f29fa637d35b` — 1 breaking
  - api path removed without deprecation

[Change history](https://skmtc.dev/marimo-team/apis/marimo-api/changes/api/files/copy/post.md)

---

[API](https://skmtc.dev/marimo-team/apis/marimo-api.md) · [All operations](https://skmtc.dev/marimo-team/apis/marimo-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/marimo-team/marimo-api/revisions/a39082aac3ce/schema)
