Skip to main content
PATCH
Update an AI suggestion
Replaces the text of an AI suggestion: the draft reply the AI writes in assist mode for a teammate to review. Nothing is sent to the contact. The teammate still reviews the draft and sends it. Find the suggestion with List chat session history: it is an event of type ai_suggestion, and its id is the suggestion_id here. Write text in the language the reply should reach the contact in.
The response is the updated ai_suggestion event, in the same shape the history returns.
  • Translated sessions: the translated copy your team reads is rebuilt from the new text. A teammate who still has the earlier version in the composer sends their reply as written; the contact never gets new text or images that teammate hasn’t seen.
  • Activity log: every edit is recorded with the API key, Companion user or mini-app that made it.
  • Connected helpdesks: a copy of the draft that was already posted to your helpdesk (for example as an internal note) keeps its original text.
  • Not found (404): the id is not a live AI suggestion of the session in the path, or the draft or session was redacted. Replies already sent to the contact, internal notes and other events can’t be edited here.

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Path Parameters

session_id
string<uuid>
required

The unique identifier of the chat session

Pattern: ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$
suggestion_id
string<uuid>
required

The id of the ai_suggestion event in the session history

Pattern: ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$

Body

application/json
text
string
required

Replacement draft text, in the language the reply should reach the contact in

Minimum string length: 1

Response

Default Response

id
string<uuid>
required
Pattern: ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$
created_at
string<date-time>
required
Pattern: ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d:[0-5]\d(?:\.\d+)?(?:Z|([+-](?:[01]\d|2[0-3]):[0-5]\d)))$
event
object
required