> ## 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 Generate Brief: Inputs, Cost & CLI Example

> Generate a brief for a CRM entity (/v2/entities/get-brief). 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_generate_brief:{"workspaceId":"{{workspaceId}}","briefName":"{{briefName}}","crmEntityType":"ACCOUNT","crmEntityId":"{{crmEntityId}}","timePeriod":"LAST_7DAYS"}' --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 workspace the brief is defined in.                                                                                                                                                                                                                                |
| `payload.briefName`     | `string`                                                                                                                                                                                                                                          | Yes      |         | The name of the brief to generate. Briefs are configured in the Agent Studio > AI Briefer.                                                                                                                                                                                                  |
| `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). |

### 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": "Get a brief for an account, deal, contact, or lead that exists in your CRM. Briefs are set up in the Gong Agent Studio and you must provide the name of the brief you want to generate. A call to this API consumes Gong credits according to the number of emails and calls used to generate the brief. The brief is generated from calls or emails associated with the entity within the specified time period. The response includes: The brief Details of emails and calls used to generate the brief Required authorization scope: 'api:ai-briefer:read'. Get AI-generated briefs for entities (Accounts, Deals, Contacts, Leads) using briefs configured in Gong.",
    "properties": {
      "workspaceId": {
        "type": "integer",
        "description": "Workspace identifier. The workspace the brief is defined in.",
        "format": "int64"
      },
      "briefName": {
        "type": "string",
        "description": "The name of the brief to generate. Briefs are configured in the Agent Studio > AI Briefer."
      },
      "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)."
      }
    },
    "required": [
      "workspaceId",
      "briefName",
      "crmEntityType",
      "crmEntityId",
      "timePeriod"
    ],
    "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 brief",
            "format": "int32"
          },
          "numOfEmailsSearched": {
            "type": "integer",
            "description": "Number of emails searched to generate the brief",
            "format": "int32"
          },
          "briefSections": {
            "type": "array",
            "description": "The sections defined for the brief",
            "items": {
              "type": "object",
              "description": "The sections defined for the brief",
              "properties": {
                "title": {
                  "type": "string",
                  "description": "Section title (omitted if null)"
                },
                "sectionSummary": {
                  "type": "array",
                  "description": "The content displayed for this section.",
                  "items": {
                    "type": "string"
                  }
                },
                "conversationFindings": {
                  "type": "object",
                  "description": "Evidence from calls and emails used to generate this section of the brief. Includes the relevant calls and emails and the supporting excerpts identified in them. Only relevant when briefSectionType is Conversations.",
                  "properties": {
                    "callFindings": {
                      "type": "array",
                      "description": "Evidence from calls used to generate this section of the brief. Includes the relevant calls and the supporting excerpts identified in them.",
                      "items": {
                        "type": "object",
                        "description": "Evidence from calls used to generate this section of the brief. Includes the relevant calls and the supporting excerpts identified in them.",
                        "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
                      }
                    },
                    "emailFindings": {
                      "type": "array",
                      "description": "Evidence from emails used to generate this section in the brief. Includes the relevant emails and the supporting excerpts identified in them.",
                      "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
                      }
                    }
                  },
                  "additionalProperties": false
                },
                "briefSectionType": {
                  "type": "string",
                  "description": "The section type. Determines the source of the data, and what type of data is included in the section.",
                  "enum": [
                    "Conversations",
                    "Web",
                    "CrmOrGongData",
                    "McpConnection"
                  ]
                },
                "webFindings": {
                  "type": "array",
                  "description": "Evidence from results of a web search used to generate the brief for this section.",
                  "items": {
                    "type": "object",
                    "description": "Evidence from results of a web search used to generate the brief for this section.",
                    "properties": {
                      "domain": {
                        "type": "string",
                        "description": "The domain of the website. This domain might be a Gong or a third-party URL that redirects (HTTP 302) to the original website."
                      },
                      "title": {
                        "type": "string",
                        "description": "The title of the web page"
                      },
                      "url": {
                        "type": "string",
                        "description": "The web page URL"
                      }
                    },
                    "additionalProperties": false
                  }
                },
                "mcpResult": {
                  "type": "object",
                  "description": "Result returned from MCP connections defined for this brief section. Only relevant when briefSectionType is McpConnection.",
                  "properties": {
                    "connections": {
                      "type": "array",
                      "description": "Connection result for each MCP connection",
                      "items": {
                        "type": "object",
                        "description": "Connection result for each MCP connection",
                        "properties": {
                          "name": {
                            "type": "string",
                            "description": "The name given to the MCP connection in Gong"
                          },
                          "status": {
                            "type": "string",
                            "description": "The status of the MCP connection",
                            "enum": [
                              "SUCCESS",
                              "AUTH_REQUIRED",
                              "FAILED",
                              "NOT_CONNECTED",
                              "NO_MATCHING_TOOLS",
                              "NO_USER_CONTEXT",
                              "UNKNOWN"
                            ]
                          }
                        },
                        "additionalProperties": false
                      }
                    },
                    "servers": {
                      "type": "array",
                      "description": "Set of server names that were invoked during the execution.",
                      "items": {
                        "type": "string"
                      }
                    },
                    "mcpStatus": {
                      "type": "string",
                      "description": "Overall execution status",
                      "enum": [
                        "SUCCESS",
                        "FAILURE",
                        "CONNECTION_ERROR"
                      ]
                    },
                    "errorMessage": {
                      "type": "string",
                      "description": "Overall error message (dropped when status is SUCCESS)"
                    }
                  },
                  "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_generate_brief --payload '{
  "workspaceId": "integer",
  "briefName": "string",
  "crmEntityType": "ACCOUNT",
  "crmEntityId": "string",
  "timePeriod": "LAST_7DAYS"
}' --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`.
