Setu Recipes: reusable digital workers across every app.Browse templates

Integrations / Gorgias

Gorgias

Gorgias helpdesk for online stores: list, read, create and update tickets, read and send messages, look up customers.

8 actions API key 5 read3 write Calls gorgias.com

Connect

TypeScript
const conn = await setu.connections.initiate({ userId: "user_1", toolkit: "gorgias" });
console.log(conn.connectUrl); // show this to your user
await conn.waitUntilActive();

Permissions requested

This toolkit uses a single credential and requests no scopes.

Actions

Create ticketwritegorgias.create_ticketCreate a ticket for a customer with a first message. The message is recorded as sent by the customer (an incoming message).
InputTypeDescription
customer_emailstringRequiredCustomer email address
subjectstringRequiredTicket subject
messagestringRequiredText of the first message
channelstringRequiredChannel of the message
TypeScript
await setu.execute({
  userId: "user_1",
  action: "gorgias.create_ticket",
  input: {
    "customer_email": "<customer_email>",
    "subject": "<subject>",
    "message": "<message>",
    "channel": "<channel>"
  },
});
Get customerreadgorgias.get_customerGet one customer by ID, including contact channels and notes.
InputTypeDescription
customer_idintegerRequiredCustomer ID
TypeScript
await setu.execute({
  userId: "user_1",
  action: "gorgias.get_customer",
  input: {
    "customer_id": 1
  },
});
Get ticketreadgorgias.get_ticketGet one ticket by ID with its customer, status, priority, channel and tags.
InputTypeDescription
ticket_idintegerRequiredTicket ID
TypeScript
await setu.execute({
  userId: "user_1",
  action: "gorgias.get_ticket",
  input: {
    "ticket_id": 1
  },
});
List customersreadgorgias.list_customersList customers, optionally filtered by exact email or name. Returns the customer records as Gorgias sends them.
InputTypeDescription
emailstringOptionalExact email to match
namestringOptionalName to match
limitintegerOptionalCustomers to return (max 100)
cursorstringOptionalCursor from a previous response
TypeScript
await setu.execute({
  userId: "user_1",
  action: "gorgias.list_customers",
  input: {},
});
List messagesreadgorgias.list_messagesList messages (customer messages, agent replies and internal notes), optionally only those of one ticket.
InputTypeDescription
ticket_idintegerOptionalOnly messages of this ticket
limitintegerOptionalMessages to return (max 100)
cursorstringOptionalCursor from a previous response
TypeScript
await setu.execute({
  userId: "user_1",
  action: "gorgias.list_messages",
  input: {},
});
List ticketsreadgorgias.list_ticketsList tickets, newest first, optionally for one customer. Returns a cursor for the next page.
InputTypeDescription
customer_idintegerOptionalOnly tickets of this customer
limitintegerOptionalTickets to return (max 100)
cursorstringOptionalCursor from a previous response to get the next page
order_bystringOptionalSort order
TypeScript
await setu.execute({
  userId: "user_1",
  action: "gorgias.list_tickets",
  input: {},
});
Reply to ticket by emailwritegorgias.reply_to_ticketSend an agent email reply on a ticket. The sender must be the email of a Gorgias user with an email integration; the receiver is the customer.
InputTypeDescription
ticket_idintegerRequiredTicket ID
body_textstringRequiredReply text
from_addressstringRequiredEmail address the reply is sent from (a connected support address)
to_addressstringRequiredCustomer email address to send the reply to
subjectstringOptionalSubject line of the reply
TypeScript
await setu.execute({
  userId: "user_1",
  action: "gorgias.reply_to_ticket",
  input: {
    "ticket_id": 1,
    "body_text": "<body_text>",
    "from_address": "<from_address>",
    "to_address": "<to_address>"
  },
});
Update ticketwritegorgias.update_ticketChange a ticket's status (open or closed), priority or subject, or mark it as spam.
InputTypeDescription
ticket_idintegerRequiredTicket ID
statusstringOptionalNew status
prioritystringOptionalNew priority
subjectstringOptionalNew subject
spambooleanOptionalMark the ticket as spam
TypeScript
await setu.execute({
  userId: "user_1",
  action: "gorgias.update_ticket",
  input: {
    "ticket_id": 1
  },
});