Ask about an entity

Prev Next
Get
/v2/entities/ask-entity

Returns the answer to a question about a specified entity. The answer is generated from calls or emails associated with the entity within the specified time period. A maximum of 60 calls and 500 emails are used to answer the question. A call to this API consumes Gong credits according to the number of emails and calls used to generate the answer. Supported entities are Accounts, Deals, Contacts, or Leads that exist in your CRM. The response includes:

  • The answer
  • Details of emails and calls used to generate the answer
Required authorization scope: 'api:ai-ask:read'. Get AI-generated answers to natural language questions about entities (Accounts, Deals, Contacts, Leads).
Query parameters
workspaceId
integer (int64) Required

The ID of the workspace whose calls and emails are used to answer the question. Use the Workspaces API to look up workspace IDs.

Example1237998047883638784
crmEntityType
stringRequired

The object type of the entity in the CRM.

Valid values[ "ACCOUNT", "CONTACT", "DEAL", "LEAD" ]
ExampleACCOUNT
crmEntityId
stringRequired

The CRM Id of the entity the question is asked about.

Example125260001VdfoWBAR
timePeriod
stringRequired

Specifies the time period during which associated calls and emails must have occurred to be used to generate the answer. The calls and emails must be associated with the specified entity.

Valid values[ "LAST_7DAYS", "LAST_30DAYS", "LAST_90DAYS", "LAST_90_DAYS_SINCE_LAST_ACTIVITY", "LAST_YEAR_SINCE_LAST_ACTIVITY", "LAST_YEAR", "THIS_WEEK", "THIS_MONTH", "THIS_YEAR", "THIS_QUARTER", "CUSTOM_RANGE", "ALL_CONVERSATIONS" ]
ExampleCUSTOM_RANGE
fromDateTime
string

Required when timePeriod is CUSTOM_RANGE Specifies the date and time (UTC) on or after which calls (based on call start time) and emails must have occurred to be included when generating the answer. Date and time (in ISO-8601 format: '2024-10-18T08:00:00Z', where Z stands for UTC).

Example2024-01-01T00:00:00Z
toDateTime
string

Relevant only when timePeriod is CUSTOM_RANGE Specifies the date and time (UTC) before which calls (based on call start time) and emails must have occurred to be included when generating the answer. Date and time (in ISO-8601 format: '2024-10-18T08:00:00Z', where Z stands for UTC).

Example2024-12-31T23:59:59Z
question
stringRequired

The question to answer.

ExampleWhat was the last activity on that account?
Responses
200

Successful response

Expand All
object
requestId
string

The Gong ID of this request. Provide it to Gong Support to troubleshoot a problem with the request.

Example4al018gzaztcr8nbukw
numOfCallsSearched
integer (int32)

Number of calls searched to generate the answer

Example25
numOfEmailsSearched
integer (int32)

Number of emails searched to generate the answer

Example252
answer
Array of object (AnswerSectionDto)

The generated answer. The answer is composed of one or more answerItems, each representing a portion of the response along with the calls and emails used to generate it.

object

The generated answer. The answer is composed of one or more answerItems, each representing a portion of the response along with the calls and emails used to generate it.

answerItems
Array of string

An array of items that make up the answer. Each item contains part of the generated response and metadata describing the calls and emails used as sources.

string
ExampleAcme has questions about compliance.
emailFindings
Array of object (EmailFindingDto)

Evidence from emails used. Includes the relevant emails and the supporting excerpts identified.

object

Evidence from emails used. Includes the relevant emails and the supporting excerpts identified.

emails
Array of object (EmailInfoDto)

Details of the emails that contain supporting evidence.

object

Details of the emails that contain supporting evidence.

id
string

The Gong ID of the email. This Id can be used to view the email in Gong by adding it to a Gong URL.

Example5gfz1gfshfhqdfgsaghhjvcah
title
string

The subject of the email.

ExampleAcme Legal/Compliance Needs
sentDateTime
string (date-time)

The date and time the email message was sent in the ISO-8601 format, for example: '2024-01-17T16:20:05-03:00' or '2016-02-16T03:57:04.834+05:30' or '2020-11-20T21:30:07.233692Z', where Z stands for UTC.

Example2024-01-17T19:20:05Z
callFindings
Array of object (EntityCallFindingDto)

Evidence from calls used to generate this answer item. Includes the relevant calls and supporting excerpts.

object

Evidence from calls used to generate this answer item. Includes the relevant calls and supporting excerpts.

call
object (CallInfoDto)

Details of the call that contains supporting evidence for the answer.

id
string

The Gong ID of the call.

Example123454809855576620
title
string

The title of the call.

ExampleGong + Acme Bi-Weekly
started
string (date-time)

The date and time the call was recorded in the ISO-8601 format (e.g., '2018-02-18T02:30:00-07:00' or '2018-02-18T08:00:00Z', where Z stands for UTC).

Example2024-06-15T14:30:00Z
url
string

Link to the call page in Gong

Examplehttps://gong.app.gong.io/call?id=123454809855576620
400

Malformed request

object
requestId
string

The Gong ID of this request. Provide it to Gong Support to troubleshoot a problem with the request.

Example4al018gzaztcr8nbukw
errors
Array of string

Error messages.

Example[ "An error has occurred" ]
string
401

Access denied

object
requestId
string

The Gong ID of this request. Provide it to Gong Support to troubleshoot a problem with the request.

Example4al018gzaztcr8nbukw
errors
Array of string

Error messages.

Example[ "An error has occurred" ]
string
402

Payment Required

object
requestId
string

The Gong ID of this request. Provide it to Gong Support to troubleshoot a problem with the request.

Example4al018gzaztcr8nbukw
errors
Array of string

Error messages.

Example[ "An error has occurred" ]
string
403

Forbidden

object
requestId
string

The Gong ID of this request. Provide it to Gong Support to troubleshoot a problem with the request.

Example4al018gzaztcr8nbukw
errors
Array of string

Error messages.

Example[ "An error has occurred" ]
string
404

NotFound

object
requestId
string

The Gong ID of this request. Provide it to Gong Support to troubleshoot a problem with the request.

Example4al018gzaztcr8nbukw
errors
Array of string

Error messages.

Example[ "An error has occurred" ]
string
429

API request limit exceeded

Headers
Retry-After
integer (int32)
Number of seconds to wait before making a new request.
object
requestId
string

The Gong ID of this request. Provide it to Gong Support to troubleshoot a problem with the request.

Example4al018gzaztcr8nbukw
errors
Array of string

Error messages.

Example[ "An error has occurred" ]
string
500

Failed to complete the operation due to an unexpected error

object
requestId
string

The Gong ID of this request. Provide it to Gong Support to troubleshoot a problem with the request.

Example4al018gzaztcr8nbukw
errors
Array of string

Error messages.

Example[ "An error has occurred" ]
string