Custom Webhook
Jack Divita avatar
Written by Jack Divita
Updated over a week ago

Custom Webhook empowers you to send data programmatically to Enterpret by calling an ingestion API.


If you want to send Users and Accounts data to Enterpret, using a Custom Webhook or Census, you can follow the instructions here:


If you're using Census to send feedback data to Enterpret, you can follow the instructions in this article:

https://helpcenter.enterpret.com/en/articles/8317703-census-integration


The following instructions are for sending customer feedback to Enterpret programmatically by configuring a custom webhook integration:

Webhook Endpoint

Auth

Create an API Key

  1. Navigate to the Integrations page in your Enterpret instance.

  2. Click on +New Integration, and select Webhook from the list.

  3. Provide a Display Name for the integration in the presented form, this name will appear as the Source for the records, everywhere in your Enterpret instances, for the records ingested using this Webhook.

  4. Click Connect, a Webhook integration will be created, with an API Key, that you can copy as shown below.

  5. This API Key should be used with every request as a value to api-key header.

Rate Limits

  • The API, currently, doesn’t enforce any rate limit, but the recommended rate limit is 100 RPM ( request per minute )

Errors

Data Model

Field

Type

Is Required?

Comment

msg

String

True

Error Message

code

String

True

Enterpret Error Code

referenceID

String

True

Provide it to the Enterpret team, to investigate any unexpected errors

Possible Errors

Code

HTTP Status Code

Is Retriable?

Description

ErrCodeInternalError

500

True

Implies a server-side issue

ErrCodeInvalidRequestArgument

400

False

Implies a issue in the request itself

Sample Error Response

{
"msg": "Internal server exception",
"code": "ErrCodeInternalError",
"referenceID": "8B5OQA"
}

Models

FeedbackInput

Field

Type

Is Required?

Comment

records

True

Array of Feedback

Feedback

Field

Type

Is Required?

Comment

id

String

True

A unique identifier to identify the feedback record

createdAt

Int64

True

Timestamp of the feedback record

type

String

True

The type of feedback record, and possible values are

REVIEW, CONVERSATION, SURVEY,
AUDIO_RECORDING

fileID

String

True

It is combined with the

id

to generate a unique identifier internally

fileType

String

False

A field to differentiate different sources of feedback records. Enterpret allows filtering records by this field on its dashboard

metadata

False

Custom metadata for the record. This metadata will be available on Enterpret’s dashboard as filters

conversation

False

Should be populated, if the type is

CONVERSATION

surveyResponse

False

Should be populated, if the type is

SURVEY

audioRecording

Metadata

Field

Type

Is Required?

Comment

metadata

map<string, Value>

True

Map to store the custom metadata

Value

Field

Type

Is Required?

Comment

array

True

Array Value to store list of values

Array Value

Field

Type

Is Required?

Comment

s

[]String

False

List of strings

n

[]float64

False

List of numbers

Conversation

Field

Type

Is Required?

Comment

msgs

True

Array of conversation message

Message

Field

Type

Is Required?

Comment

text

String

True

Content of the message

actor

String

True

Possible values are user, agent , bot

SurveyResponse

Field

Type

Is Required?

Comment

responses

True

Array of survey responses

SurveyQA

Field

Type

Is Required?

Comment

question

String

True

Survey question

answer

String

False

Open text answer of the survey question

selectedOptions

[]String

False

Selected option for the answer

AudioRecording

Field

Type

Is Required?

Comment

audioURL

String

Yes

Please provide a publicly accessible or signed URL of your call recording here.

Please note that only the following formats are supported currently,

mp3 | mp4 | wav | flac | ogg | amr | webm | m4a.

transcript

Transcript

No

You can optionally provide the transcript of the call recording in the specified format.
This is an optional field, if not provided, Enterpret with internally transcribe the call recording automatically.

Transcript

Field

Type

Is Required

Comment

conversation

AudioConversation

Yes

Conversation-style transcript for your call recording.

AudioConversation

Field

Type

Is Required

Comment

units

[]AudioRecordingMessageUnit

Yes

Transcripts are made of back-and-forth dialogues, represented as units here.

AudioRecordingMessageUnit

Field

Type

Is Required

Comment

actor

String

Yes

Possible values are user, agent, and bot.

actorID

String

Yes

Id of the actor, who is the speaker of the current unit.
Note: Id could be anything, such as email, name, etc.

text

String

Yes

The Transcript of the current unit.

metadata

AudioRecordingMetadata

Yes

Contains the information about where the current unit appears in the call recording.

AudioRecordingMetadata

Field

Type

Is Required?

Comment

startTime

float64

Yes

Relative time in Milliseconds of where the speaker starts speaking the current unit.

Note: For example, if someone starts speaking the unit at the 10th second of the call, the value here would be 10000.

endTime

float64

Yes

Relative time in Milliseconds of where the speaker ends speaking the current unit.

Examples

Survey Feedback Input

{
"records": [
{
"id": "cedr_12312",
"surveyResponse": {
"responses": [
{
"question": "How likely is it that you would recommend us to a friend or colleague?",
"selectedOptions": [
"5"
]
},
{
"question": "What is the primary reason for your score?",
"answer": "It's easy. it works. New stuff being added by you guys every year helps. It is not expensive. It is simple. "
}
]
},
"createdAt": 1652425557,
"metadata": {
"metadata": {
"topic": {
"array": {
"s": [
"Competitive Programming"
]
}
},
"rating": {
"array": {
"n": [
10
]
}
}
}
},
"type": "SURVEY",
"fileType": "SESSION_FEEDBACK",
"fileID": "session_feedback"
}
]
}

Conversation Feedback Input

{
"records": [
{
"id": "conv_123123",
"conversation": {
"msgs": [
{
"actor": "user",
"text": "Hey team, I am ...."
},
{
"actor": "agent",
"text": "We can help you..."
}
]
},
"createdAt": 1652370808,
"metadata": {
"metadata": {
"sample_key": {
"array": {
"s": [
"1"
]
}
}
}
},
"type": 2,
"fileType": "SESSION_FEEDBACK",
"fileID": "session_feedback"
}
]
}

Audio Recording [ Without Transcript ] Input

{
"records": [
{
"id": "call_id_1234",
"audioRecording": {
"audioURL": "https://test-bucket-aavaz.s3.us-east-2.amazonaws.com/KPL%20%2B%20Resource%20Monitoring%20%282024-02-13%2014_04%20GMT-8%29.mp4?response-content-disposition=inline&X-Amz-Security-Token=IQoJb3JpZ2luX2VjEI3%2F%2F%2F%2F%2F%2F%2F%2F%2F%2FwEaCXVzLWVhc3QtMiJIMEYCIQD4vRu4HNbI27PF2oLMm5uAQpch%2FVpryafwh1yaXe%2Bm2AIhAMqgxivRiOJLEryVW%2FGleateiSyDwPw172uaRhYvtC6hKvQDCOf%2F%2F%2F%2F%2F%2F%2F%2F%2F%2FwEQBBoMMjg1OTY4MzM2MTgzIgyRbH0QOhGiBq4XcbQqyAMjxLj00pZZqo%2BxrFUt2aTi6evuyX5XEAXVvG5ZK3PUgpmEFvj2OQekHtP%2BDXlFf29zSMh2vWJygF%2FyfHtXh52UPYIv7Ciu3bIWDjE9%2Fw"
},
"createdAt": 1652370808,
"metadata": {
"metadata": {
"account-name": {
"array": {
"s": [
"Aviator Inc."
]
}
}
}
},
"type": "AUDIO_RECORDING",
"fileType": "SALES_CALLS",
"fileID": "2024-q1-sales-calls"
}
]
}

Audio Recording [ With Transcript ] Input

{
"records": [
{
"id": "call_id_1234",
"audioRecording": {
"audioURL": "https://test-bucket-aavaz.s3.us-east-2.amazonaws.com/KPL%20%2B%20Resource%20Monitoring%20%282024-02-13%2014_04%20GMT-8%29.mp4?response-content-disposition=inline&X-Amz-Security-Token=IQoJb3JpZ2luX2VjEI3%2F%2F%2F%2F%2F%2F%2F%2F%2F%2FwEaCXVzLWVhc3QtMiJIMEYCIQD4vRu4HNbI27PF2oLMm5uAQpch%2FVpryafwh1yaXe%2Bm2AIhAMqgxivRiOJLEryVW%2FGleateiSyDwPw172uaRhYvtC6hKvQDCOf%2F%2F%2F%2F%2F%2F%2F%2F%2F%2FwEQBBoMMjg1OTY4MzM2MTgzIgyRbH0QOhGiBq4XcbQqyAMjxLj00pZZqo%2BxrFUt2aTi6evuyX5XEAXVvG5ZK3PUgpmEFvj2OQekHtP%2BDXlFf29zSMh2vWJygF%2FyfHtXh52UPYIv7Ciu3bIWDjE9%2Fw",
"transcript": {
"conversation": {
"units": [
{
"actor": "agent",
"actorID": "spk_0",
"text": "Your call will now be forwarded in accordance with the call forwarding settings of the phone number.",
"metadata": {
"startTime": 8250,
"endTime": 13229
}
},
{
"actor": "agent",
"actorID": "spk_0",
"text": "Unless you change the settings at Sona tel.com, this usually means that your call now will be forwarded to your mobile phone number.",
"metadata": {
"startTime": 13979,
"endTime": 21489
}
},
{
"actor": "agent",
"actorID": "spk_1",
"text": "Hello?",
"metadata": {
"startTime": 40159,
"endTime": 40990
}
},
{
"actor": "user",
"actorID": "spk_2",
"text": "Yeah. Uh, three.",
"metadata": {
"startTime": 42049,
"endTime": 43639
}
},
{
"actor": "agent",
"actorID": "spk_1",
"text": "Hello. Thank you for contacting the support.",
"metadata": {
"startTime": 44599,
"endTime": 47389
}
},
{
"actor": "agent",
"actorID": "spk_1",
"text": "My name is Shin. How can I assist you today?",
"metadata": {
"startTime": 48459,
"endTime": 51040
}
},
{
"actor": "user",
"actorID": "spk_2",
"text": "Yeah. Hi. I'm having some issues with the sound quality of my zoom calls. I'm using it. Not, uh, it on my apple device. And the audio is, like, really unclear. Sometimes even cuts out. Uh, can you help me with that?",
"metadata": {
"startTime": 52319,
"endTime": 64750
}
},
{
"actor": "agent",
"actorID": "spk_1",
"text": "I'm sorry to hear that. You're experiencing sound quality issues on your apple device. Uh, let's troubleshoot this together. Could you please let me know which specific apple device you're using and its model?",
"metadata": {
"startTime": 66110,
"endTime": 77019
}
}
]
}
}
},
"createdAt": 1652370808,
"metadata": {
"metadata": {
"account-name": {
"array": {
"s": [
"Aviator Inc."
]
}
}
}
},
"type": "AUDIO_RECORDING",
"fileType": "SALES_CALLS",
"fileID": "2024-q1-sales-calls"
}
]
}

Example CURL request

curl --location --request POST '<https://api.enterpret.com/webhook/custom/all>' \\ --header 'api-key: <api-key>' \\ --header 'Content-Type: application/json' \\ --data-raw '{
"records": [
{
"id": "illsdasdasas",
"conversation": {
"msgs": [
{
"actor": "user",
"text": "Hey team, I am ...."
},
{
"actor": "agent",
"text": "We can help you..."
}
]
},
"createdAt": 1652370808,
"metadata": {
"metadata": {
"data": {
"array": {
"s": [
"1"
]
}
}
}
},
"type": 2,
"fileType": "SESSION_FEEDBACK",
"fileID": "session_feedback"
}
]
}'

Did this answer your question?