Skip to contentSkip to navigationSkip to topbar
On this page

Agent Copilot: wrap-up notes webhook (Public Beta)


(warning)

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.

(warning)

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.


Overview

overview page anchor

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.


  1. In Twilio Console(link takes you to an external page), go to Flex > CustomerAI > Agent Copilot.
  2. Under Wrap-up notes, click Manage auto-generation service.
  3. Under Wrap-up notes webhook URL, enter your URL where you'd like data sent.
  4. Select your preferred method: HTTP POST or HTTP GET. Regardless of the request method, Twilio sends the same request headers and payload to your webhook URL.
  5. Click Save.
  6. 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:

EventDescription
note_createdTriggers when a note is created. This includes when the note is auto-generated, or if an agent chooses to manually enter a note instead.
note_updatedTriggers when an agent clicks Complete. Any updates or edits to the auto-generated note are included in the event payload.

note_created

note_created page anchor

Payload sent when a note is created in Flex.

Example response

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
"type": "wrapup",
17
"date_created": "2024-01-17T21:09:00Z",
18
"date_updated": "2024-01-17T21:09:00Z",
19
"version": 1,
20
"context": {
21
"task_sid": "WTxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
22
}
23
}

Payload sent when an agent edits or updates a note in Flex.

Example response

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
"type": "wrapup",
17
"date_created": "2024-01-17T21:09:42Z",
18
"date_updated": "2024-01-17T21:09:00Z",
19
"version": 2,
20
"context": {
21
"task_sid": "WTxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
22
}
23
}
PropertyDescription
sidNote identifier.
event_typeThe type of action that triggered this webhook event. Either note_created or note_updated.
instance_sidFlex instance identifier.
channel_sidInteraction channel identifier.
participant_sid(Optional) Identifier for the agent who creates the note.
profile_connect_sid(Optional) Customer Profile identifier.
summary(Optional) The summary content.

Value is the summary present when an agent clicks Complete. Can be auto-generated or edited by the agent.
sentiment(Optional) The customer sentiment associated with the channel.

Value is the sentiment present when an agent clicks Complete. Can be auto-generated or edited by the agent.

Values can be: Positive, Neutral, Negative.
disposition_code_sid(Optional) The unique ID of a disposition code resource associated with the outcome of a channel.

Value is the disposition code present when an agent clicks Complete. Can be auto-generated or edited by the agent.
generated_summarySummary generated by the LLM.
detected_languageThe supported language detected by the LLM. Values can be en-US, es-MX, and pt-BR.
generated_sentimentThe customer sentiment associated with the channel. Generated by the LLM. Values can be: Positive, Neutral, Negative.
generated_disposition_code_sidThe unique ID of a disposition code resource associated with the outcome of a channel. Generated by the LLM.
typeType of the note. Currently can be wrapup.
date_createdDate note was created. ISO8601 time.
date_updatedLast modification date of the note. ISO8601 time.
versionThe version of the wrap-up note resource.
context.task_sidUnique task identifier.

Values can be:

  • Positive
  • Neutral
  • Negative
  • Max 30 active and 200 total disposition codes
  • 72 character max for disposition code name
  • 256 character max for Context for AI model
  • Max 3000 characters

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(link takes you to an external page) generated contains all necessary information to retry wrap-up notes. To learn more, see Debugging Webhook Events.

Some frontend errors you may encounter are:

Error caseError nameAgent action
Notes failed to generate45600 - Flex UI errorAdd notes manually then complete task
Notes submission failed45600 - Flex UI errorClick complete without notes or dismiss error and try again

Need some help?

Terms of service

Copyright © 2024 Twilio Inc.