canonical: https://jentic.com/apis/gorgias.com/gorgias-gorgias

# Gorgias API

Jentic publishes the only available OpenAPI specification for Gorgias API, keeping it validated and agent-ready. The Gorgias API is a RESTful interface for the Gorgias helpdesk platform built for e-commerce, covering tickets, customers, macros, integrations, tags, teams, and account settings across 17 endpoints. Authentication uses HTTP Basic with the merchant email and an account API key, scoped per Gorgias subdomain. This spec focuses on the most-used helpdesk objects and is suited to lightweight automations and AI agent integrations.

## For AI agents

Manage Gorgias helpdesk tickets, customers, messages, macros, and tags so agents can read and reply to e-commerce support conversations.

## Scope

Does not handle inventory, order processing, or marketing email - use for Gorgias helpdesk tickets, customers, and macros only.

## Capabilities

- Create a support ticket linked to a customer with channel and subject metadata
- Append a public or internal message to an existing ticket thread
- Look up a customer by email or external_id to attach context to a reply
- Apply a macro by id to populate a templated response inside a ticket
- Tag tickets to drive routing, reporting, and SLA workflows
- List installed integrations and surface their configuration status
- Inspect team membership for assignment and load-balancing logic

## Use cases

### Automated Order Status Replies

When a shopper messages support asking 'where is my order?', a workflow looks up the order in the e-commerce platform, then POSTs a message to `/tickets/{id}/messages` with the tracking link and a closing macro. The integration attaches the right tags and assigns the ticket to the shipping team via teams metadata.

Example prompt: Append a public message to ticket 4567890 with the tracking URL https://tracking.example.com/ABC123, apply macro 'order-shipped', and add tag 'shipping-resolved'.

### Customer Profile Enrichment

Before an agent replies, hit /customers?email=shopper@example.com to fetch the existing Gorgias customer, merge in firmographic data from a CRM, and show order history alongside the ticket. The enriched profile shortens response time and makes the next message context-aware.

Example prompt: Look up the customer by email shopper@example.com on /customers, capture the customer id, and attach an internal note to the open ticket with their last 5 order ids.

### Macro-Driven Refund Workflow

Implement consistent refund replies by applying a pre-approved macro to `/tickets/{id}` when a refund is granted. The macro inserts the canonical apology, refund amount placeholder, and signature, while the integration records the refund event in the merchant's accounting system. Tags drive reporting on refund volume by reason.

Example prompt: Apply macro id 234 ('full-refund-shipping-damaged') to ticket 5566778, tag the ticket 'refund-issued', and set status to 'resolved'.

### AI Agent Triage and Routing

An AI agent reads new tickets, classifies the intent (refund, order status, sizing question), tags them, and assigns the right team. Through Jentic, the agent discovers POST `/tickets/{id}/messages` and PUT `/tickets/{id}` by intent and uses a vault-stored API key, never exposing the helpdesk credentials in its prompt.

Example prompt: Classify ticket 6677889 as 'sizing-question', tag it accordingly, assign to team id 12 ('Apparel CX'), and post an internal note explaining the decision.

## Key endpoints

| Method | Path | Description |
| --- | --- | --- |
| GET | `/account` | Retrieve the authenticated account info |
| GET | `/tickets` | List tickets with filters |
| GET | `/tickets/{id}` | Retrieve a ticket by id |
| GET | `/tickets/{id}/messages` | List messages on a ticket |
| GET | `/customers` | Search customers by email or id |
| GET | `/macros` | List response macros |
| GET | `/tags` | List available tags |

## Key resources

- **Tickets** — Create, retrieve, update tickets and append messages
- **Customers** — Search and retrieve customer profiles by email or id
- **Macros** — List and apply pre-approved response templates
- **Tags** — Manage labels used for routing and reporting
- **Teams and Users** — Inspect agent team structure for assignment logic
- **Integrations** — List connected channels and apps for the helpdesk

## Why Jentic

- **Setup:** Wiring the Gorgias API by hand means setting up basic auth with the account email and API key, resolving the {domain}.gorgias.com/api host per account, and matching ticket and customer calls yourself. Through Jentic you install once, import the Gorgias API from the API Directory, store the email and key once, and your agent calls it.
- **Permission scoping:** The Gorgias API puts the ticket id in the URL path (`/tickets/{id}/messages`), so a rule can pin your agent to one ticket: it can read that ticket and its messages and nothing else. You choose the operations it may call, so replying to tickets or editing macros is not included unless you add them.
- **Credential handling:** Your Gorgias account email and API key are stored once, encrypted, by your own Jentic One instance and injected at execution time as the basic auth header. They never enter the agent's prompt, logs, or context.
- **Discovery method:** Agents search Jentic by intent such as 'read a support ticket's messages' or 'list helpdesk macros', and Jentic returns the matching tickets or macros operation with its input schema so the agent calls the right endpoint without browsing the reference docs.

## Related APIs

- **Zendesk Support** — General-purpose helpdesk with broad channel and reporting coverage
- **Freshdesk** — Mid-market helpdesk with omnichannel ticketing
- **Intercom** — Conversational messaging and product engagement platform

## FAQ

### Why is there no official OpenAPI spec for Gorgias API?

Gorgias does not publish an OpenAPI specification. Jentic generates and maintains this spec so that AI agents and developers can call Gorgias API via structured tooling. It is validated against the live API and kept up to date. Get started with Jentic One, the self-hosted execution layer.

### What authentication does the Gorgias API use?

HTTP Basic. Use your Gorgias account email as the username and an API key generated from the Gorgias settings as the password, scoped to the merchant subdomain in the base URL https://{domain}.gorgias.com/api. Through Jentic, the credentials are kept in the encrypted vault and never enter the agent's prompt window.

### Can I post a reply to a ticket through the Gorgias API?

Yes. POST `/tickets/{id}/messages` with the channel, sender, body, and visibility (public to email the customer, internal for an agent-only note). The endpoint returns the new message object with its id and timestamps for downstream tracking.

### How do I look up a Gorgias customer by email?

GET /customers with a query parameter such as email=shopper@example.com returns the matching customer record, including the internal customer id, channels, and external identifiers used to merge with your CRM.

### How do I integrate the Gorgias API with an AI agent through Jentic?

Run pip install jentic, search 'reply to a gorgias ticket' to find POST `/tickets/{id}/messages`, load the schema, and execute. Jentic injects the Basic auth header from the vault. Get started with Jentic One, the self-hosted execution layer.

### Can I limit what my agent is allowed to do with the Gorgias API?

Yes. Because you run Jentic One yourself, you decide which Gorgias operations your agent may call, so you can allow it to read tickets, messages, and customers while withholding actions like replying via POST `/tickets/{id}/messages` or editing macros. Since the Gorgias API carries the ticket id in the URL path, such as `/tickets/{id}/messages`, your own rules can pin the agent to a single ticket so it reads only that ticket and its messages and nothing else. Your account email and API key stay under your control and are added to a request only when a call you have permitted runs.
