> For the complete documentation index, see [llms.txt](https://docs.snapfix.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.snapfix.com/how-the-apps-work/screens/compliance/folders.md).

# Folders

{% hint style="info" %}
Draft, written by an agent and not yet checked by a person ([how to read these docs](https://docs.snapfix.com/how-to-read.md)). Platforms: web. [Source on GitHub](https://github.com/snapfix/docs/blob/main/spec/screens/compliance/folders.md).
{% endhint %}

The site's compliance documents in folders: one folder per contractor, or one per system of a chosen system type. Admins search the documents and add, edit, deactivate, reactivate and delete them. It is the only screen that lists inactive documents.

![Folders](https://3653879137-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FsVVGa79QbcEkJ7n8srxe%2Fuploads%2Fgit-blob-2526c4a31bb600182ba8e6d0aab6c012f39c0063%2Ffolders.png?alt=media)

* **Where:** web `/comply`, "Folders" tab. The tab shows no count.
* **Who:** site admins (role "Admin"); see [Dashboard](https://docs.snapfix.com/how-the-apps-work/screens/compliance/dashboard.md#getting-here). The API answers document writes to admins only; the contractor and system lists it reads are open to any member \[[ASK-112](https://github.com/snapfix/docs/blob/main/ASK.md#ask-112-which-comply-reads-should-members-who-are-not-admins-get)].
* **Feature:** [Compliance documents](https://docs.snapfix.com/product/features/compliance/compliance-documents.md)

## Layout

1. **Header:** "Folders", a search box labelled "Search", and two tabs, "Contractors" and "Systems". The page opens on "Contractors".
2. **Folder cards**, one per contractor, or one per system of the chosen type, all closed. Each card shows:
   * the folder's name; it cannot be edited here;
   * a status icon: red when an active document has expired, green when every active document is still valid or has no expiry date, and an empty grey circle when the folder has no active document. A folder keeps its last colour after its last document is deleted;
   * an arrow to open it.
3. **Open folder:** one row per document, inactive ones included, with its stored file name (spaces become underscores) as a link that opens the file in a new tab, its expiry date (DD/MM/YYYY) or "No Expiry Date", and a "⋯" menu; then an "Add Document" button. A row does not show the document's type, and inactive rows carry no label.

The folders come from the contractor list and the system list, which carry each item's documents. Deleted contractors and systems are not listed, so their documents disappear from this screen.

## Inputs

| Field  | Type | Required | Default | Rules and messages                                                                                                                                                                                                                                                                                                       |
| ------ | ---- | -------- | ------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| Search | Text | No       | Empty   | Filters about a second after the last key press, with no request. Shows the folders whose name matches and the folders that hold a document whose name matches; in a folder whose name does not match, only the matching documents show. While the search has text, every folder shown is open. Switching tabs clears it |

## Actions

| Action                                              | Who         | What happens                                                                                                                                                                                                                                                                                                                                                       | API                                                                                                                                                                                                                                                         |
| --------------------------------------------------- | ----------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Open the tab, or "Contractors"                      | Site admins | Lists one folder per contractor                                                                                                                                                                                                                                                                                                                                    | [`GET /v1/app/comply/contractor`](https://docs.snapfix.com/engineering-reference/api/compliance.md#get-v1appcomplycontractor)                                                                                                                               |
| "Systems"                                           | Site admins | Opens [Select a System Type](https://docs.snapfix.com/how-the-apps-work/screens/compliance/timeline.md#select-a-system-type). Choosing a type lists that type's systems as folders. "Cancel" goes back to "Contractors"                                                                                                                                            | [`GET /v1/app/comply/system-type`](https://docs.snapfix.com/engineering-reference/api/compliance.md#get-v1appcomplysystem-type), then [`GET /v1/app/comply/system`](https://docs.snapfix.com/engineering-reference/api/compliance.md#get-v1appcomplysystem) |
| Open or close a folder                              | Site admins | Shows or hides its documents. No request                                                                                                                                                                                                                                                                                                                           | -                                                                                                                                                                                                                                                           |
| Document menu: "Open File"                          | Site admins | Opens the file's link in a new tab. The link is a plain bucket address; on 2026-11-13 a test file opened in the signed-in browser. Whether it opens without a session is not known \[[ASK-115](https://github.com/snapfix/docs/blob/main/ASK.md#ask-115-can-compliance-documents-report-files-and-the-comply-report-be-opened-from-their-link-without-signing-in)] | -                                                                                                                                                                                                                                                           |
| Document menu: "Download"                           | Site admins | Downloads the file under its name                                                                                                                                                                                                                                                                                                                                  | -                                                                                                                                                                                                                                                           |
| Document menu: "Edit Info"                          | Site admins | Opens [Upload a Compliance Document](#upload-a-compliance-document) in edit mode                                                                                                                                                                                                                                                                                   | [`PUT /v1/app/comply/document/{uuid}`](https://docs.snapfix.com/engineering-reference/api/compliance.md#put-v1appcomplydocumentuuid)                                                                                                                        |
| Document menu: "Set As Inactive" or "Set As Active" | Site admins | Flips the document's inactive flag; the row stays here. An inactive document leaves its system's or contractor's "Attachment" card and the Dashboard's counts. An info icon on "Set As Inactive" says the file stays visible only in Folders                                                                                                                       | [`PUT`](https://docs.snapfix.com/engineering-reference/api/compliance.md#put-v1appcomplydocumentuuid) with `inactive`                                                                                                                                       |
| Document menu: "Delete"                             | Site admins | Opens [Delete Document](#delete-document); confirming deletes the document, and the row leaves the folder when the list reloads. The file stays in storage \[[ASK-111](https://github.com/snapfix/docs/blob/main/ASK.md#ask-111-should-a-deleted-documents-file-be-removed)]                                                                                       | [`DELETE /v1/app/comply/document/{uuid}`](https://docs.snapfix.com/engineering-reference/api/compliance.md#delete-v1appcomplydocumentuuid)                                                                                                                  |
| "Add Document"                                      | Site admins | Opens [Upload a Compliance Document](#upload-a-compliance-document) for this folder                                                                                                                                                                                                                                                                                | [`POST /v1/app/comply/document`](https://docs.snapfix.com/engineering-reference/api/compliance.md#post-v1appcomplydocument)                                                                                                                                 |

## States

* **Loading:** no indicator; the folders appear when the list arrives.
* **Empty:** no folders and no text. A folder with no documents shows only "Add Document".
* **Error:** a failed list shows the API's message in the shared alert, and no folders.
* **No permission:** a non-admin never reaches the page.
* **Offline (mobile):** not applicable (web only).

## Dialogs and sheets

### Upload a Compliance Document

One shared dialog, opened from "Add Document" and "Edit Info" here, from the "Attachment" card on [System detail](https://docs.snapfix.com/how-the-apps-work/screens/compliance/system-detail.md) and [Contractor detail](https://docs.snapfix.com/how-the-apps-work/screens/compliance/contractor-detail.md), and from "Add Document" in their Expiry Date dialog. The title is "Upload a Compliance Document", or "Edit a Compliance Document" in edit mode. Opening it loads the site's document types; the server creates the default types when the site has none ([document types](https://docs.snapfix.com/engineering-reference/api/compliance.md#get-v1appcomplydocumenttype)).

**Step 1, the details:**

* "Document Type": the site's types, A to Z, with the placeholder "Select a document type". The first row, "Create new document type +", opens a box; Enter or leaving the box creates the type ([`POST /v1/app/comply/document/type`](https://docs.snapfix.com/engineering-reference/api/compliance.md#post-v1appcomplydocumenttype)). An empty box is sent too, and the refusal shows as an error alert. A name already in use shows "The name has already been taken." in the alert.
* "Folder": the name of the system or contractor the document goes to, read only. The label is written in the code.
* A switch, "Document has no expiry date", off by default. While it is off, "Document Expiry Date" shows a date box ("DD/MM/YYYY" when empty) whose calendar has "Cancel" and "Set".
* Buttons "Cancel" and "Next" ("Save" in edit mode). "Next" stays off until a type is chosen and a date is set or the switch is on.

**Step 2, the file** (upload only): a drop area with "Drag or drop files here, or click to select files", the line "Supported formats: txt, doc, docx, xls, xlsx, pdf, md, epub, csv, json, jpg, jpeg, png, gif eml. Max size: 100Mb.", and a "Choose a file" button. One file at a time; its name shows below. "Save" stays off until a file is taken. A file over 100 MB, or of a type outside the page's list, is dropped with no message, and the list leaves out `.md` and `.eml` although the picker offers them. The server accepts more types than the page, zip among them.

**Save:** an upload creates the document and reloads the page; the stored file name has its spaces replaced by underscores. An edit sends the type and the expiry date, never a new file. The server takes any document type ID on create, also one of another site.

### Delete Document

Title "Delete Document". The message reads "By removing this document, all information entered will be lost." Buttons "Cancel" and "DELETE".

### Select a System Type

The "Systems" tab opens the same picker as the Timeline: see [Timeline](https://docs.snapfix.com/how-the-apps-work/screens/compliance/timeline.md#select-a-system-type). After a type is chosen the tab still reads "Systems".

## Platform differences

Web only. The apps have no folders or document upload ([Comply](https://docs.snapfix.com/how-the-apps-work/screens/compliance/mobile-notice.md)).


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.snapfix.com/how-the-apps-work/screens/compliance/folders.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
