Closed beta · run Worlds on your machineBrowse worlds →
Docs menu · Gorgias API

Worlds / Support

Gorgias API

A local Gorgias helpdesk with tickets, customers, macros, rules and Shopify order context on each ticket. Test the ecommerce support agent that reads the order, replies and refunds.

Base path
/api
Auth
Basic auth with email and API key, the world key
Endpoints
15
Status
Active today

This reference previews the surface the Gorgias world serves in the closed beta. Paths mirror the public Gorgias API; the exact subset is confirmed when your workflow is scoped.

Connect

The run gives your agent these bindings. Keep your SDK; change only where it sends requests.

bindingmeaning
WORLDS_GORGIAS_URLThis world's origin followed by /api
WORLDS_API_KEYThe world key, accepted wherever Gorgias expects a credential
WORLDS_WORLD_IDThe isolated world's identity
js · fetch
const base = process.env.WORLDS_GORGIAS_URL;
const auth = "Basic " + btoa("agent@example.test:" + process.env.WORLDS_API_KEY);

const res = await fetch(base + "/tickets?limit=20", {
  headers: { Authorization: auth, Accept: "application/json" },
});
const { data } = await res.json();

API reference

Tickets

Customer conversations from email, chat and social.

  • GET/api/ticketsList tickets
  • POST/api/ticketsCreate a ticket
  • GET/api/tickets/{id}Get a ticket
  • PUT/api/tickets/{id}Update a ticket
  • DELETE/api/tickets/{id}Delete a ticket
Fields · 7
idintegerTicket id
subjectstringSubject
statusstringopen or closed
prioritystringlow, normal, high or urgent
customerobjectCustomer on the ticket
assignee_userobjectAssigned agent
tagsarrayTags

Messages

Replies and internal notes on a ticket.

  • GET/api/tickets/{ticket_id}/messagesList messages
  • POST/api/tickets/{ticket_id}/messagesCreate a message
  • GET/api/tickets/{ticket_id}/messages/{id}Get a message
Fields · 5
idintegerMessage id
ticket_idintegerTicket
channelstringemail, chat, api or internal-note
body_textstringPlain-text body
from_agentbooleanSent by an agent

Customers

People who contact your store.

  • GET/api/customersList customers
  • POST/api/customersCreate a customer
  • GET/api/customers/{id}Get a customer
  • PUT/api/customers/{id}Update a customer
Fields · 5
idintegerCustomer id
namestringFull name
emailstringEmail address
channelsarrayKnown contact channels
dataobjectLinked store data

Tags

Labels used to sort tickets.

  • GET/api/tagsList tags
  • POST/api/tagsCreate a tag
  • POST/api/tickets/{ticket_id}/tagsAdd tags to a ticket
Fields · 3
idintegerTag id
namestringTag name
decorationobjectColor

Test workflow

  1. Prepare. Select the Gorgias setup for your workflow and review its starting records, including tickets, messages, customers.
  2. Connect. Configure your agent with this world's URL and key using the SDK example. Check that it reaches the intended API before running a test.
  3. Define. Describe the task, expected final changes and records that must stay untouched. Keep expected outcomes separate from the agent's instructions.
  4. Run and inspect. Use the dashboard or your workflow's generated CLI setup. Review final records and changes, then rerun from the same starting setup with the relevant failure conditions. Use Deployment and CI to automate the same workflow.

What to verify

  • Order #1043 refunded for one mug, not the order
  • Order #1044 has no refund
  • #1044 ticket uses the Exchange macro
  • Every closed ticket has an outbound reply
  • Order #1046 address unchanged until a human approves

Test file

A task file names the jobs, the policy your agent is given and what the grader reads back from the world's final state. The agent never sees the expected outcomes.

yaml · worlds/tasks.yaml
# worlds/tasks.yaml · Gorgias
version: 2
connector: gorgias
seed: gorgias-starter
mode: isolated
policy: >
  Clear the overnight queue. Damaged items get a refund for that item only.
  Wrong size means an exchange, not a refund. Close tickets only after the
  reply is sent.
tasks:
  - id: look-up-the-order-on-a-ticket-and-answer-where-it-is
    prompt: Look up the order on a ticket and answer where it is
  - id: apply-a-refund-macro-for-a-damaged-item
    prompt: Apply a refund macro for a damaged item
  - id: tag-and-close-tickets-once-the-customer-is-answered
    prompt: Tag and close tickets once the customer is answered
expected:
  - "Order #1043 refunded for one mug, not the order"
  - "Order #1044 has no refund"
  - "#1044 ticket uses the Exchange macro"
  - Every closed ticket has an outbound reply
  - "Order #1046 address unchanged until a human approves"
scenarios:
  - rate-limited
  - order-already-refunded
  - integration-disconnected

See Tasks and outcomes for every field, and Deployment and CI to run the file on every pull request.

Failure conditions

Each one fires before the handler, at the same step on every run.

conditionwhat the agent sees
rate-limited429 from the tickets endpoint during a bulk close
order-already-refundedThe Shopify action fails because the item was refunded
integration-disconnectedThe store token expires and the sidebar shows no orders
rule-races-the-agentAn auto-close rule fires before the reply lands

Starting data

Start each run from the same records and relationships. The overview below describes the Gorgias starter; use the setup supplied for your workflow when preparing your own snapshot.

RecordsStarting setup
tickets40 open and closed, email and chat channels
customers35 with linked Shopify orders
orders60 in the sidebar, paid, fulfilled and refunded
macrosWISMO, Damaged item refund, Exchange
rulesAuto-tag WISMO, close spam

The record shapes below reuse this world's API field definitions. They show illustrative values and placeholders, not an importable seed. API responses and seed input can differ; include all required records and references in the accepted import format for your workflow.

Tickets records

Tickets

Customer conversations from email, chat and social.

FieldTypeMeaning / relationship
idintegerTicket id
subjectstringSubject
statusstringopen or closed
prioritystringlow, normal, high or urgent
customerobjectCustomer on the ticket
assignee_userobjectAssigned agent
tagsarrayTags
json · illustrative record shape
{
  "id": 1,
  "subject": "<Subject>",
  "status": "<open or closed>",
  "priority": "<low, normal, high or urgent>",
  "customer": {},
  "assignee_user": {}
}

See tickets operations

Messages records

Messages

Replies and internal notes on a ticket.

FieldTypeMeaning / relationship
idintegerMessage id
ticket_idintegerTicket
channelstringemail, chat, api or internal-note
body_textstringPlain-text body
from_agentbooleanSent by an agent
json · illustrative record shape
{
  "id": 1,
  "ticket_id": 1,
  "channel": "<email, chat, api or internal-note>",
  "body_text": "<Plain-text body>",
  "from_agent": false
}

See messages operations

Customers records

Customers

People who contact your store.

FieldTypeMeaning / relationship
idintegerCustomer id
namestringFull name
emailstringEmail address
channelsarrayKnown contact channels
dataobjectLinked store data
json · illustrative record shape
{
  "id": 1,
  "name": "<Full name>",
  "email": "person@example.test",
  "channels": [],
  "data": {}
}

See customers operations

Tags records

Tags

Labels used to sort tickets.

FieldTypeMeaning / relationship
idintegerTag id
namestringTag name
decorationobjectColor
json · illustrative record shape
{
  "id": 1,
  "name": "<Tag name>",
  "decoration": {}
}

See tags operations

See the Gorgias world in the catalog