---
title: "Copy project files into a sandbox"
method: POST
path: "/v1/sandboxes/{sandbox_id}/files/import"
tags: ["Sandboxes"]
---

# Copy project files into a sandbox

`POST /v1/sandboxes/{sandbox_id}/files/import`

## Request

- Base URL: `https://api.dexto.ai`
- URL: `https://api.dexto.ai/v1/sandboxes/{sandbox_id}/files/import`
- Auth: HTTP bearer

Copy up to 100 of the project's files (by id, or every file under a prefix) into the running sandbox, replacing files at their targets. Each copy is checked against the file's SHA-256. Copies are free.

## Path parameters

- `sandbox_id` string, required

## Request body

- object
  - `directory` string: The /workspace directory the files are copied into.
  - `file_ids` string[]: Project files to copy, each to <directory>/<path>.
  - `prefix` string: Copy every project file under this prefix, each to <directory>/<path after the prefix>.

## Response `200`

Successful response.

- object
  - `data` object[], required
    - `file_id` string, uuid, required
    - `path` string, required
    - `sandbox_path` string, required
    - `size_bytes` integer, required
  - `object` 'list', required

## Other responses

- `400`: Invalid JSON or request fields.
- `401`: Missing or invalid API key.
- `402`: The account has insufficient credits.
- `403`: The account cannot perform this operation.
- `404`: The requested resource was not found.
- `409`: The request conflicts with existing resource state.
- `429`: The account exceeded this operation's request rate.
- `500`: Unexpected Dexto failure.
- `502`: The upstream model provider failed.
- `503`: A required Dexto service is temporarily unavailable.

---

[API](https://skmtc.dev/dexto/apis/dexto-api.md) - [All operations](https://skmtc.dev/dexto/apis/dexto-api/llms.txt) - [OpenAPI document](https://skmtc.dev/dexto/apis/dexto-api/revisions/47eb880cffa5?raw)
