> ## 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

> Generate a Gong AI brief for a CRM account, deal, contact, or lead from its recent calls and emails. Includes SDK V2 examples, schemas, and cost.

Generate a Gong AI brief for a CRM account, deal, contact, or lead from its recent calls and emails.

> [!NOTE]
>
> Tool ID: `gong_generate_brief`

## Run this action

Use the TypeScript SDK for one call. Use `ctx.tools.execute(...)` inside a Play for durable calls, scheduled calls, or CSV processing.

```ts theme={"languages":{"custom":["/languages/deepline-prompt.json"]}}
import { Deepline } from 'deepline';

const deepline = await Deepline.connect();
const result = await deepline.tools.execute(
  'gong_generate_brief',
  {
    "workspaceId": 123,
    "briefName": "Example",
    "crmEntityType": "ACCOUNT",
    "crmEntityId": "crm_entity_123",
    "timePeriod": "LAST_7DAYS"
  },
);

console.log(result.toolResponse.raw);
```

### CLI

```bash theme={"languages":{"custom":["/languages/deepline-prompt.json"]}}
deepline tools execute gong_generate_brief --input '{
  "workspaceId": 123,
  "briefName": "Example",
  "crmEntityType": "ACCOUNT",
  "crmEntityId": "crm_entity_123",
  "timePeriod": "LAST_7DAYS"
}' --json
```

## Example response

The SDK returns this shape at `result.toolResponse.raw`. The example values illustrate the response.

```json theme={"languages":{"custom":["/languages/deepline-prompt.json"]}}
{
  "data": {
    "requestId": "request_123",
    "numOfCallsSearched": 123,
    "numOfEmailsSearched": 123
  }
}
```

Use `deepline describe gong_generate_brief --json` for the latest machine-readable contract.

## Input reference

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.

| Name | Type | Required | Default | Details |
| - | - | - | - | - |
| `payload.workspaceId` | `integer` | Yes | — | Workspace identifier. The workspace the brief is defined in. Format: `int64`. |
| `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. Allowed: `ACCOUNT`, `CONTACT`, `DEAL`, `LEAD`. |
| `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. Allowed: `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`. |
| `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). |

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

  ### Input JSON Schema

  ```json theme={"languages":{"custom":["/languages/deepline-prompt.json"]}}
  {
    "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 reference

Standard tool result payload.

| Name | Type | Required | Default | Details |
| - | - | - | - | - |
| `result.data` | `object` | Yes | — | Provider response payload. |
| `result.data.requestId` | `string` | No | — | A Gong request reference Id, generated for this request. Can be used for troubleshooting purposes. |
| `result.data.numOfCallsSearched` | `integer` | No | — | Number of calls searched to generate the brief Format: `int32`. |
| `result.data.numOfEmailsSearched` | `integer` | No | — | Number of emails searched to generate the brief Format: `int32`. |
| `result.data.briefSections` | `array` | No | — | The sections defined for the brief |
| `result.data.briefSections[].title` | `string` | No | — | Section title (omitted if null) |
| `result.data.briefSections[].sectionSummary` | `array` | No | — | The content displayed for this section. |
| `result.data.briefSections[].conversationFindings` | `object` | No | — | 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. |
| `result.data.briefSections[].conversationFindings.callFindings` | `array` | No | — | Evidence from calls used to generate this section of the brief. Includes the relevant calls and the supporting excerpts identified in them. |
| `result.data.briefSections[].conversationFindings.callFindings[].call` | `object` | No | — | Details of the call that contains supporting evidence for the answer. |
| `result.data.briefSections[].conversationFindings.callFindings[].call.id` | `string` | No | — | The call ID |
| `result.data.briefSections[].conversationFindings.callFindings[].call.title` | `string` | No | — | The call title |
| `result.data.briefSections[].conversationFindings.callFindings[].call.started` | `string` | No | — | 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`. |
| `result.data.briefSections[].conversationFindings.callFindings[].call.url` | `string` | No | — | Link to the call page in Gong |
| `result.data.briefSections[].conversationFindings.emailFindings` | `array` | No | — | Evidence from emails used to generate this section in the brief. Includes the relevant emails and the supporting excerpts identified in them. |
| `result.data.briefSections[].conversationFindings.emailFindings[].emails` | `array` | No | — | Details of the emails that contain supporting evidence. |
| `result.data.briefSections[].conversationFindings.emailFindings[].emails[].id` | `string` | No | — | The email Id. This Id can be used to view the email in Gong by adding it to a Gong URL. |
| `result.data.briefSections[].conversationFindings.emailFindings[].emails[].title` | `string` | No | — | The email subject |
| `result.data.briefSections[].conversationFindings.emailFindings[].emails[].sentDateTime` | `string` | No | — | 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`. |
| `result.data.briefSections[].briefSectionType` | `"Conversations" \| "Web" \| "CrmOrGongData" \| "McpConnection"` | No | — | The section type. Determines the source of the data, and what type of data is included in the section. Allowed: `Conversations`, `Web`, `CrmOrGongData`, `McpConnection`. |
| `result.data.briefSections[].webFindings` | `array` | No | — | Evidence from results of a web search used to generate the brief for this section. |
| `result.data.briefSections[].webFindings[].domain` | `string` | No | — | The domain of the website. This domain might be a Gong or a third-party URL that redirects (HTTP 302) to the original website. |
| `result.data.briefSections[].webFindings[].title` | `string` | No | — | The title of the web page |
| `result.data.briefSections[].webFindings[].url` | `string` | No | — | The web page URL |
| `result.data.briefSections[].mcpResult` | `object` | No | — | Result returned from MCP connections defined for this brief section. Only relevant when briefSectionType is McpConnection. |
| `result.data.briefSections[].mcpResult.connections` | `array` | No | — | Connection result for each MCP connection |
| `result.data.briefSections[].mcpResult.connections[].name` | `string` | No | — | The name given to the MCP connection in Gong |
| `result.data.briefSections[].mcpResult.connections[].status` | `"SUCCESS" \| "AUTH_REQUIRED" \| "FAILED" \| "NOT_CONNECTED" \| "NO_MATCHING_TOOLS" \| "NO_USER_CONTEXT" \| "UNKNOWN"` | No | — | The status of the MCP connection Allowed: `SUCCESS`, `AUTH_REQUIRED`, `FAILED`, `NOT_CONNECTED`, `NO_MATCHING_TOOLS`, `NO_USER_CONTEXT`, `UNKNOWN`. |
| `result.data.briefSections[].mcpResult.servers` | `array` | No | — | Set of server names that were invoked during the execution. |
| `result.data.briefSections[].mcpResult.mcpStatus` | `"SUCCESS" \| "FAILURE" \| "CONNECTION_ERROR"` | No | — | Overall execution status Allowed: `SUCCESS`, `FAILURE`, `CONNECTION_ERROR`. |
| `result.data.briefSections[].mcpResult.errorMessage` | `string` | No | — | Overall error message (dropped when status is SUCCESS) |
| `result.meta` | `object` | No | — | Additional response metadata (status, paging). |

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

  ### Output JSON Schema

  ```json theme={"languages":{"custom":["/languages/deepline-prompt.json"]}}
  {
    "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>

## Deepline cost

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

## Related documentation

* [Gong provider guide](https://deepline.com/docs/providers/gong/guide.md)
* [SDK V2 quickstart](https://deepline.com/docs/sdk-v2/quickstart.md)
* [SDK reference](https://deepline.com/docs/sdk-v2/sdk-reference.md)
* [Run tools across a CSV](https://deepline.com/docs/sdk-v2/batch-csv.md)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.