# Gorgias
URL: /reference/blocks/gorgias-manage
Type: reference
Description: Look up support tickets and customers in Gorgias — including a customer's recent ticket history
Keywords: gorgias, gorgias/manage, integrations, block, workflow builder
`gorgias/manage` — Look up support tickets and customers in Gorgias — including a customer's recent ticket history.

Where it appears [#where-it-appears]

The **Gorgias** block lives in the **Integrations** group of the Workflow Builder. Connect the Gorgias integration before adding it.

Fields [#fields]

| Field              | Type                       | Required | Default  | Description                                                                                                                                                                        |
| ------------------ | -------------------------- | -------- | -------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `resource`         | select                     | Yes      | `ticket` | Which Gorgias resource to work with. Options: `ticket`, `customer`.                                                                                                                |
| `operation`        | select                     | Yes      | —        | Which action to perform on the selected resource.                                                                                                                                  |
| `ticketId`         | text (supports references) | No       | —        | The ticket to fetch (or whose messages to list).                                                                                                                                   |
| `filterCustomerId` | text (supports references) | No       | —        | Optionally restrict the list to a single customer's tickets.                                                                                                                       |
| `customerId`       | text (supports references) | No       | —        | The customer to fetch.                                                                                                                                                             |
| `customerLookup`   | text (supports references) | No       | —        | The customer to look up. An email (contains @) is resolved to the customer automatically; otherwise it's treated as a customer ID. Returns the customer plus their recent tickets. |
| `customerQuery`    | text                       | No       | —        | Email (exact match) or a name. An email (contains @) uses the exact email filter; otherwise it searches by name.                                                                   |
| `returnAll`        | toggle                     | No       | `false`  | Fetch every matching record by paginating automatically. When on, Limit is ignored.                                                                                                |
| `limit`            | number                     | No       | `30`     | Maximum number of records to return (for Customer Context, how many recent tickets). Gorgias caps this at 100. Ignored when Return All is on.                                      |

Inputs and outputs [#inputs-and-outputs]

Inputs are the configurable fields above. The block produces these outputs:

**Outputs**

Reference an output downstream with `<Gorgias.field>`.

| Name        | Type    | Description                                                                                                                                                                            |
| ----------- | ------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `success`   | boolean | Operation success status                                                                                                                                                               |
| `ticket`    | json    | Single ticket (Get Ticket) (object — fields: `id`, `subject`, `status`, `channel`, `via`, `customer`, `assignee`, `tags`, `created_datetime`, `updated_datetime`)                      |
| `tickets`   | array   | Tickets (List Tickets, or recent tickets in Customer Context)                                                                                                                          |
| `messages`  | array   | Messages on a ticket (List Messages)                                                                                                                                                   |
| `customer`  | json    | Single customer (Get Customer / Customer Context) (object — fields: `id`, `email`, `name`, `firstname`, `lastname`, `external_id`, `language`, `created_datetime`, `updated_datetime`) |
| `customers` | array   | Matching customers (Search Customers)                                                                                                                                                  |
| `error`     | string  | Error message if failed                                                                                                                                                                |

Example [#example]

A minimal configuration for this block:

```json
{
  "type": "gorgias/manage",
  "config": {
    "resource": "ticket",
    "operation": "...",
    "returnAll": false,
    "limit": 30
  }
}
```

Limits and failure modes [#limits-and-failure-modes]

* Requires a connected Gorgias integration. Calls fail if that integration is disconnected or its authorization has expired.
* Required fields (`resource`, `operation`) must be set, or the block fails validation before it runs.
* On failure the `error` output is populated; downstream blocks that reference other outputs may not receive values.

Related [#related]

* [All workflow blocks](/reference/blocks)
* [Workflow Builder overview](/workflow-builder-overview)
* [Integrations](/integrations)