Agent Copilot: wrap-up notes webhook (public beta)
Public Beta
Agent Copilot is currently available as a Public Beta product and the information contained in this document is subject to change. This means that some features are not yet implemented and others may be changed before the product is declared as Generally Available. Public Beta products are not covered by a SLA.
Not a HIPAA Eligible Service or PCI Compliant
Agent Copilot is not a HIPAA Eligible Service or PCI compliant and should not be used in Flex workflows that are subject to HIPAA or PCI. However, we offer mitigation tools such as PII redaction. To learn more, see AI data use.
You can use a webhook so that notes flow from Flex to your own system, like a CRM or database. When a note is created and an agent clicks Complete, Twilio sends your web application an HTTP request to the URL you specify.
To learn more about Agent Copilot, see Agent Copilot for administrators.
- In Twilio Console, go to Flex > AI features > Agent Copilot.
- Under Wrap-up notes, click Manage auto-generation service.
- Under Wrap-up notes webhook URL, enter your URL where you'd like data sent.
- Select your preferred method:
HTTP POSTorHTTP GET. Regardless of the request method, Twilio sends the same request headers and payload to your webhook URL. - Click Save.
- To receive data, make sure to validate the request against the signature.
To learn more about testing your configuration, see Getting Started with Twilio Webhooks.
The webhook will trigger when either of the following events occurs:
| Event | Description |
|---|---|
note_created | Triggers when you create a note. This includes when the note is auto-generated, or if an agent chooses to enter a note instead. |
note_updated | Triggers when an agent clicks Complete. The event payload includes any updates or edits to the auto-generated note. |
When you create a note in Flex, Flex sends this payload.
1{2"sid": "KQxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",3"event_type": "note_created",4"instance_sid": "GOxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",5"interaction_sid": "KDxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",6"channel_sid": "UOxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",7"participant_sid": "UTxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",8"profile_connect_sid": "YIxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",9"summary": null,10"sentiment": null,11"disposition_code_sid": null,12"generated_summary": "The customer requested a return for a shoe.",13"detected_language": "en-US",14"generated_sentiment": "neutral",15"generated_disposition_code_sid": null,16"codes": {17"generated": [18{19"disposition_code": "DC Name",20"topic_path": "Topic 1|Sub Topic 2"21}22],23"selected": [24{25"disposition_code": "DC Name",26"topic_path": "Topic 1|Sub Topic 2"27}28]29},30"type": "wrapup",31"date_created": "2024-01-17T21:09:00Z",32"date_updated": "2024-01-17T21:09:00Z",33"version": 1,34"context": {35"task_sid": "WTxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"36}37}
When an agent edits or updates a note in Flex, Flex sends this payload.
1{2"sid": "KQxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",3"event_type": "note_updated",4"instance_sid": "GOxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",5"interaction_sid": "KDxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",6"channel_sid": "UOxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",7"participant_sid": "UTxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",8"profile_connect_sid": "YIxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",9"summary": "test1",10"sentiment": "positive",11"disposition_code_sid": null,12"generated_summary": "The customer requested a return for a shoe.",13"detected_language": "en-US",14"generated_sentiment": "neutral",15"generated_disposition_code_sid": null,16"codes": {17"generated": [18{19"disposition_code": "DC Name",20"topic_path": "Topic 1|Sub Topic 2"21}22],23"selected": [24{25"disposition_code": "DC Name",26"topic_path": "Topic 1|Sub Topic 1"27}28]29},30"type": "wrapup",31"date_created": "2024-01-17T21:09:42Z",32"date_updated": "2024-01-17T21:09:00Z",33"version": 2,34"context": {35"task_sid": "WTxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"36}37}
| Property | Necessity | Description | Accepted values | Char Limit |
|---|---|---|---|---|
sid | Required | The unique identifier applied to the note. | ||
event_type | Required | The type of action that triggered this webhook event. | note_created,note_updated | |
instance_sid | Required | The unique identifier applied to the Flex instance. | ||
channel_sid | Required | The unique identifier applied to the interaction channel. | ||
participant_sid | Optional | The unique identifier applied to the agent who creates the note. | ||
profile_connect_sid | Optional | The unique identifier applied to the customer profile. | ||
summary | Optional | A summary generated of the note content. | 3000 | |
sentiment | Optional | The customer sentiment generated and associated with the channel. | Positive,Neutral,Negative | |
disposition_code_sid | Optional | The unique identifier of the disposition code resource generated and associated with the outcome of a channel. | ||
generated_summary | Required | The summary that the large language model (LLM) generated. | ||
detected_language | Required | The supported language that the LLM detected. | en-US,es-MX,pt-BR | |
generated_sentiment | Required | The customer sentiment that the LLM generated then associated with the channel. | Positive,Neutral,Negative | |
generated_disposition_code_sid | Required | The unique identifier of a disposition code resource that the LLM generated then associated with the outcome of a channel. | ||
codes.generated.disposition_code | Required | The generated disposition codesapplied to the note. | ||
codes.generated.topic_path | Required | The topic path for the note represented as a combined string of topic and subtopic separated with a pipe character (|). | ||
codes.selected.disposition_code | Required | The chosen disposition code applied to the note. | ||
codes.selected.topic_path | Required | The topic path for the note represented as a combined string of topic and subtopic separated with a pipe character (|). | ||
type | Required | The type defined for the note. | wrapup | |
date_created | Required | Timestamp when the note got created in the ISO8601 format. | ||
date_updated | Required | Timestamp when the note got modified in the ISO8601 format. | ||
version | Required | The version of the wrap-up note resource. | ||
context.task_sid | Required | The unique identifier applied to the task. |
Agent Copilot can generate 20 notes per second. If you hit the rate limit, you'll see a 429 error.
If the webhook fails, the default behavior is to retry once. You can override this behavior as instructed in Webhooks (HTTP callbacks): Connection Overrides.
In Console Debugger, you can configure an optional webhook to receive data about errors in real-time. The debugger event generated contains all necessary information to retry wrap-up notes. To learn more, see Debugging Webhook Events.
Frontend errors return the 45600 - Flex UI error. The error cases include:
| Error case | Agent action |
|---|---|
| Notes failed to generate | Add notes manually then complete task |
| Notes submission failed | Click complete without notes or dismiss error and try again |