Create Ticket
gorgias_create_ticketCreate a new support ticket in Gorgias by providing a channel and at least one message, with optional fields for customer, priority, and tags.
Instructions
POST /api/tickets — Create a new support ticket. Requires 'via' and at least one message in the 'messages' array.
Each message in the 'messages' array must include:
channel (string, required): e.g. 'email', 'chat', 'sms', 'api', etc.
from_agent (boolean, required): true if sent by an agent, false if by a customer
via (string, required): e.g. 'email', 'api', 'chat', 'sms', etc.
body_text (string, optional): plain text body
body_html (string, optional): HTML body
public (boolean, optional, default true): false = internal note
subject (string, optional): message subject
sender (object, optional): { id, email, name, external_id, language, meta, note, timezone, channels }
receiver (object, optional): { id, email, name, external_id, language, meta, note, timezone, channels }
source (object, optional): { type, from: { address, name }, to: [{ address, name }], cc: [...], bcc: [...], extra }
attachments (array, optional): [{ url, name, content_type, size, public, extra }]
integration_id (integer, optional): ID of the integration used
message_id (string, optional): external message ID
external_id (string, optional): foreign system ID (max 255 chars)
created_datetime, sent_datetime, failed_datetime, deleted_datetime (ISO 8601, optional)
mention_ids (array of integers, optional): user IDs to mention in internal notes
headers (object, optional): key-value message headers
meta (object, optional): message metadata
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| via | Yes | How the first message was received or sent from Gorgias. Enum: 'aircall', 'api', 'chat', 'contact_form', 'email', 'facebook', 'facebook-mention', 'facebook-messenger', 'facebook-recommendations', 'form', 'gorgias_chat', 'help-center', 'helpdesk', 'instagram', 'instagram-ad-comment', 'instagram-comment', 'instagram-direct-message', 'instagram-mention', 'internal-note', 'offline_capture', 'phone', 'rule', 'self_service', 'shopify', 'sms', 'twilio', 'twitter', 'twitter-direct-message', 'whatsapp', 'yotpo', 'yotpo-review', 'zendesk' | |
| meta | No | Metadata associated with the ticket (arbitrary key-value pairs) | |
| spam | No | Whether the ticket is considered spam. Default: false | |
| tags | No | Tags associated with the ticket | |
| status | No | Status of the ticket. Default: 'open' | |
| channel | No | Channel used to initiate the conversation. Enum: 'aircall', 'api', 'chat', 'contact_form', 'email', 'facebook', 'facebook-mention', 'facebook-messenger', 'facebook-recommendations', 'help-center', 'instagram-ad-comment', 'instagram-comment', 'instagram-direct-message', 'instagram-mention', 'internal-note', 'phone', 'sms', 'twitter', 'twitter-direct-message', 'whatsapp', 'yotpo-review' | |
| subject | No | Subject of the ticket (max 998 characters) | |
| customer | No | Customer associated with the ticket | |
| language | No | Language primarily used in the ticket (ISO 639-1). Auto-detected if not set. | |
| messages | Yes | Array of message objects composing the ticket (1–500). Each message requires: channel (string), from_agent (boolean), via (string). Optional: body_text, body_html, public, subject, sender, receiver, source, attachments, integration_id, message_id, external_id, created_datetime, sent_datetime, headers, meta, mention_ids. | |
| priority | No | Priority of the ticket. Default: 'normal' | |
| from_agent | No | Whether the first message was sent by your company (true) or by a customer (false) | |
| external_id | No | ID of the ticket in a foreign system (max 255 chars, not used by Gorgias) | |
| assignee_team | No | Team assigned to the ticket | |
| assignee_user | No | User assigned to the ticket | |
| custom_fields | No | Custom fields associated with the ticket | |
| closed_datetime | No | When the ticket was closed (ISO 8601) | |
| opened_datetime | No | When the ticket was first opened by a user (ISO 8601) | |
| snooze_datetime | No | When the ticket will be re-opened automatically (ISO 8601) | |
| created_datetime | No | When the ticket was created (ISO 8601) | |
| trashed_datetime | No | When the ticket was moved to the trash (ISO 8601) | |
| updated_datetime | No | When the ticket was last updated (ISO 8601) |