# Gorgias on boxd

> Gorgias is a helpdesk and live chat platform specializing in e-commerce, offering automated support, order management, and unified customer communication.

- Page: https://boxd.sh/integrations/gorgias/
- CLI: `run gorgias` (32 commands, 1 marked common)
- SDK: `import { gorgias } from "@boxd/run"`; every parameter and response type is at `@boxd/run/gorgias`
- Triggers: none
- Connect: `run auth gorgias` (Sign in with Gorgias), or https://app.boxd.sh/integrations/detail/gorgias
- All integrations: https://boxd.sh/integrations/ (Markdown: https://boxd.sh/integrations/index.md)

## From the shell

```sh
run auth gorgias      # once: prints a link to connect your account
run gorgias           # list its commands
run gorgias list-teams
```

Parameters are flags (`--flag value`); object and array parameters take a JSON string. Output is YAML, or JSON with `--json`. Calls use your own connection; `--scope <name>` uses a connection shared with your team.

## From a script

```ts
import { every, gorgias } from "@boxd/run";

every("1 hour", async () => {
  const result = await gorgias.listTeams({});
  console.log(result);
});
```

Run it with `run gorgias.run.ts`. Gorgias has no triggers; `every()` polls on a schedule, keeps the script running as a job, and wakes the machine when it is due.

## Commands

Required flags are listed; `run gorgias <command> --help` lists the optional ones. "common" marks what `run gorgias` shows without `--all`.

| Command | SDK method | Required flags | Optional | Description |
|---|---|---|---|---|
| `add-ticket-tags` | `gorgias.addTicketTags()` | `--tag-ids` `--ticket-id` | 0 | Adds tags to a ticket in Gorgias |
| `create-account-setting` | `gorgias.createAccountSetting()` | `--name` `--value` | 1 | Creates a new account setting in Gorgias |
| `create-customer` | `gorgias.createCustomer()` | `--name` | 5 | Creates a new customer in Gorgias |
| `create-team` | `gorgias.createTeam()` | `--name` | 3 | Creates a new team in Gorgias |
| `create-ticket` | `gorgias.createTicket()` | `--messages` `--via` | 11 | Creates a new ticket in Gorgias |
| `delete-customer` | `gorgias.deleteCustomer()` | `--customer-id` | 0 | Deletes a specific customer from Gorgias |
| `delete-customer-field-value` | `gorgias.deleteCustomerFieldValue()` | `--customer-id` `--field-id` | 0 | Deletes a specific field value for a customer in Gorgias |
| `delete-customers` | `gorgias.deleteCustomers()` | `--customer-ids` | 0 | Deletes multiple customers from Gorgias |
| `delete-team` | `gorgias.deleteTeam()` | `--team-id` | 0 | Deletes a specific team from Gorgias |
| `delete-ticket` | `gorgias.deleteTicket()` | `--ticket-id` | 0 | Deletes a specific ticket from Gorgias |
| `delete-ticket-field-value` | `gorgias.deleteTicketFieldValue()` | `--field-id` `--ticket-id` | 0 | Deletes a specific field value for a ticket in Gorgias |
| `get-account` | `gorgias.getAccount()` | — | 0 | Retrieves your Gorgias account information |
| `get-customer` | `gorgias.getCustomer()` | `--customer-id` | 0 | Retrieves a specific customer from Gorgias |
| `get-event` | `gorgias.getEvent()` | `--event-id` | 0 | Retrieves a specific event from Gorgias |
| `get-team` | `gorgias.getTeam()` | `--team-id` | 0 | Retrieves a specific team from Gorgias |
| `get-ticket` | `gorgias.getTicket()` | `--ticket-id` | 0 | Retrieves a specific ticket from Gorgias |
| `list-account-settings` | `gorgias.listAccountSettings()` | — | 2 | Lists all account settings in Gorgias |
| `list-customer-field-values` | `gorgias.listCustomerFieldValues()` | `--customer-id` | 0 | Lists all field values for a customer in Gorgias |
| `list-customers` | `gorgias.listCustomers()` | — | 6 | Lists customers in Gorgias with various filtering options |
| `list-events` | `gorgias.listEvents()` | — | 5 | Lists events in Gorgias |
| `list-teams` ·common | `gorgias.listTeams()` | — | 2 | Lists teams in Gorgias |
| `list-ticket-field-values` | `gorgias.listTicketFieldValues()` | `--ticket-id` | 0 | Lists all field values for a ticket in Gorgias |
| `list-ticket-tags` | `gorgias.listTicketTags()` | `--ticket-id` | 0 | Lists all tags for a ticket in Gorgias |
| `list-tickets` | `gorgias.listTickets()` | — | 9 | Lists tickets in Gorgias with various filtering options |
| `merge-customers` | `gorgias.mergeCustomers()` | `--source-customer-id` `--target-customer-id` | 0 | Merges two customers in Gorgias, combining their data and history |
| `remove-ticket-tags` | `gorgias.removeTicketTags()` | `--tag-ids` `--ticket-id` | 0 | Removes tags from a ticket in Gorgias |
| `set-customer-data` | `gorgias.setCustomerData()` | `--customer-id` `--data` | 0 | Sets the complete data object for a customer in Gorgias |
| `set-ticket-tags` | `gorgias.setTicketTags()` | `--tag-ids` `--ticket-id` | 0 | Sets the complete list of tags for a ticket in Gorgias |
| `update-account-setting` | `gorgias.updateAccountSetting()` | `--setting-id` `--value` | 1 | Updates an existing account setting in Gorgias |
| `update-customer` | `gorgias.updateCustomer()` | `--customer-id` | 6 | Updates an existing customer in Gorgias |
| `update-team` | `gorgias.updateTeam()` | `--team-id` | 4 | Updates an existing team in Gorgias |
| `update-ticket` | `gorgias.updateTicket()` | `--ticket-id` | 9 | Updates an existing ticket in Gorgias |

## Docs

- [run CLI](https://docs.boxd.sh/cli/run): Call connected integrations from the shell, connect new ones, and run automations.
- [Quickstart](https://docs.boxd.sh/guides/integrations/quickstart): Connect an integration, call it from the shell, and turn a script into an automation.
- [Connections](https://docs.boxd.sh/guides/integrations/connections): Connect an account once, for yourself or for your whole organization.
- [Scripts](https://docs.boxd.sh/guides/automations/scripts): Typed integrations, triggers, schedules and state in a .run.ts file.
- [Jobs](https://docs.boxd.sh/guides/automations/jobs): How a script becomes a background job: states, retries, sleep and wake.
- [Beyond the catalog](https://docs.boxd.sh/guides/automations/beyond-the-catalog): Reach your own APIs, databases and cloud accounts from a script.
