Skip to contentSkip to navigationSkip to topbar
Rate this page:
On this page

Agent Copilot: Use a webhook to store wrap-up notes (Public Beta)


(information)

Public Beta

Agent Copilot is currently available as a limited 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 Twilio 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.


Use Agent Copilot webhooks to store wrap-up notes

use-agent-copilot-webhooks-to-store-wrap-up-notes page anchor

After an agent closes a wrap-up note, Twilio Flex does not retain it in Flex UI. However, 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 > Manage > Agent Copilot .
  2. Under Wrap-up notes webhook URL , enter your URL where you'd like data sent.
  3. 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.
  4. Click Save .
  5. 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


_22
{
_22
"sid": "KQxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
_22
"event_type": "note_created",
_22
"instance_sid": "GOxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
_22
"interaction_sid": "KDxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
_22
"channel_sid": "UOxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
_22
"participant_sid": "UTxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
_22
"profile_connect_sid": "YIxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
_22
"summary": null,
_22
"sentiment": null,
_22
"disposition_code_sid": null,
_22
"generated_summary": "The customer requested a return for a shoe.",
_22
"generated_sentiment": "neutral",
_22
"generated_disposition_code_sid": null,
_22
"type": "wrapup",
_22
"date_created": "2024-01-17T21:09:00Z",
_22
"date_updated": "2024-01-17T21:09:00Z",
_22
"version": 1,
_22
"context": {
_22
"task_sid": "WTxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
_22
}
_22
}

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

Example response


_22
{
_22
"sid": "KQxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
_22
"event_type": "note_updated",
_22
"instance_sid": "GOxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
_22
"interaction_sid": "KDxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
_22
"channel_sid": "UOxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
_22
"participant_sid": "UTxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
_22
"profile_connect_sid": "YIxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
_22
"summary": "test1",
_22
"sentiment": "positive",
_22
"disposition_code_sid": null,
_22
"generated_summary": "The customer requested a return for a shoe.",
_22
"generated_sentiment": "neutral",
_22
"generated_disposition_code_sid": null,
_22
"type": "wrapup",
_22
"date_created": "2024-01-17T21:09:42Z",
_22
"date_updated": "2024-01-17T21:09:00Z",
_22
"version": 2,
_22
"context": {
_22
"task_sid": "WTxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
_22
}
_22
}

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.
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. task_sid is not currently available for the Voice channel.

Values can be:

  • Positive
  • Neutral
  • Negative
  • Max 10 active 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 errorRefresh the page (notes won't be saved)
Notes generated, but one or more fields are empty45600 - Flex UI errorRefresh the page (notes won't be saved)
Notes submission failed45600 - Flex UI errorClick complete without notes or dismiss error and try again

Rate this page: