v1
latestOpenAPI 3.1.02026-07-24111290748.0 KBTicket Messages
Create a message
Create a message and either:
- not send it if the attribute sent_datetime is filled. If you import a message that was already sent, make sure to set this value.
- send it to the recipients if the attribute sent_datetime is empty.
- add it to the ticket as an internal note if you specified this channel. Internal notes are not sent to your customers.
When a message is created, it does not mean that this one has been sent because the creation and sending process are decoupled. Messages are basically sent asynchronously. Once a message has been sent, Gorgias will automatically update the message to fill the time when it was sent (sent_datetime).
post/api/tickets/{ticket_id}/messages
Path parameters
ticket_idinteger required
The ID of the ticket to create a message in.
Query parameters
action'force' | 'retry' | 'cancel'
Example:force
Policy applied on external actions associated with the message if they failed. Three actions are possible:
- force: bypass the failed action and try to execute the remaining one and to send the message
- retry: retry the failed action
- cancel: delete the TicketMessage
Request body
Response
The created message.
Example response
{
"id": 924712,
"message_id": "<123345676453.2445.234@web>",
"ticket_id": 12,
"external_id": "MSG-78545",
"public": true,
"integration_id": 28643,
"intents": [
{
"name": "discount/request"
}
],
"rule_id": 89465,
"from_agent": true,
"subject": "Re:Refund request",
"body_text": "Hello,\n\n I can't place an order on your site, it says: I don't have enough credit.\n How can I add some credits?\n\n Cheers,\n John Doe\n ",
"body_html": "Hello,<br><br>\n\n I can't place an order on your site, it says: I don't have enough credit.<br>\n How can I add some credits?<br><br>\n\n Cheers,<br>\n John Doe\n ",
"attachments": [],
"macros": [],
"actions": [],
"headers": {
"My-Header": "foo"
},
"meta": {},
"created_datetime": "2020-01-27T10:42:21.468912",
"processed_datetime": "2020-01-27T10:42:21.468912",
"deleted_datetime": "2020-01-27T10:42:21.468912",
"opened_datetime": "2019-07-05T15:22:46.472436",
"replied_by": {
"integration_id": 28643,
"created_datetime": "2020-01-27T10:42:21.468912",
"body_text": "Hello,\n\n I can't place an order on your site, it says: I don't have enough credit.\n How can I add some credits?\n\n Cheers,\n John Doe\n "
},
"replied_to": {
"integration_id": 28643,
"created_datetime": "2020-01-27T10:42:21.468912",
"body_text": "Hello,\n\n I can't place an order on your site, it says: I don't have enough credit.\n How can I add some credits?\n\n Cheers,\n John Doe\n "
}
}