> 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/contractor-detail.md).

# Contractor detail

{% 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/contractor-detail.md).
{% endhint %}

One contractor: its name and status, service type, expiry date, alert window, frequency, contact details and note, its documents, its assigned users and its assets. Unlike a system, it has no activity tab.

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

* **Where:** web `/comply/contractor/:id`, from [Contractors](https://docs.snapfix.com/how-the-apps-work/screens/compliance/contractors.md), the [Timeline](https://docs.snapfix.com/how-the-apps-work/screens/compliance/timeline.md), the [Dashboard](https://docs.snapfix.com/how-the-apps-work/screens/compliance/dashboard.md#document-list) and the contractor chip on [System detail](https://docs.snapfix.com/how-the-apps-work/screens/compliance/system-detail.md).
* **Who:** site admins (role "Admin"); see [Dashboard](https://docs.snapfix.com/how-the-apps-work/screens/compliance/dashboard.md#getting-here). The API refuses writes from anyone else.
* **Feature:** [Contractors](https://docs.snapfix.com/product/features/compliance/contractors.md); the "Attachment" card is part of [Compliance documents](https://docs.snapfix.com/product/features/compliance/compliance-documents.md).

## Layout

1. **Header:** the breadcrumb "Comply" > "Contractors".
2. **Title row:** a back button (title "Back"), the contractor's name with a pencil, the traffic light, and an "Actions" button ("⋯") whose only item is "Delete Contractor". "Back" goes to the previous page in the app's route history.
3. **Traffic light:** as on [System detail](https://docs.snapfix.com/how-the-apps-work/screens/compliance/system-detail.md#layout): it follows the expiry date and the alert days, and a click does nothing.
4. **Left column:** "Service Type"; "Expiry Date", "Expiry Alert" and "Frequency", as on [System detail](https://docs.snapfix.com/how-the-apps-work/screens/compliance/system-detail.md#layout); "Contact Name", "Email" and "Phone Number" (a country picker and a "Number" box); "Notes"; and the "Attachment" card, as on [System detail](https://docs.snapfix.com/how-the-apps-work/screens/compliance/system-detail.md#layout) but always shown.
5. **Right column:** "Users" with "Created by" and "Assigned to", and "Assets".

## Inputs

| Field         | Type                                                                                                         | Required       | Default                 | Rules and messages                                                                                                                                                                                                                        |
| ------------- | ------------------------------------------------------------------------------------------------------------ | -------------- | ----------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Name          | Text                                                                                                         | Yes            | Current name            | Edited with the pencil only. Enter saves; leaving the box saves too. An empty box is not saved and stays open, on Enter and on leaving it                                                                                                 |
| Service Type  | Text                                                                                                         | No             | Current                 | Sent on Enter and when the box loses focus                                                                                                                                                                                                |
| Expiry Date   | Date                                                                                                         | No             | None                    | As on [System detail](https://docs.snapfix.com/how-the-apps-work/screens/compliance/system-detail.md#inputs)                                                                                                                              |
| Expiry Alert  | 7, 30, 60, 90 or 180 days, or a custom number                                                                | No             | 30 for a new contractor | As on [System detail](https://docs.snapfix.com/how-the-apps-work/screens/compliance/system-detail.md#inputs)                                                                                                                              |
| Frequency     | One of the twelve frequencies                                                                                | No             | "None"                  | As on [System detail](https://docs.snapfix.com/how-the-apps-work/screens/compliance/system-detail.md#inputs)                                                                                                                              |
| Contact Name  | Text                                                                                                         | No             | Current                 | Sent on Enter and when the box loses focus                                                                                                                                                                                                |
| Email         | Text                                                                                                         | No             | Current                 | Sent on Enter and when the box loses focus. The page checks no format. The API refuses an address that fails its email rule, and the message shows in the shared alert; an address with no domain ending, such as "jane\@example", passes |
| Phone Number  | Country and number                                                                                           | No             | Current                 | Saved half a second after typing stops, and at once when the country changes. An empty or invalid number is not saved                                                                                                                     |
| Note          | Text                                                                                                         | No             | Empty                   | As on [System detail](https://docs.snapfix.com/how-the-apps-work/screens/compliance/system-detail.md#inputs)                                                                                                                              |
| Users, Assets | As on [System detail](https://docs.snapfix.com/how-the-apps-work/screens/compliance/system-detail.md#inputs) | No             | None                    |                                                                                                                                                                                                                                           |
| Document      | Type, expiry date and file                                                                                   | Yes, to upload | -                       | Set in [Upload a Compliance Document](https://docs.snapfix.com/how-the-apps-work/screens/compliance/folders.md#upload-a-compliance-document)                                                                                              |

## Actions

| Action                                                            | Who         | What happens                                                                                                                                                                                                                                                                            | API                                                                                                                                                                                                                                                                                                                                             |
| ----------------------------------------------------------------- | ----------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Open the page                                                     | Site admins | Loads the contractor with its assets, assigned users and documents, then the frequency list and the site's users                                                                                                                                                                        | [`GET /v1/app/comply/contractor/{uuid}`](https://docs.snapfix.com/engineering-reference/api/compliance.md#get-v1appcomplycontractoruuid), [frequencies](https://docs.snapfix.com/engineering-reference/api/compliance.md#get-v1appfrequencies), [users](https://docs.snapfix.com/engineering-reference/api/users.md)                            |
| Edit the name                                                     | Site admins | Saves the name, then reloads the contractor                                                                                                                                                                                                                                             | [`PUT /v1/app/comply/contractor/{uuid}`](https://docs.snapfix.com/engineering-reference/api/compliance.md#put-v1appcomplycontractoruuid) with `name`                                                                                                                                                                                            |
| Edit the service type, contact name or email                      | Site admins | Saves the field on Enter or when the box loses focus.                                                                                                                                                                                                                                   | [`PUT`](https://docs.snapfix.com/engineering-reference/api/compliance.md#put-v1appcomplycontractoruuid) with `serviceType`, `contactName` or `email`                                                                                                                                                                                            |
| Edit the phone number                                             | Site admins | Saves the country and the number                                                                                                                                                                                                                                                        | [`PUT`](https://docs.snapfix.com/engineering-reference/api/compliance.md#put-v1appcomplycontractoruuid) with `mobile`                                                                                                                                                                                                                           |
| Set the expiry date, the alert or the frequency, or save the note | Site admins | As on [System detail](https://docs.snapfix.com/how-the-apps-work/screens/compliance/system-detail.md#actions)                                                                                                                                                                           | [`PUT`](https://docs.snapfix.com/engineering-reference/api/compliance.md#put-v1appcomplycontractoruuid) with `expiryTs`, `expiryAlertDays`, `frequencyDescription` or `note`                                                                                                                                                                    |
| Assign or unassign users                                          | Site admins | As on [System detail](https://docs.snapfix.com/how-the-apps-work/screens/compliance/system-detail.md#actions): the "Users" dialog keeps one user \[[ASK-113](https://github.com/snapfix/docs/blob/main/ASK.md#ask-113-should-a-system-or-contractor-have-one-assigned-user-or-several)] | [`POST /v1/app/comply/contractor/assign`](https://docs.snapfix.com/engineering-reference/api/compliance.md#post-v1appcomplycontractorassign), [`POST /v1/app/comply/contractor/unassign`](https://docs.snapfix.com/engineering-reference/api/compliance.md#post-v1appcomplycontractorunassign)                                                  |
| Link or unlink assets                                             | Site admins | As on [System detail](https://docs.snapfix.com/how-the-apps-work/screens/compliance/system-detail.md#actions)                                                                                                                                                                           | [`POST /v1/app/comply/contractor/link-asset`](https://docs.snapfix.com/engineering-reference/api/compliance.md#post-v1appcomplycontractorlink-asset), [`POST /v1/app/comply/contractor/unlink-asset`](https://docs.snapfix.com/engineering-reference/api/compliance.md#post-v1appcomplycontractorunlink-asset)                                  |
| Documents                                                         | Site admins | Upload, open, download, edit, set inactive and delete, as on [System detail](https://docs.snapfix.com/how-the-apps-work/screens/compliance/system-detail.md#actions). The folder is the contractor's name                                                                               | [`POST /v1/app/comply/document`](https://docs.snapfix.com/engineering-reference/api/compliance.md#post-v1appcomplydocument), [`PUT`](https://docs.snapfix.com/engineering-reference/api/compliance.md#put-v1appcomplydocumentuuid), [`DELETE`](https://docs.snapfix.com/engineering-reference/api/compliance.md#delete-v1appcomplydocumentuuid) |
| "Delete Contractor"                                               | Site admins | Opens [Delete Contractor](#delete-contractor). Confirming deletes the contractor and goes back in the route history, or to `/comply` when there is none                                                                                                                                 | [`DELETE /v1/app/comply/contractor/{uuid}`](https://docs.snapfix.com/engineering-reference/api/compliance.md#delete-v1appcomplycontractoruuid)                                                                                                                                                                                                  |

As on systems, the server accepts users and assets of other sites in the assign and link calls.

## States

* **Loading:** a spinner in place of the page until the contractor arrives. If it never arrives, the spinner stays.
* **Empty:** the "Attachment" card shows only its "+"; "Assigned to" and "Assets" offer their add control.
* **Error:** a failed save shows the API's message in the shared alert.
* **No permission:** a non-admin never reaches the page. The API answers "Access denied" to a write from a non-admin.
* **Offline (mobile):** not applicable (web only).

## Dialogs and sheets

### Delete Contractor

Title "Delete Contractor". The message reads "Deleting this Contractor will permanently deleted their info. However, documents will remain available in Folders. This action cannot be undone.". Buttons "Cancel" and "DELETE". The documents do not stay reachable: Folders lists only live contractors, so the deleted contractor's folder and documents disappear.

The Expiry Date, Expiry Alert, Frequency, Users, Assets and upload dialogs are those of [System detail](https://docs.snapfix.com/how-the-apps-work/screens/compliance/system-detail.md#dialogs-and-sheets).

## Platform differences

Web only. The apps have no contractor screens ([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/contractor-detail.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.
