---
title: "Duplicate xet files"
method: POST
path: "/api/kernels/{namespace}/{repo}/lfs-files/duplicate"
tags: ["kernels"]
---

# Duplicate xet files

`POST /api/kernels/{namespace}/{repo}/lfs-files/duplicate`

Duplicate xet-stored files from this repo (source) into another repo (target) by xet hash, without re-uploading file bytes. The caller must then commit the files with their sha256/size as usual.

## Path parameters

- `namespace` string, required
- `repo` string, required

## Request body

- object
  - `target` object, required
    - `type` 'dataset' | 'model' | 'space' | 'kernel', required
    - `name` string, required
  - `files` object[], required
    - `xetHash` string, required
    - `sha256` string, required
    - `filename` string

## Response `200`

Duplicate xet files response

- object
  - `success` boolean, required — True if all requested files were duplicated (or already present)
  - `processed` integer, required — Total number of unique files processed
  - `succeeded` integer, required — Number of files duplicated or already present in the target
  - `failed` object[], required — Per-file failures
    - `xetHash` string, required — Xet content hash of the file that failed
    - `sha256` string, required — sha256 of the file that failed
    - `error` string, required — Error message

## Other responses

- `207` — Duplicate xet files response

---

[API](https://skmtc.net/huggingface/apis/hub-api-endpoints.md) · [All operations](https://skmtc.net/huggingface/apis/hub-api-endpoints/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/huggingface/hub-api-endpoints/versions/dae0cc3790f0/schema)
