> ## Documentation Index
> Fetch the complete documentation index at: https://deepline.com/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Gong Ask Entity: Inputs, Cost & CLI Example

> Ask about an entity (/v2/entities/ask-entity). Includes inputs, outputs, pricing notes, Deepline CLI examples, and GTM automation guidance.

## Run in Enrichment Spreadsheet

<Info>
  Use this function as a column step in `deepline enrich`.
</Info>

```bash theme={null}
deepline enrich --input leads.csv --output leads.enriched.csv --with 'result=gong_ask_entity:{"workspaceId":"{{workspaceId}}","crmEntityType":"ACCOUNT","crmEntityId":"{{crmEntityId}}","timePeriod":"LAST_7DAYS","question":"{{question}}"}' --json
```

<Tip>
  Map payload values to spreadsheet columns with `{{column_name}}` placeholders.
</Tip>

## Input Schema

| Name                    | Type                                                                                                                                                                                                                                              | Required | Default | Description                                                                                                                                                                                                                                                                                 |
| ----------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------- | ------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `payload.workspaceId`   | `integer`                                                                                                                                                                                                                                         | Yes      |         | Workspace identifier. The calls and emails used to answer the question must be associated with this workspace.                                                                                                                                                                              |
| `payload.crmEntityType` | `"ACCOUNT" \| "CONTACT" \| "DEAL" \| "LEAD"`                                                                                                                                                                                                      | Yes      |         | The object type of the entity in the CRM.                                                                                                                                                                                                                                                   |
| `payload.crmEntityId`   | `string`                                                                                                                                                                                                                                          | Yes      |         | The CRM Id of the entity the question is asked about.                                                                                                                                                                                                                                       |
| `payload.timePeriod`    | `"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"` | Yes      |         | 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.                                                                                                 |
| `payload.fromDateTime`  | `string`                                                                                                                                                                                                                                          | No       |         | 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). |
| `payload.toDateTime`    | `string`                                                                                                                                                                                                                                          | No       |         | 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). |
| `payload.question`      | `string`                                                                                                                                                                                                                                          | Yes      |         | The question to answer.                                                                                                                                                                                                                                                                     |

### Allowed values

| Field                   | Allowed values                                                                                                                                                                                                            |
| ----------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `payload.crmEntityType` | `ACCOUNT`, `CONTACT`, `DEAL`, `LEAD`                                                                                                                                                                                      |
| `payload.timePeriod`    | `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` |

<details>
  <summary>Show raw input schema</summary>

  ### Input JSON Schema

  ```json theme={null}
  {
    "type": "object",
    "description": "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).",
    "properties": {
      "workspaceId": {
        "type": "integer",
        "description": "Workspace identifier. The calls and emails used to answer the question must be associated with this workspace.",
        "format": "int64"
      },
      "crmEntityType": {
        "type": "string",
        "description": "The object type of the entity in the CRM.",
        "enum": [
          "ACCOUNT",
          "CONTACT",
          "DEAL",
          "LEAD"
        ]
      },
      "crmEntityId": {
        "type": "string",
        "description": "The CRM Id of the entity the question is asked about."
      },
      "timePeriod": {
        "type": "string",
        "description": "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.",
        "enum": [
          "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"
        ]
      },
      "fromDateTime": {
        "type": "string",
        "description": "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)."
      },
      "toDateTime": {
        "type": "string",
        "description": "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)."
      },
      "question": {
        "type": "string",
        "description": "The question to answer."
      }
    },
    "required": [
      "workspaceId",
      "crmEntityType",
      "crmEntityId",
      "timePeriod",
      "question"
    ],
    "additionalProperties": false
  }
  ```
</details>

## Output Schema

| Name          | Type     | Required | Default | Description                                    |
| ------------- | -------- | -------- | ------- | ---------------------------------------------- |
| `result.data` | `object` | Yes      |         | Provider response payload.                     |
| `result.meta` | `object` | No       |         | Additional response metadata (status, paging). |

<details>
  <summary>Show raw output schema</summary>

  ### Output JSON Schema

  ```json theme={null}
  {
    "type": "object",
    "description": "Standard tool result payload.",
    "properties": {
      "data": {
        "type": "object",
        "description": "Provider response payload.",
        "properties": {
          "requestId": {
            "type": "string",
            "description": "A Gong request reference Id, generated for this request. Can be used for troubleshooting purposes."
          },
          "numOfCallsSearched": {
            "type": "integer",
            "description": "Number of calls searched to generate the answer",
            "format": "int32"
          },
          "numOfEmailsSearched": {
            "type": "integer",
            "description": "Number of emails searched to generate the answer",
            "format": "int32"
          },
          "answer": {
            "type": "array",
            "description": "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.",
            "items": {
              "type": "object",
              "description": "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.",
              "properties": {
                "answerItems": {
                  "type": "array",
                  "description": "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.",
                  "items": {
                    "type": "string"
                  }
                },
                "emailFindings": {
                  "type": "array",
                  "description": "Evidence from emails used. Includes the relevant emails and the supporting excerpts identified.",
                  "items": {
                    "type": "object",
                    "description": "Evidence from emails used. Includes the relevant emails and the supporting excerpts identified.",
                    "properties": {
                      "emails": {
                        "type": "array",
                        "description": "Details of the emails that contain supporting evidence.",
                        "items": {
                          "type": "object",
                          "description": "Details of the emails that contain supporting evidence.",
                          "properties": {
                            "id": {
                              "type": "string",
                              "description": "The email Id. This Id can be used to view the email in Gong by adding it to a Gong URL."
                            },
                            "title": {
                              "type": "string",
                              "description": "The email subject"
                            },
                            "sentDateTime": {
                              "type": "string",
                              "description": "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.",
                              "format": "date-time"
                            }
                          },
                          "additionalProperties": false
                        }
                      }
                    },
                    "additionalProperties": false
                  }
                },
                "callFindings": {
                  "type": "array",
                  "description": "Evidence from calls used to generate this answer item. Includes the relevant calls and supporting excerpts.",
                  "items": {
                    "type": "object",
                    "description": "Evidence from calls used to generate this answer item. Includes the relevant calls and supporting excerpts.",
                    "properties": {
                      "call": {
                        "type": "object",
                        "description": "Details of the call that contains supporting evidence for the answer.",
                        "properties": {
                          "id": {
                            "type": "string",
                            "description": "The call ID"
                          },
                          "title": {
                            "type": "string",
                            "description": "The call title"
                          },
                          "started": {
                            "type": "string",
                            "description": "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).",
                            "format": "date-time"
                          },
                          "url": {
                            "type": "string",
                            "description": "Link to the call page in Gong"
                          }
                        },
                        "additionalProperties": false
                      }
                    },
                    "additionalProperties": false
                  }
                }
              },
              "additionalProperties": false
            }
          }
        },
        "additionalProperties": false
      },
      "meta": {
        "type": "object",
        "description": "Additional response metadata (status, paging).",
        "additionalProperties": true
      }
    },
    "required": [
      "data"
    ],
    "additionalProperties": false
  }
  ```
</details>

## Advanced: Direct CLI

<Info>
  Use direct execution for single payload debugging.
</Info>

```bash theme={null}
deepline tools execute gong_ask_entity --payload '{
  "workspaceId": "integer",
  "crmEntityType": "ACCOUNT",
  "crmEntityId": "string",
  "timePeriod": "LAST_7DAYS",
  "question": "string"
}' --json
```

### CLI flags

| Flag                        | Description                                         |
| --------------------------- | --------------------------------------------------- |
| `--json`                    | Print machine-readable output.                      |
| `--wait`                    | Wait for terminal provider status when supported.   |
| `--debug`                   | Enable wait mode with additional status/log output. |
| `--wait-timeout SECONDS`    | Max seconds to wait in wait mode.                   |
| `--poll-interval SECONDS`   | Polling interval in seconds during wait mode.       |
| `--timeout SECONDS`         | Request timeout in seconds.                         |
| `--connect-timeout SECONDS` | Connection timeout in seconds.                      |

## Cost

* Pricing model: `fixed` (per call).
* Estimated Deepline credits: `0` per pricing unit.
* Provider-native pricing may still exist outside Deepline credit billing.
* Billing mode: `no_bill`.
