---
title: "Compress files or folders."
method: POST
path: "/v1/sites/{id}/files/compress"
tags: ["Files"]
---

# Compress files or folders.

`POST /v1/sites/{id}/files/compress`

For a given site, compress a given files or folders.

## Path parameters

- `id` integer, required — ID of the Site you are interacting with

## Request body

- CompressFilesRequest
  - `sourcefiles` string[], required — Array of file names to include in the archive
  - `destfiles` string, required — name of the archive
  - `compress_type` 'bz2' | 'gz' | 'tar' | 'tar.gz' | 'tar.bz2' | 'zip', required — Type of compression to use

## Response `200`

OK

- PathResponse
  - `success` boolean — whether the request succeeded
  - `errors` string[]
  - `messages` string[], nullable
  - `result` object
    - `success` boolean — Whether the operation was successful
    - `path` string — Path to the file

## Other responses

- `400` — Bad Request
- `401` — Authentication failed
- `403` — Not authorized to access endpoint
- `404` — Given site not found for user
- `405` — Invalid input
- `500` — Internal error

---

[API](https://skmtc.net/rocket/apis/rocket-net-api.md) · [All operations](https://skmtc.net/rocket/apis/rocket-net-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/rocket/rocket-net-api/revisions/db0dcbbc5764/schema)
