> 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/product/features/chat/task-chat.md).

# Task chat

{% 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)). [Source on GitHub](https://github.com/snapfix/docs/blob/main/product/features/task-chat.md).
{% endhint %}

Every **task** has its own **task chat**: the thread where the people working on it post updates, photos, videos, documents and voice notes, reply to each other and react to messages. Changes to the task are stored as **audit lines** in the same data: some show in the thread, and the rest appear only in the **activity log**. The task chat is part of [Task detail](https://docs.snapfix.com/how-the-apps-work/screens/tasks/task-detail.md). Its messages are stored in the SQL database and served by the API, not in Firestore. The group chats are a different feature: see [Chat](https://docs.snapfix.com/product/features/chat/chat.md).

## Rules

### Who can read and post

* The thread opens for group admins, members with "View All Tasks", the task's creator, its assignees and followers, and the site's multi-site users ([Task permissions](https://docs.snapfix.com/engineering-reference/api/tasks.md#task-permissions)).
* Anyone who can see the task and is not a read-only member can send messages, photos, videos, documents and voice notes (apps only), reply, react and copy ([Task detail](https://docs.snapfix.com/how-the-apps-work/screens/tasks/task-detail.md#who-can-do-what)).
* The message box shows only while the task is editable: not locked, not archived, inside its time range and, on the apps, not a planned task before its day. Read-only members see the chat without the message box ([Task detail](https://docs.snapfix.com/how-the-apps-work/screens/tasks/task-detail.md#states)).
* The API refuses a message to a locked, archived or out-of-range task with "The task can not be updated", and refuses a caller who is not a current member of the group or cannot see the task ([POST /v1/app/chat](https://docs.snapfix.com/engineering-reference/api/chat.md#post-v1appchat)). It does not refuse read-only members \[[ASK-44](https://github.com/snapfix/docs/blob/main/ASK.md#ask-44-should-read-only-members-post-react-and-delete-chat-messages)].
* The chat list endpoint checks no access to the task, so any signed-in user who knows the task's ID can read its chat. The reaction endpoint does not check access either, so anyone can react to any message and push the task's people.

### Messages and limits

* Text is 5,000 characters on the web and 10,000 on iOS. Android cuts longer text to 5,000 characters and adds "..." when it is sent. The server sets no length limit ([Task detail](https://docs.snapfix.com/how-the-apps-work/screens/tasks/task-detail.md#inputs)).
* On the web, an upload takes up to 30 files. Images can be up to 20 MB and videos up to 40 MB. On the apps, videos and documents are limited to 40 MB on Android, and documents to 40 MB on iOS. The server has its own file limit, 100 MB by default ([POST /v1/app/chat/file](https://docs.snapfix.com/engineering-reference/api/chat.md#post-v1appchatfile)).
* Documents need "Access Attachments" to send and to open. Without it the web says "Viewing attachments has been disabled. Contact your administrator" ([Task detail](https://docs.snapfix.com/how-the-apps-work/screens/tasks/task-detail.md#inputs)).
* When the group blocks gallery photos, the web adds no photos or videos from the gallery ([Task detail](https://docs.snapfix.com/how-the-apps-work/screens/tasks/task-detail.md#inputs)).
* Voice notes are sent from the apps only, up to 10 minutes. The apps show a voice note's transcript when one is stored ([Task detail](https://docs.snapfix.com/how-the-apps-work/screens/tasks/task-detail.md#voice-transcript)). The transcript step that Snapfix AI would run for task voice notes is switched off \[[ASK-15](https://github.com/snapfix/docs/blob/main/ASK.md#ask-15-is-snapfix-ai-for-voice-tasks-switched-off-on-purpose)].
* A reply quotes the message it answers. A reply to a deleted message reads "Message has been deleted" ([Task detail](https://docs.snapfix.com/how-the-apps-work/screens/tasks/task-detail.md#task-chat)). A file message can never be a reply, because the file endpoint drops the reply field (api\_php\_live\_v2 @ ef3c4319f6, `CreateJobChatFileRequest.php:17-35`).
* A reaction is one of six emoji, one per person per message; choosing it again removes it ([Task detail](https://docs.snapfix.com/how-the-apps-work/screens/tasks/task-detail.md#chat-actions)). On the web, removing your reaction can remove the wrong one or fail.
* Messages can't be edited or forwarded ([Task detail](https://docs.snapfix.com/how-the-apps-work/screens/tasks/task-detail.md#task-chat)).
* When the site's AI translation switch is on, other people's messages show in your language on all three platforms ([Chat](https://docs.snapfix.com/product/features/chat/chat.md#translation)).
* On the web, "Create Task" on a photo or video message opens [Add a Task](https://docs.snapfix.com/how-the-apps-work/screens/tasks/add-task.md) with the media; on the apps the "+" on the media does the same ([Task detail](https://docs.snapfix.com/how-the-apps-work/screens/tasks/task-detail.md#chat-actions)).

### Audit lines

* The first line says the task was created. Every later change to the task is stored as a line in the task's chat data ([Chat item object](https://docs.snapfix.com/engineering-reference/api/tasks.md#chat-item-object)).
* The thread shows the lines for status, approval, time range, copy or move, checklist signature, snooze and a few others. The list of line types is in [Task detail](https://docs.snapfix.com/how-the-apps-work/screens/tasks/task-detail.md#task-chat).
* The other lines, such as tags, users, title, notes, due dates and time and cost, appear only in the activity log ([Task activity](https://docs.snapfix.com/how-the-apps-work/screens/tasks/task-activity.md), [Tasks](https://docs.snapfix.com/product/features/tasks/tasks.md)).
* Audit lines are HTML, with names put in as they are.
* Opening a task changes its status to match the last status line in the chat, under the viewer's account. The apps also correct the priority \[[ASK-19](https://github.com/snapfix/docs/blob/main/ASK.md#ask-19-should-opening-a-task-correct-its-status-from-the-chat)].

### Deleting

* On the web, the sender can delete their own message, and group admins can delete any message ([Task detail](https://docs.snapfix.com/how-the-apps-work/screens/tasks/task-detail.md#chat-actions)).
* On the apps, only group admins can delete a message. iOS also lets two staff accounts delete any message ([Task detail](https://docs.snapfix.com/how-the-apps-work/screens/tasks/task-detail.md#delete-message)).
* Deleting asks first on every platform. The message disappears for everyone and adds no line ([DELETE /v1/app/chat/{uuid}](https://docs.snapfix.com/engineering-reference/api/chat.md#delete-v1appchatuuid)). The API answers with the text `messages.chat_deleted`, because that translation is missing (`ChatController.php:392`).

### Read state

* Opening the chat list marks the task and its group as viewed for the caller ([Common side effects](https://docs.snapfix.com/engineering-reference/api/tasks.md#common-side-effects)).

### Notifications and updates

* On the web, a new message sends a push to the task's people, with the group and task names, the author and the text. The author's own devices get no push ([POST /v1/app/chat](https://docs.snapfix.com/engineering-reference/api/chat.md#post-v1appchat)).
* The task's people are the group's admins, members who can view all tasks, the assignees and the followers ([Common side effects](https://docs.snapfix.com/engineering-reference/api/tasks.md#common-side-effects)).
* On Android, the app sends the push for each message itself, with a separate request to the notification service. That route accepts any receivers and any text ([Notifications API](https://docs.snapfix.com/engineering-reference/api/notifications.md)).
* The web checks every 15 seconds, while its tab is visible, whether the task changed, and reloads the task if it did ([Task detail](https://docs.snapfix.com/how-the-apps-work/screens/tasks/task-detail.md#when-the-screen-opens)).
* The apps save messages on the phone, show them at once and sync them later. The sync call trusts the rows and IDs in the request without checking the task ([POST ?action=save\_pri\_job\_chat](https://docs.snapfix.com/engineering-reference/api/chat.md#post-actionsave_pri_job_chat)).
* A shared task link shows the chat and leaves out some audit lines ([Sharing tasks](https://docs.snapfix.com/product/features/tasks/task-sharing.md)). It also exposes the authors' contact details and deleted messages.
* The site's chat switch does not hide task chats ([Chat](https://docs.snapfix.com/product/features/chat/chat.md#switching-chat-on-or-off)).

## Flow

```mermaid
flowchart TD
  open["Open a task"] --> see{"Can see the task?"}
  see -- no --> denied["Access denied, back to the list"]
  see -- yes --> edit{"Editable, and not read-only?"}
  edit -- no --> view["Read the chat, no message box"]
  edit -- yes --> write["Type, add a photo, video or document, record a voice note on the apps, or react"]
  write --> where{"Web or app?"}
  where -- web --> api["Send to POST /v1/app/chat or /chat/file"]
  where -- apps --> local["Save on the phone and show at once"]
  local --> sync["Sync uploads any file, then saves the line"]
  api --> line["New line in the task chat"]
  sync --> line
  line --> push["Push to the task's people"]
  change["Status, approval, checklist or other change"] --> audit["Audit line in the chat, or only in the activity log"]
```

## Platforms

| Capability                          | Web                                                    | iOS                                                                                                                                         | Android                                                                                                                                     |
| ----------------------------------- | ------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------- |
| Text                                | yes, 5,000 characters                                  | yes, 10,000 characters                                                                                                                      | yes, cut to 5,000 characters when sent                                                                                                      |
| Photo                               | "+" then "Image", when the group allows gallery photos | camera button or "Add Photo, Video, Sketch or Signature"                                                                                    | same as iOS                                                                                                                                 |
| Video                               | yes, up to 40 MB                                       | yes                                                                                                                                         | yes, up to 40 MB                                                                                                                            |
| Document                            | yes, with "Access Attachments"                         | yes, with "Access Attachments", up to 40 MB                                                                                                 | yes, with "Access Attachments", up to 40 MB                                                                                                 |
| Voice note                          | plays received ones                                    | yes, up to 10 minutes                                                                                                                       | yes, up to 10 minutes                                                                                                                       |
| Transcript                          | no                                                     | yes, when stored \[[ASK-15](https://github.com/snapfix/docs/blob/main/ASK.md#ask-15-is-snapfix-ai-for-voice-tasks-switched-off-on-purpose)] | yes, when stored \[[ASK-15](https://github.com/snapfix/docs/blob/main/ASK.md#ask-15-is-snapfix-ai-for-voice-tasks-switched-off-on-purpose)] |
| Reply                               | yes                                                    | yes, by swiping the message                                                                                                                 | yes                                                                                                                                         |
| React                               | yes, six emoji                                         | yes, six emoji                                                                                                                              | yes, six emoji                                                                                                                              |
| Delete a message                    | the sender, and group admins                           | group admins, and two staff accounts                                                                                                        | group admins                                                                                                                                |
| Create a task from a photo or video | yes, "Create Task" in the message menu                 | yes, "+" on the media                                                                                                                       | yes, "+" on the media                                                                                                                       |
| Translation                         | yes                                                    | yes                                                                                                                                         | yes                                                                                                                                         |
| Works offline                       | no; a failed message can be resent                     | yes, sent when online                                                                                                                       | yes, sent when online                                                                                                                       |

## Screens

* [Task detail](https://docs.snapfix.com/how-the-apps-work/screens/tasks/task-detail.md): the chat, its message menu, reactions, deletes and voice transcripts.
* [Gallery](https://docs.snapfix.com/how-the-apps-work/screens/tasks/gallery.md): the photos, sketches and videos of the chat, full screen.
* [Task activity](https://docs.snapfix.com/how-the-apps-work/screens/tasks/task-activity.md): the audit lines that the chat does not show.
* [Add a Task](https://docs.snapfix.com/how-the-apps-work/screens/tasks/add-task.md) (web): a new task made from a chat photo or video.
* [Shared task](https://docs.snapfix.com/how-the-apps-work/screens/tasks/shared-task.md): the chat as a share link shows it.

## API and data

* Web: [POST /v1/app/chat](https://docs.snapfix.com/engineering-reference/api/chat.md#post-v1appchat) sends text, [POST /v1/app/chat/file](https://docs.snapfix.com/engineering-reference/api/chat.md#post-v1appchatfile) sends a photo, video or document, [POST /v1/app/chat/list](https://docs.snapfix.com/engineering-reference/api/chat.md#post-v1appchatlist) reads a page of lines (20 at a time, older ones on scroll), [POST /v1/app/chat/reaction](https://docs.snapfix.com/engineering-reference/api/chat.md#post-v1appchatreaction) sets a reaction and [DELETE /v1/app/chat/{uuid}](https://docs.snapfix.com/engineering-reference/api/chat.md#delete-v1appchatuuid) deletes a message.
* Apps: the sync sends messages with [POST ?action=save\_pri\_job\_chat](https://docs.snapfix.com/engineering-reference/api/chat.md#post-actionsave_pri_job_chat) and reactions with [POST ?action=save\_pri\_log\_reaction](https://docs.snapfix.com/engineering-reference/api/chat.md#post-actionsave_pri_log_reaction). Voice transcripts are read with [POST ?action=read\_transcripts](https://docs.snapfix.com/engineering-reference/api/chat.md#post-actionread_transcripts), which returns any asked transcripts without checking the task.
* Pushes from the apps: [POST /req-to-notify-user](https://docs.snapfix.com/engineering-reference/api/notifications.md).
* Permissions for a task and its group: [Task permissions](https://docs.snapfix.com/engineering-reference/api/tasks.md#task-permissions). Side effects of a change: [Common side effects](https://docs.snapfix.com/engineering-reference/api/tasks.md#common-side-effects).
* Tables: [`tPri_JobChat`](https://docs.snapfix.com/engineering-reference/db/tables/tpri_jobchat.md) (lines), [`tPri_JobChat_Reaction`](https://docs.snapfix.com/engineering-reference/db/tables/tpri_jobchat_reaction.md) (reactions), [`tPri_Log_JobChat_Reaction`](https://docs.snapfix.com/engineering-reference/db/tables/tpri_log_jobchat_reaction.md) (reaction log), [`tPri_JobChat_VoiceTranscript`](https://docs.snapfix.com/engineering-reference/db/tables/tpri_jobchat_voicetranscript.md) (transcripts) and [`tPub_ChatItemType`](https://docs.snapfix.com/engineering-reference/db/tables/tpub_chatitemtype.md) (line types).

## Depends on

* [Tasks](https://docs.snapfix.com/product/features/tasks/tasks.md): who may see and change the task, and its activity log.
* [Creating tasks](https://docs.snapfix.com/product/features/tasks/task-creation.md): the "created" line, and new tasks made from chat media.
* [Task approval](https://docs.snapfix.com/product/features/tasks/task-approval.md): the "Sent for Approval", "Task Approved" and "Task Rejected" lines.
* [Checklists](https://docs.snapfix.com/product/features/checklists/checklists.md): the checklist signature line.
* [Sharing tasks](https://docs.snapfix.com/product/features/tasks/task-sharing.md) and [Task reports](https://docs.snapfix.com/product/features/reports/task-reports.md): the share link and the report show the chat.
* [Snapfix AI](https://docs.snapfix.com/product/features/ai/snapfix-ai.md): reads a task's messages when asked, and would make voice transcripts.
* [Push notifications](https://docs.snapfix.com/product/features/notifications/push-notifications.md): the pushes about task messages.
* [Groups](https://docs.snapfix.com/product/features/groups/groups.md) and [Group members](https://docs.snapfix.com/product/features/groups/group-members.md): the roles that decide who may post, and the "Create New Task" and "Access Attachments" permissions.
* [Chat](https://docs.snapfix.com/product/features/chat/chat.md): the group chats use the same message look and translation, but their data is separate.

## Edge cases

* **Offline (apps):** a message is saved on the phone at once and sent when the phone is online ([Task detail](https://docs.snapfix.com/how-the-apps-work/screens/tasks/task-detail.md#states)).
* **Failed send (web):** the message stays with a "Resend" option ([Task detail](https://docs.snapfix.com/how-the-apps-work/screens/tasks/task-detail.md#chat-actions)).
* **Locked, archived, out of time range or a planned task before its day:** no message box ([Task detail](https://docs.snapfix.com/how-the-apps-work/screens/tasks/task-detail.md#states)).
* **Read-only member:** no message box on the apps or the web. The API still accepts messages \[[ASK-44](https://github.com/snapfix/docs/blob/main/ASK.md#ask-44-should-read-only-members-post-react-and-delete-chat-messages)].
* **Deleted task:** the screen goes back to the list. When someone else deletes the task while it is open, the apps close it ([Task detail](https://docs.snapfix.com/how-the-apps-work/screens/tasks/task-detail.md#states)).
* **Several sites:** a task belongs to one site. Opening it on the web switches the site ([Task detail](https://docs.snapfix.com/how-the-apps-work/screens/tasks/task-detail.md#when-the-screen-opens)).
* **Time:** the apps give a message the phone's clock time, so a wrong clock gives a wrong time.
* **Transcripts:** a voice note may have no transcript, because the Snapfix AI transcript step is off \[[ASK-15](https://github.com/snapfix/docs/blob/main/ASK.md#ask-15-is-snapfix-ai-for-voice-tasks-switched-off-on-purpose)].


---

# 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/product/features/chat/task-chat.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.
