Skip to main content
POST
/
files
/
compose
Compose multiple files into a single file using zero-copy concatenation. Source files are deleted after successful composition.
curl --request POST \
  --url https://{port}-{sandboxID}.e2b.app/files/compose \
  --header 'Content-Type: application/json' \
  --header 'X-Access-Token: <api-key>' \
  --data '
{
  "source_paths": [
    "<string>"
  ],
  "destination": "<string>",
  "username": "<string>"
}
'
{
  "path": "<string>",
  "name": "<string>",
  "type": "file"
}

Authorizations

X-Access-Token
string
header
required

Sandbox access token (envdAccessToken) for authenticating requests to a running sandbox. Returned by: POST /sandboxes (on create), POST /sandboxes/{sandboxID}/connect (on connect), POST /sandboxes/{sandboxID}/resume (on resume), and GET /sandboxes/{sandboxID} (for running or paused sandboxes).

Body

application/json
source_paths
string[]
required

Ordered list of source file paths to concatenate

destination
string
required

Destination file path for the composed file

username
string

User for setting ownership and resolving relative paths

Response

Files composed successfully

path
string
required

Path to the file

name
string
required

Name of the file

type
enum<string>
required

Type of the file

Available options:
file,
directory