---
title: "Remove a file from a template’s bundle"
---

> Documentation Index
> Fetch the complete documentation index at: https://docs.cloudraker.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Remove a file from a template’s bundle

Path: CloudRaker Paperwork API › Compose

`DELETE /v1/compose/configs/{idOrSlug}/files/{fileId}`

Takes a file out of this template's bundle. The file itself stays in your template library — this only unlinks it.

Removing the file that `main` names would leave the template unrenderable, so that answers `422` unless the same call names the new entry point with `?main=`.

**Learn more:** [Compose](https://docs.cloudraker.com/paperwork/capabilities/compose)

## Authentication

- `bearerAuth`, http, header `Authorization`

## Path parameters

- `idOrSlug` (`deleteComposeTemplateFile.path.idOrSlug`; string, required)
  - minLength 1
- `fileId` (`deleteComposeTemplateFile.path.fileId`; string, required)
  - minLength 1

## Query parameters

- `main` (`deleteComposeTemplateFile.query.main`; string, optional)
  - minLength 1

## Code samples

### cURL

```bash
curl --request DELETE \
  --url 'https://api.cloudraker.com/v1/compose/configs/<idOrSlug>/files/<fileId>' \
  --header 'Authorization: Bearer <token>'
```

### TypeScript

```typescript
const url = 'https://api.cloudraker.com/v1/compose/configs/<idOrSlug>/files/<fileId>';
const options = {method: 'DELETE', headers: {Authorization: 'Bearer <token>'}};

fetch(url, options)
  .then(res => res.json())
  .then(json => console.log(json))
  .catch(err => console.error(err));
```

### Python

```python
import requests

url = "https://api.cloudraker.com/v1/compose/configs/<idOrSlug>/files/<fileId>"

headers = {"Authorization": "Bearer <token>"}

response = requests.delete(url, headers=headers)

print(response.text)
```

## Responses

### 200

The updated template config.

#### Example

```json
{
  "object": "config",
  "id": "string",
  "slug": "string",
  "name": "string",
  "capability": "compose",
  "config": {
    "schema": {
      "property1": null,
      "property2": null
    },
    "main": "invoice.typ",
    "files": [
      "string"
    ],
    "examples": [
      {
        "name": "Acme invoice",
        "data": {
          "property1": null,
          "property2": null
        }
      }
    ]
  },
  "updatedAt": "string"
}
```

- `object` (`deleteComposeTemplateFile.response.200.object`; string, required)
- `id` (`deleteComposeTemplateFile.response.200.id`; string, required)
- `slug` (`deleteComposeTemplateFile.response.200.slug`; string, required)
- `name` (`deleteComposeTemplateFile.response.200.name`; string, required)
- `capability` (`deleteComposeTemplateFile.response.200.capability`; string, required)
- `config` (`deleteComposeTemplateFile.response.200.config`; object, required)
  - `schema` (`deleteComposeTemplateFile.response.200.config.schema`; map<unknown>, optional)
  - `main` (`deleteComposeTemplateFile.response.200.config.main`; string, optional) — The bundle file the render starts from. It must be a typst source — a name ending in `.typ`.
    - minLength 1; example `"invoice.typ"`
  - `files` (`deleteComposeTemplateFile.response.200.config.files`; array<string>, optional)
    - minLength 1
  - `examples` (`deleteComposeTemplateFile.response.200.config.examples`; array<object>, optional)
    - `name` (`deleteComposeTemplateFile.response.200.config.examples.name`; string, required)
      - minLength 1; maxLength 100; example `"Acme invoice"`
    - `data` (`deleteComposeTemplateFile.response.200.config.examples.data`; map<unknown>, required)
- `updatedAt` (`deleteComposeTemplateFile.response.200.updatedAt`; string, optional)

### 400

Validation Error

#### Example

```json
{
  "success": false,
  "error": [
    null
  ],
  "data": null
}
```

- `success` (`deleteComposeTemplateFile.response.400.success`; boolean, required)
  - one of `false`
- `error` (`deleteComposeTemplateFile.response.400.error`; array<unknown>, required)
- `data` (`deleteComposeTemplateFile.response.400.data`; unknown, required)

### 404

Unknown template, or a file outside this template’s bundle.

### 422

The file is the template’s `main` (`main_not_in_files`), or the new `main` is not a `.typ` source (`main_not_typst`).

### 429

Rate limited. The `/v1` API allows at least **67 requests per minute per organization** (about 1,000 requests per 15 minutes) — a guaranteed floor, enforced per edge location, so a geographically spread caller may get more. Wait for the `Retry-After` interval and retry — the error is `retryable`.

#### Example

```json
{
  "code": "rate_limited",
  "message": "string",
  "retryable": true,
  "requestId": "string",
  "docUrl": "string"
}
```

- `code` (`deleteComposeTemplateFile.response.429.code`; string, required)
  - one of `"rate_limited"`
- `message` (`deleteComposeTemplateFile.response.429.message`; string, required)
- `retryable` (`deleteComposeTemplateFile.response.429.retryable`; boolean, required)
  - one of `true`
- `requestId` (`deleteComposeTemplateFile.response.429.requestId`; string, required)
- `docUrl` (`deleteComposeTemplateFile.response.429.docUrl`; string, optional)


Source: https://docs.cloudraker.com/paperwork/api/compose/delete-compose-template-file/index.md
