# Gorgias

## Prerequisites

* A Gorgias account with admin access
* Your Gorgias domain, username, and API key

## Setup

### Step 1: Enable Gorgias in Alhena

1. In Alhena, go to **Settings > Integrations**
2. Find **Gorgias** and click **Enable**
3. Click **Configure Settings**

### Step 2: Get Your Gorgias API Credentials

1. In Gorgias, go to **Settings > REST API**
2. Copy your domain, username, and API key

### Step 3: Connect Gorgias

1. Paste your Gorgias domain, username, and API key into Alhena
2. Click **Connect**

You can now enable human transfer from the Alhena chat widget and choose a team in Gorgias where incoming tickets should be assigned.

***

## Email Tickets

Alhena can automatically respond to email tickets in your Gorgias account. Enable the Email setting from the Gorgias settings page in Alhena.

Alhena only replies to tickets assigned to the "Alhena AI" agent. When human transfer is needed, tickets are assigned to your configured Human Transfer Group.

### Setting Up an Automation Rule

To have Alhena automatically handle incoming emails, create a rule to assign them to Alhena AI:

1. Follow the "Create a rule" link to Gorgias
2. Click **Create Rule** in the upper right corner
3. Click **Create Custom Rule**
4. Configure the rule to assign email tickets to Alhena when created


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://alhena.gitbook.io/docs/integrations/helpdesk/integrating-alhena-with-gorgias.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
