Gorgias
Get Gorgias Connection
Returns the tenant's Gorgias connection, or `data: null` when Gorgias is not connected. A tenant has at most one Gorgias connection; it serves both order support and repairs.
Connect Gorgias
Connects Gorgias with a REST API key (Gorgias → Settings → REST API). The credentials are checked with Gorgias's `GET /api/account` before anything is saved. A shared webhook secret (32 random bytes, base64url) is generated when the connection has none.
Update Gorgias Connection
Edits the connection. Every key is optional; only what is sent changes.
Disconnect Gorgias
Removes what SKU.io created in Gorgias (the order sidebar integration, its widget and the two macros, found by stored id or by pointing at this connection's endpoint; an object already deleted in Gorgias counts as removed), then deletes the connection. Repairs stop receiving Gorgias tickets too, since it is the same connection.
Test Gorgias Connection
Checks the stored credentials against Gorgias (`GET /api/account`) and records the result as the connection's last success or last error. An app (OAuth) connection refreshes its access token first when needed.
Rotate Gorgias Webhook Secret
Issues a new shared secret. The old one stops working at once, so calls from Gorgias fail until Set Up Gorgias Objects runs again and updates the header everywhere.
Get Gorgias App Authorization URL
Starts connecting with the SKU.io Gorgias app (OAuth2). Returns the Gorgias authorization URL (`https://{domain}.gorgias.com/oauth/authorize` with `response_type=code`, `client_id`, `scope`, `redirect_uri`, `state` and `nonce`). Send the user there; Gorgias redirects back with `code` and `state`, which you pass to Complete Gorgias App Authorization. The `state` is single use, expires after 15 minutes and is bound to the user who started it.
Complete Gorgias App Authorization
Exchanges the authorization `code` for tokens, checks them with Gorgias and saves the connection with `auth_type: oauth` (updating the existing Gorgias connection if there is one). Access tokens last 24 hours and are refreshed automatically before they expire.
Get Gorgias AI Agent Setup Values
Returns the copy-ready values for every Gorgias AI Agent action and Flow step SKU.io supports (`ai_action_status`, `ai_action_cancel`, `ai_action_hold`, `ai_action_address`, `ai_action_reship`, `ai_action_return`, `ai_action_refund`, `ai_action_stock`, `flow_order_status`, `flow_request_cancel`) plus the `mcp_prompt` text, with the full shared secret in `manual.headers`. It is a POST that needs write access on purpose: Get Gorgias Connection only shows the secret's last 4 characters.
Set Up Gorgias Objects
Creates or updates, through the Gorgias API, everything Gorgias needs to show SKU.io orders and act on them:
List Gorgias Activity
Every call Gorgias made into SKU.io for this connection (ticket views, order status, cancels, holds, releases, address changes, reships, returns, refunds) plus each Set Up Gorgias Objects run, newest first. Rows are kept for 180 days.
Get Gorgias Insights
Support insights for a date range: how many tickets orders generate, what Gorgias asked SKU.io to do, the proactive tickets SKU.io raised, and the products and carriers behind tickets.