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

# Bulk manage canned responses with CSV and Google Sheets

> Update, delete, and import canned responses across your whole library with a Google Sheets template and a CSV importer.

This guide is for teams that manage canned responses in bulk: importing a library from an external source, exporting a copy for review, or keeping it up to date when a single change — a new policy, a price, a product name — runs through many responses at once.

By the end of this guide, you'll have a spreadsheet that syncs your changes back to Text, a CSV copy of your existing canned responses library, and an importer that creates them from a CSV file.

Each section is independent, so you can follow all or just the one that matches your goal:

| Goal | Tool |
| - | - |
| Change or delete your responses | [Google Sheet](#edit-canned-responses-in-bulk) |
| Export a copy of your library | [Google Sheet](#export-your-library-to-a-csv-file) |
| Move responses in from an external source | [Importer](#import-canned-responses-from-a-csv) |

## Prerequisites

**You'll need:**

* A [Text account](https://accounts.livechat.com/signup?landing_page=https%3A%2F%2Fwww.text.com%2F\&client_id=fc7bf1555adb6d3d2a441f10fd5b6eb5\&redirect_uri=https%3A%2F%2Fwww.text.com%2Fapp\&response_type=token\&source_type=website\&source_id=content-signup\&source_url=https%3A%2F%2Fwww.text.com%2F) with permission to create personal access tokens.
* For the sheet: a Google account that can run Google Apps Script. A managed Google Workspace account may require its administrator to allow the script.
* For the importer: [Go](https://go.dev/dl/) 1.27 or newer, and [Git](https://git-scm.com/downloads), to clone and run it.

## Edit canned responses in bulk

The sheet matches responses by ID. It updates and deletes the responses it imported, but can't add responses.

**1. Create a personal access token**

In Text, go to **Settings → API access → [Personal access tokens](https://www.text.com/app/settings/integrations/api-access/personal-access-tokens)** and create a token with the `canned_responses--all:rw` and `groups--all:ro` [scopes](https://www.text.com/docs/authentication/scopes.md). Together these let the sheet read every response including private ones, update and delete them in any group, and show team names.

> [!NOTE]
>
> If you only manage the groups you belong to, `canned_responses--groups:rw` can replace `canned_responses--all:rw` — the sheet then imports and syncs only those groups. Keep `groups--all:ro` either way, or the **Team** column shows IDs instead of names.

Copy the Base64-encoded `account_id:PAT` value that Text displays, or note your account ID and the token itself. The panel accepts either.

**2. Copy the sheet**

[Make a copy of the
sheet](https://docs.google.com/spreadsheets/d/1cZHcqPLybyoNjChh9T6yJUKvHdIZNF-0eHoAjEGLCms/copy).
Each copy has its own script and its own connection details, so don't share
one writable copy between accounts.

**3. Set up the template**

In your copy of the template, choose **Text Canned Responses** from the top navigation panel and hit **Set up template**. Authorize the access that Google asks for.

Google shows an unverified-app prompt because the script isn't published as an add-on. Expect it for the copy you made from the link above, and don't authorize a copy of this sheet from anywhere else.

**4. Connect to Text**

In the control panel, go to **1. Connect to Text** and find **Connection details**. Select **Account ID and PAT** or **Base64-encoded token**, enter your connection details in the panel, and hit **Connect**.

The panel keeps those details in your Google user properties and sends them only to the Text API.

**5. Import your responses**

Go to **2. Import responses from Text**. You can limit the import to specific **Team IDs**, or to select **Include my private responses** or **Include all private responses**. Then, hit **Import responses**.

The **Responses** tab fills from row 6. Row 5 holds these headers:

| Column | Header | Description |
| - | - | - |
| A | `ID` | Unique identifier of the canned response in Text. Don't edit it. |
| B | `Text` | The content of the canned response. |
| C | `Shortcuts` | Shortcuts that insert the canned response, separated by commas. At least one is required. |
| D | `Team` | The team the response belongs to, picked from a dropdown. |
| E | `Visibility` | Who can use the response. Possible values: `Shared`, `Private`. |
| F | `Delete` | When ticked, deletes the response in Text on the next sync. |

Columns G to J hold the status the sheet writes as you review and sync.

**6. Edit the canned responses**

Edit cells in columns B to E. Use filters, find and replace, or paste values. A row you didn't edit is never sent to Text.

* To edit a response in a full text box instead of a cell, select any cell in its row and, in the panel, hit **Load selected row** in **Edit a long response**. Change the fields, then hit **Save to sheet**. This updates only the spreadsheet.
* To delete a response, tick its checkbox in column F. Deleting a sheet row doesn't delete the response in Text.
* To sort, use the filter arrows in the header, so that each row moves as a whole.

An edited row shows `Edited` in column G until you review it.

**7. Review the changes**

In **3. Review and apply**, hit **Review changes**. The sheet marks each row as `Modified`, `Delete`, or `Invalid`, and the **Review** tab lists the `Before` and `After` value of every change. Fix every `Invalid` row in the **Responses** tab, using the message in column H, then review again.

When the review is correct, select **I reviewed these changes**. If you marked responses for deletion, also type their exact number in the confirmation field.

**8. Apply the changes**

Hit **Apply reviewed changes**, and keep the panel open until the sync finishes. Each row shows its result in column G. If the sync is interrupted, reopen the panel and hit **Resume sync**. Responses that already synced aren't sent again.

### Verify the sync

Synced rows show `Synced` in column G and a timestamp in column J. Deleted rows show `Deleted`. The sheet reads each response back from Text before it marks it as synced. Open a few responses in the Text app to confirm the text, shortcuts, group, and visibility you set.

If a row shows `Conflict`, the response changed in Text after you imported it, or Text sanitized your text into a different value. Select the row, hit **Load selected row**, and then **Compare current Text version** under **Resolve a conflict**. Choose **Keep my edits** to review your edit against the Text version, or **Use Text version** to replace your edit for that row.

### Limits

* The sync isn't atomic. If you hit **Cancel remaining changes**, the changes already applied in Text stay.
* The sheet rejects a response longer than 45,000 characters.
* Each import, review, and sync cycle uses the token you connected with. To switch tokens, reconnect and import again.
* The sheet compares each response with Text before it writes, so an edit made in Text between that check and the write can still be overwritten.

## Export your library to a CSV file

Use the sheet to download your canned responses as a CSV file, for example as a backup before a bulk edit or to work on them in another tool.

**1. Import the responses**

Create the token, copy the sheet, connect, and import, as described in [Edit canned responses in bulk](#edit-canned-responses-in-bulk). Include private responses if you need them in the file.

**2. Download the Responses tab**

With the **Responses** tab active, choose **File → Download → Comma-separated values (.csv)**. Google downloads only the active tab.

### Verify the export

Open the downloaded file and confirm that it holds one row per imported response and that the `ID` column is filled for every row.

The file has the sheet's columns, `ID` to `Last synced`, and isn't in the format the [importer](#import-canned-responses-from-a-csv) reads. To import it, for example into another Text account, build a CSV with the importer's header from these columns:

| Importer column | Take it from |
| - | - |
| `text` | `Text` |
| `shortcuts` | `Shortcuts`, with the separators changed to `\|` |
| `group_id` | `Team`, replaced with the team's numeric ID from the [List groups](https://www.text.com/docs/api/configuration/v3.6/groups/list-groups.md) method |
| `is_private` | `Visibility`: `true` for `Private`, `false` for `Shared` |

## Import canned responses from a CSV

**1. Create a personal access token**

In Text, go to **Settings → API access → [Personal access tokens](https://www.text.com/app/settings/integrations/api-access/personal-access-tokens)** and create a [token](https://www.text.com/docs/authentication/personal-access-tokens.md) with the `canned_responses--all:rw` [scope](https://www.text.com/docs/authentication/scopes.md), which lets the importer create responses in any group. If you only manage the groups you belong to, `canned_responses--groups:rw` is enough.

Copy the Base64-encoded `account_id:PAT` value that Text displays.

**2. Clone the importer**

Clone the repository and create your `.env` file from the example:

```shell theme={null}
git clone https://github.com/livechat/canned-responses-import-guide.git
cd canned-responses-import-guide
cp .env.example .env
```

**3. Set the token**

In `.env`, replace the placeholder with the Base64-encoded value you copied:

```ini .env theme={null}
TEXT_API_BASIC_AUTH="Basic <base64(account_id:PAT)>"
```

Instead of editing `.env`, you can export `TEXT_API_BASIC_AUTH` with the same value in your shell.

**4. Prepare the CSV**

The importer creates one canned response per row. Copy `canned-responses.example.csv` to `responses.csv`, then replace its rows with your own. The header must be exactly this, in this order, with a value in every column:

```csv theme={null}
text,shortcuts,group_id,is_private
"Thank you for contacting us!","greeting|support",0,false
"We'll get back to you soon.",follow-up,0,false
"Internal note for the team",internal,0,true
```

| Column | Format |
| - | - |
| `text` | The response body. Quote the value if it contains commas or line breaks. Text sanitizes it, and the API rejects a response that is empty after sanitization. |
| `shortcuts` | One or more shortcuts that agents type to insert the response. Separate several with `\|`, for example `greeting\|support`. |
| `group_id` | A non-negative integer for a group in your account. Use `0` for the General group. |
| `is_private` | `true` makes the response private to its owner. `false` shares it with the group. |

The file must be UTF-8. To find group IDs, use the [List groups](https://www.text.com/docs/api/configuration/v3.6/groups/list-groups.md) method.

**5. Run the importer**

```shell theme={null}
go run . --file responses.csv
```

The importer validates the whole file before it sends any request, so a file with an error creates nothing.

### Verify the import

The importer prints `Created X of Y canned responses.` and exits with a nonzero status if any response wasn't created. Open the canned responses in the Text app and confirm that the responses and their shortcuts are there.

> [!WARNING]
>
> Every run creates every row again. The importer doesn't check for duplicates
> and can't resume, so after a partial import, check which responses exist in
> Text and remove those rows from the CSV before you retry.

The importer continues after an error that affects one row, such as an invalid group ID, and prints it with the CSV line number. It stops on authentication, permission, rate-limit, timeout, and server errors, because retrying wouldn't help until you resolve them. A request that times out may have created its response anyway, so check Text before you rerun that row.

## A library you can audit and reuse

With the whole library in one sheet, you can do more than just editing. Audit shortcut collisions, near-duplicate responses, wording that drifted between teams, responses nobody has updated since the product changed — these show up across the set rather than in any one response.

If you're opening a new store, region, or brand, you can also use this flow instead of building a library from scratch. Export the responses you already trust, adjust the wording, set `group_id` to the new group, and import the file. The original library stays as it is. This is the one case where an account that migrated long ago still needs the importer.

## Troubleshooting

| Symptom | Check |
| - | - |
| The sheet shows `Authentication failed` or `Permission denied` | Reconnect in **1. Connect to Text**. The same token resumes a pending sync. A different token needs a fresh import and review, because the sheet ties a sync to the connection that approved it. |
| The review says to replace formulas with literal values | Paste the formula's result as a value into columns A to F. The sheet syncs cell values, not formulas. |
| The sheet shows `Invalid` for a row | Read the reason in column H. A common cause is an empty `Shortcuts` cell. |
| A synced row shows `Conflict` | Follow the conflict steps in [Verify the sync](#verify-the-sync). |
| The sheet pauses at a rate limit | Wait for the period that the panel shows, then hit **Resume sync**. |
| `CSV header must be text,shortcuts,group_id,is_private` | Match the header row to the required names, in the required order. |
| `line N: shortcuts must contain at least one shortcut` | Fill the row's `shortcuts` value, and remove empty entries such as `a\|\|b`. |
| `API returned HTTP 401` or `403` | Confirm the token is valid and carries the scope for this method and group. Create a token with the scopes listed for the tool you're using. |
| `API returned HTTP 429` | Check which responses exist in Text, remove them from the CSV, and retry later. |

***

**Keep exploring**

&#x20;[Configuration API reference](https://www.text.com/docs/api/configuration/)

&#x20;[Personal access
tokens](https://www.text.com/docs/authentication/personal-access-tokens.md)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.