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

# Connect Gorgias with an agent email + REST API key

> Credentials are verified against Gorgias live before storage. Replacing an existing connection requires confirm_replace.

Credentials are verified against Gorgias live before storage. Replacing an existing connection requires confirm\_replace.

### Request body

`ConnectGorgias`

**domain** `string` *required*

The Gorgias account domain, e.g. 'acme' or 'acme.gorgias.com'. Minimum length: `1`. Maximum length: `100`.

**email** `string (email)` *required*

The Gorgias agent email the API key belongs to. Maximum length: `200`.

**api\_key** `string` *required*

An API key from Settings → You → REST API. Minimum length: `10`. Maximum length: `200`.

**confirm\_replace** `boolean`

Required (true) when the organization already has a Gorgias connection — connecting replaces it.

### Response

`object`

**object** `string` *required*

Allowed values: `'integration.connection'`.

**provider** `string` *required*

Allowed values: `'gorgias'`.

**connected** `boolean` *required*

Allowed values: `true`.

**domain** `string` *required*

The normalised Gorgias account handle (without `.gorgias.com`).

**next\_action** `string` *required*

### Status codes

| Code | Meaning |
| - | - |
| `200` | The verified connection. The credentials were validated with a live call to the account before being stored. |
| `400` | Invalid request. `issues` names the offending field(s). |
| `401` | Missing, invalid, or expired API key. |
| `403` | The key lacks a required scope. |
| `409` | Conflict — either the creation ceiling was reached for this organization (`agent_limit_reached`), or a request with the same Idempotency-Key is still in flight (`idempotency_in_progress`); retry the latter after the first attempt settles. |
| `429` | Rate limit exceeded. |

### Access

| | |
| - | - |
| Required scope | `agents:write` |
| Rate limit | 30 requests per minute |

### Using this contract

Read the [source OpenAPI document](https://docs.stateset.com/spec/responsecx.json) for declared schemas and alternatives.
This page also includes documented corrections from the [spec overlays](https://github.com/stateset/docs/tree/main/spec/overlays).
Example IDs and values are illustrative; replace them with records from your workspace.

```bash cURL theme={null}
curl --silent --show-error --fail-with-body --request POST \
  --url 'https://response.stateset.com/api/v1/integrations/gorgias' \
  --header "Authorization: Bearer $RESPONSECX_API_KEY" \
  --header 'Content-Type: application/json' \
  --data '{
  "domain": "string",
  "email": "ada.lovelace@example.com",
  "api_key": "YOUR_API_KEY",
  "confirm_replace": true
}'
```

```json 200 theme={null}
{
  "object": "integration.connection",
  "provider": "gorgias",
  "connected": true,
  "domain": "string",
  "next_action": "string"
}
```


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