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

# Upload Object Schema (/v2/crm/entity-schema)

> <style>.public-api-info {    background: rgb(222, 235, 255);}.public-api-tip {    background: rgb(227, 252, 239);}.public-api-parameter {    background: rgba(9,30,66,0.08);}.public-api-note {    background: rgb(234, 230, 255);}.public-api-important {    background: rgb(255, 250, 230);}.public-api-critical {    background: rgb(255, 235, 230);}table, th, td {  border: 1px solid gray;  border-collapse: collapse;}th, td {  padding: 5px;}th {  text-align: left;}img {  border: 2px solid #D3D5D9;}</style><p>Enables you to add, edit or remove fields to Gong CRM entities, so that you can display additional CRM data in Gong. Fields that are not included in the Gong CRM objects, and are uploaded without updating your schema, are not displayed in Gong.</p><p>Update your schema when:</p><ul>  <li>You create a new integration</li>  <li>There are changes to the schema of any object type. You can also send a schema update request before any request to the <code>/v2/crm/entities</code> API.</li></ul><p>When updating your schema:</p><ul>  <li>Add or change field: include all fields you want in the schema, including those sent previously. Example:     <table>      <tr>        <th>Date</th>        <th>Action</th>        <th>Result</th>      </tr>      <tr>        <td>3/4/2023</td>        <td>Send account schema with fieldA</td>        <td>fieldA added to the account</td>      </tr>      <tr>        <td>6/4/23</td>        <td>Send account schema with fieldA and fieldB</td>        <td>fieldA still included in account schema. fieldB added to the account</td>      </tr>      <tr>        <td>8/4/23</td>        <td>Send account schema with fieldC but without fieldA and fieldB</td>        <td>Receive an error that you must include all fields in the schema</td>      </tr>      <tr>        <td>15/4/23</td>        <td>Send account schema with fieldB, fieldC, and isDeleted for fieldA</td>        <td>fieldA and all it's data are deleted. fieldB and fieldC remain in the schema</td>      </tr>    </table>  </li>  <li>Changing a field: if you change the field type, a new field is created and the data associated with the original field is deleted. Other changes, such as the label do not result in data being deleted.</li>  <li>Deleting a field: to delete a field and it's associated data, send the field with isDeleted = true</li></ul><p>When accessed using a bearer token, this endpoint requires the 'api:crm:schema' scope.</p><h2>Supported field types</h2><p>This table describes the field types that can be added to your schema</p><table>  <tr><th>Field type</th><th>Format in JSON</th><th>Possible values</th></tr>  <tr><td>BOOLEAN</td><td>boolean</td><td>true, false</td></tr>  <tr><td>DATE</td><td>string (ISO-8601 date without time)</td><td>"2020-05-31"</td></tr>  <tr><td>DATETIME</td><td>string (ISO-8601 datetime without milliseconds)</td><td>"2020-12-17T07:37:21+02:00"<p>"2020-12-17T05:37:21Z"</p></td></tr>  <tr><td>PICKLIST</td><td>string - one of the values in an orderedValueList</td><td>"Analyst"</td></tr>  <tr><td>NUMBER</td><td>number</td><td>45.66, 8453</td></tr>  <tr><td>PERCENT</td><td>number (between 0 to 100)</td><td>67.3</td></tr>  <tr><td>CURRENCY*</td><td>number</td><td>34.68</td></tr>  <tr><td>PHONENUMBER</td><td>string</td><td>"+14055766687"</td></tr>  <tr><td>EMAILADDRESS</td><td>string</td><td>"john.doe@anywhere.com"</td></tr>  <tr><td>REFERENCE</td><td>string - the id of another object</td><td>"48b009drax"</td></tr>  <tr><td>ID</td><td>string - the id of the object</td><td>"843hf8484jr84htg"</td></tr>  <tr><td>STRING</td><td>string</td><td>"whatever you want"</td></tr>  <tr><td>URL</td><td>string</td><td>"https://crm.com/account/6d4r578f"</td></tr></table><p>* In the integration send a number value, and specify the correct currency symbol in the Gong UI. Currently Gong does not support multiple currencies per company.</p><h3>Example</h3><h4>Request</h4><p><code>POST https://api.gong.io/v2/crm/entity-schema?integrationId=6286478263646&objectType=ACCOUNT</code></p><p><code>[{"uniqueName": "orderId", "label": "ID", "type": "ID", "lastModified": "2020-11-11T08:11:34+01:00"},</code></p><p><code>{"uniqueName": "parentAccount", "label": "Main Account", "type": "REFERENCE", "referenceTo": "ACCOUNT", "lastModified": "2020-11-11T08:11:34+01:00"},</code></p><p><code>{"uniqueName": "category", "label": "Category", "type": "PICKLIST", "orderedValueList": ["Analyst", "Competitor", "Customer", "Integrator", "Investor", "Partner", "Other"], "lastModified": "2020-11-11T08:11:34+01:00"}, </code></p><p>// remove custom field</p><p><code>{"uniqueName": "industry", "isDeleted": true, "label": "Industry", "type": "PICKLIST", "lastModified": "2020-11-21T08:11:34+01:00"}] </code></p>

## OpenAPI

````json POST /v2/crm/entity-schema
{
  "openapi": "3.0.1",
  "info": {
    "title": "Gong API",
    "version": "V2"
  },
  "servers": [
    {
      "url": "http://127.0.0.1:8090",
      "description": "Generated server url"
    }
  ],
  "tags": [
    {
      "name": "Calls",
      "description": "<h3>Gong’s “Calls” API endpoints allow you to:</h3>\n<ul>\n<li>\nRequest calls details from Gong\n</li>\n<li>\nUpload new calls to Gong\n</li>\n<li>\nUpdate Gong Calls with new media\n</li>\n</ul>\n<h3>The requested calls may contain the following call details:</h3>\n<ul>\n<li>\n<b>Meta Data</b> (Basic details such as call date, title, call URL, etc)\n</li>\n<li>\n<b>Parties</b> (A list of the call's participants)\n</li>\n<li>\n<b>Media</b> (The media urls of the call)\n</li>\n<li>\n<b>Content</b> (Analysis of the interaction content)\n<ul>\n<li>\nAction Items (A list of action items)\n</li>\n<li>\nStructure (A list of the agenda of each part of the call)\n</li>\n<li>\nTopics (A list of topics and their durations)\n</li>\n<li>\nTrackers (A list of trackers found in the call. Trackers are collections of phrases defined in Gong for this company)\n</li>\n<li>\nPhrases (A list of occurrence counters for each specific phrase within the tracker (e.g., Amazon, Walmart))\n</li>\n<li>\nContext (A list of links to external systems such as CRM, Dialer, Case Management, etc)\n</li>\n</ul>\n</li>\n<li>\n<b>Interaction</b> (Metrics collected around the interaction during the call)\n<ul>\n<li>\nInteraction Stats (A list of interaction statistics. Applicable values: 'Talk Ratio', 'Longest Monologue', \n'Longest Customer Story', 'Interactivity', 'Patience')\n</li>\n<li>\nQuestions (Question counts of the call)\n</li>\n<li>\nSpeakers (A list of the talk duration per speaker)\n</li>\n<li>\nVideo (A list of video statistics about what's presented and for how long)\n</li>\n</ul>\n</li>\n<li>\n<b>Collaboration</b> (Collaboration information added to the call)\n<ul>\n<li>\nPublic Comments (A list of public comments)\n</li>\n</ul>\n</li>\n<li>\n<b>Context</b> (A list of links to external systems such as CRM, Dialer, Case Management, etc)\n<ul>\n<li>\nObjects (List of objects within the external system)\n</li>\n<li>\nFields (Object fields)\n</li>\n</ul>\n</li>\n</ul>\n"
    },
    {
      "name": "Users",
      "description": "<h3>Gong’s “Users” API endpoints allow you to:</h3>\n<ul>\n<li>\nRequest a list of all the company's users with details\n</li>\n<li>\nRequest a specific user’s history from Gong\n</li>\n</ul>\n<h3>The requested users may contain the following details:</h3>\n<ul>\n<li>\nIf the Gong user is active or not.\n</li>\n<li>\nCreation time of the Gong user.\n</li>\n<li>\nThe email address of the Gong user.\n</li>\n<li>\nList of email address aliases of the Gong user.\n</li>\n<li>\nThe extension number of the Gong user.\n</li>\n<li>\nThe first name of the Gong user.\n</li>\n<li>\nThe last name of the Gong user.\n</li>\n<li>\nGong's unique numeric identifier for the user.\n</li>\n<li>\nThe manager ID of the Gong user.\n</li>\n<li>\nThe Gong recording consent meeting link.\n</li>\n<li>\nThe list of personal meeting URLs of the Gong user.\n</li>\n<li>\nThe phone number of the Gong user.\n</li>\n<li>\nThe job title of the Gong user.\n</li>\n<li>\nThe user's settings.\n<ul>\n<li>\nIf the team member is set to import emails by Gong.\n</li>\n<li>\nIf the team member is set to prevent import of emails by Gong.\n</li>\n<li>\nIf the invitation of this user to a web conference will prevent its recording (even if other users invited are set to record).\n</li>\n<li>\nIf the team member is set to import telephony calls by Gong.\n</li>\n<li>\nIf the team member is set to be recorded by Gong.\n</li>\n</ul>\n</li>\n<li>\nThe User's settings history.\n<ul>\n<li>\nThe user capability that was changed.\n</li>\n<li>\nThe date and time the action was set.\n</li>\n<li>\nThe new value that was set.\n</li>\n</ul>\n</li>\n</ul>\n"
    },
    {
      "name": "Stats",
      "description": "<h3>Gong’s “Stats” API endpoints allow you to:</h3>\n<ul>\n<li>\nRequest user activity\n</li>\n<li>\nRequest scorecards activity\n</li>\n<li>\nRequest interaction stats on calls that have Whisper turned on\n</li>\n</ul>\n<h3>The requested user activity may contain the following details:</h3>\n<ul>\n<li>\n<b>Calls Hosted:</b> The number of recorded calls this user hosted.\n</li>\n<li>\n<b>Call Participated:</b> The number of calls in which this user is a participant (not host).\n</li>\n<li>\n<b>Calls Reviewed:</b> The number of calls in which someone pressed the \"Mark as reviewed\".\n</li>\n<li>\n<b>Calls Listened:</b> The number of other users' calls the user listened to.\n</li>\n<li>\n<b>Call Shared Outside:</b> The number of calls the user shared with others outside the company.\n</li>\n<li>\n<b>Call Shared Inside:</b> The number of calls the user shared with others inside the company.\n</li>\n<li>\n<b>Own Calls Listened:</b> The number of the user's own calls the user listened to.\n</li>\n<li>\n<b>Comment Given:</b> The number of calls in which a user gave at least one comment.\n</li>\n<li>\n<b>Comment Received:</b> The number of calls in which a user received at least one comment on the users calls.\n</li>\n<li>\n<b>Feedback Given:</b> The number of recorded calls the user gave feedback on.\n</li>\n<li>\n<b>Feedback Received:</b> The number of recorded calls the user received feedback on.\n</li>\n<li>\n<b>Feedback Requested:</b> The number of recorded calls the user requested feedback on.\n</li>\n<li>\n<b>Scorecard Filled:</b> The number of calls in which someone filled a scorecard on the user's calls.\n</li>\n<li>\n<b>Scorecards Completed:</b> The number of scorecards the user completed.\n</li>\n<li>\n<b>Scorecards Answers:</b> The answers in the answered scorecard.\n</li>\n<li>\n<b>Whisper:</b> Person Interaction Stats (List of user interaction stats. Applicable values: 'Talk Ratio',\n 'Longest Monologue', 'Longest Customer Story', 'Interactivity', 'Question Rate', 'Patience').\n</li>\n</ul>\n"
    },
    {
      "name": "Settings",
      "description": "<h3>Gong’s “Settings” API endpoints allow you to:</h3>\n<ul>\n<li>\nRequest all the scorecards within the Gong system.\n</li>\n<li>\nRequest all the workspaces including their details.\n</li>\n</ul>\n"
    },
    {
      "name": "Data Privacy",
      "description": "<h3>Gong’s “Data Privacy” API endpoints allow you to:</h3>\n<ul>\n<li>\nRequest all references to an email address.\n</li>\n<li>\nRequest all references to a phone number.\n</li>\n<li>\nDelete the email address, and all associated elements.\n</li>\n<li>\nDelete the phone number, and all associated elements.\n</li>\n</ul>\n"
    },
    {
      "name": "Library",
      "description": "<h3>Gong’s “Library” API endpoints allow you to:</h3>\n<ul>\n<li>\nRequest all the calls in a specific folder.\n</li>\n<li>\nRequest all the Library folders. We do not allow retrieval of either private or archived folders.\n</li>\n</ul>\n"
    },
    {
      "name": "CRM",
      "description": "<style>.public-api-info {    background: rgb(222, 235, 255);}.public-api-tip {    background: rgb(227, 252, 239);}.public-api-parameter {    background: rgba(9,30,66,0.08);}.public-api-note {    background: rgb(234, 230, 255);}.public-api-important {    background: rgb(255, 250, 230);}.public-api-critical {    background: rgb(255, 235, 230);}table, th, td {  border: 1px solid gray;  border-collapse: collapse;}th, td {  padding: 5px;}th {  text-align: left;}img {  border: 2px solid #D3D5D9;}</style><p>If you are using the deprecated endpoints, download the <a href=\"/r/img/permanent/crm_api_deprecated_endpoints.pdf\" target=\"_blank\">PDF file</a>.</p><h1>What does the CRM API do?</h1><p>This API enables integration with CRMs that are not natively integrated with Gong, so that Gong can provide you with its full capabilities based on your CRM data. This includes:</p><ul>  <li>Pipeline review and forecast</li>  <li>Narrow down conversations (calls and emails) by customer data for coaching and analytics</li>  <li>Track initiatives and adoption based on accounts and opportunities</li></ul><p>By uploading your CRM data to Gong, your Gong users will be able to see their CRM deals in the Gong Deals page, view deal boards to follow up on deal progress, get warnings for deals that are at risk, and see whether their team will reach its quota. The CRM data is also displayed in conversations and calls, so that your Gong users can see account and contact data such as the name and job title of the contact in the call. Account data is displayed in the Accounts page, together with the history of all communication and contact with the company.</p><p><b>Note</b>: Gong provides native integrations with Salesforce, HubSpot and Microsoft Dynamics 365.</p><h2>API Protocol</h2>The API protocol is based on REST guidelines. Check <a href=\"https://app.gong.io/company/api-authentication?currentTab=MY_API_TAB\">here</a> what's your base URL for all API calls.\n<p>The payload is either a JSON object or, for API calls that upload lists of objects, line delimited JSON (see: <a href=\"https://en.wikipedia.org/wiki/JSON_streaming#Newline-Delimited_JSON\">JSON streaming</a>). JSON objects should be UTF-8 encoded.</p><p>Dates and timestamps in JSON objects should be in ISO-8601 format without milliseconds (e.g. '2018-02-18T02:30:00-07:00' or '2018-02-18T08:00:00Z', where Z stands for UTC).</p><h2>What data can I upload?</h2><p>To see your CRM data in Gong, upload the following entities:</p><ul>  <li>Business User: The CRM user, such as a seller or manager. </li>  <li>Account: The customer details in the CRM</li>  <li>Contact: A specific contact in the CRM that is associated with a customer</li>  <li>Deal: A deal or opportunity, or a contract of a specific account in the CRM</li>  <li>Lead: A potential customers who are not associated with an account</li>  <li>Stage: The list of stages the deal can be in, in your CRM</li></ul><h2>Uploading CRM data to Gong</h2><p>This diagram shows how to set up your system in order to upload CRM data to Gong. This is relevant for each scenario of uploading data, initial, incremental and uploading historical data.</p><img alt=\"\" src=\"/r/img/permanent/crm_api_flow.png\" height=\"95%\" ><h3>Registering your Integration</h3><p>Register your integration to get an integrationId used to identify your company's integration with Gong. This is a one time action that does not need to be repeated unless you delete your integration.</p><p>Use <code>PUT v2/crm/integrations</code> to register your integration. The integration Id is returned in the response. Include the integration Id each time you upload your CRM data.</p><h3>Uploading additional data for CRM entities</h3><p>Each CRM entity has a set of standard fields. In addition, you may want to upload additional fields.</p><p>Use the <code>POST /v2/crm/entity-schema</code> to adjust the schema according to your needs. Once you have uploaded your schema to Gong, you can upload your entities with the additional fields.</p><h3>Uploading your CRM data to Gong</h3><p>This section explains how you can use the CRM API to upload your data to Gong:</p><h4>First-time upload</h4><p>Create a database dump of the data you want to upload to Gong based on your CRM schema and data. When uploading your data for the first time you should include all of the CRM records that should appear in Gong.</p><h4>Incremental upload </h4><p>Send regular incremental data updates to Gong. You can update your data as often as you like, we recommend updating between every 1-5 minutes.<br>You should only send new records or records that have changed since the previous upload of data. New records are added to Gong and existing records are updated or deleted, whichever is relevant. Entities are identified by the objectId. Ensure that this ID remains the same each time it is updated.</p><p>When updating data, the modificationDate parameter is mandatory. This enables us to maintain accurate historical data. If your CRM does not store the modification date, send the date the API call is made.</p><h4>Uploading data change history</h4><p>Gong incorporates historical change data in different areas of Gong in order to provide a more accurate picture of the status of different entities at that time. For example, showing the correct stage of a deal at the time a call was made.</p><p>If your CRM stores record history, you are encouraged to load historical change data as part of the integration. You can do this at any time, but we recommend doing this after the initial upload as follows:</p><ol>  <li>Generate the JSON files with the relevant data. Ensure that the modifiedDate is set to the date the entity was updated.</li>  <li>Upload the entities with their historical data using the <code>POST /v2/crm/entities?objectType=ACCOUNT|CONTACT|DEAL|LEAD</code> endpoint.</li></ol><h2>Gong Data Model</h2><p>This diagram shows the connection between the different objects in the CRM API:</p><img alt=\"\" src=\"/r/img/permanent/crm_api_model.png\" height=\"80%\"><p>The following relationship between entities must exist:</p><ul>  <li>A contact must be linked to a single account.</li>  <li>A deal is linked to a single account.</li>  <li>A deal has an owner who is a user in Gong.</li>  <li>A converted lead is expected to be converted into an account and/or a deal and/or a contact.</li></ul><h2>What if my CRM doesn't match the Gong data model?</h2><p>It is possible that your CRM entity model won't match the Gong CRM entity model. Your CRM may store your data in different entities, or you may not have an entity that represents one of the Gong CRM entities.</p><p>In order to upload your CRM data and associate it with calls and conversations, you need to identify the objects in your CRM which match the Gong CRM entities.</p><p>The account is a mandatory entity which must be uploaded in order to integrate Gong with your CRM. To upload account data, identify your CRM entities that contain data about your customers or companies that you do business with. These customers are not actual people within the org, rather they represent the org itself.</p><p>To upload contact details, identify your CRM entities that hold data about employees in the company that your reps are in touch with. A contact represents a person where communication has advanced beyond the prospect stage. Your reps will have multiple conversations and interactions with the contact.</p><p>The deal represents the selling process to the customer (account).</p><p>The lead is a prospect or potential contact, who is not yet associated with an account. If your CRM has an entity which represents people who you contact in the very early stages, and who is later converted to another entity which represents the people you are doing business with (the contact), upload this data as a lead entity.</p><h2>When will my CRM data be displayed in Gong?</h2><p>In addition to the time it takes for data to upload to Gong, the data is first uploaded as raw data and is not automatically available in Gong.</p><br><br><br><br>"
    },
    {
      "name": "Auditing",
      "description": "<h3>Gong’s “Auditing” API endpoints allow you to request the following log types from Gong:</h3>\n<ul>\n<li>\nAccess Log - This log is preserved for 14 days only\n</li>\n<li>\nUser Activity Log - The data is available since March 2021\n</li>\n<li>\nUser Call Play Log - All data is available since inception\n</li>\n<li>\nExternally Shared Call Access Log - All data is available since inception\n</li>\n<li>\nExternally Shared Call Play Log - All data is available since inception\n</li>\n</ul>\n"
    },
    {
      "name": "Meetings (in Beta Phase)",
      "description": "<h3>Gong’s “Consent Meeting” API endpoints allow you to:</h3>\n<ul>\n<li>\nRequest creating a Gong Consent meeting link\n</li>\n<li>\nUpdate a Consent Meeting’s details\n</li>\n<li>\nDelete a Consent Meeting\n</li>\n<li>\nList all Licensed Users in the Gong instance and their Consent Page status\n</li>\n</ul>\n<h3>The requested calls may contain the following meeting details:</h3>\n<ul>\n<li>\nMeeting Scheduled Start Time\n</li>\n<li>\nMeeting Scheduled End Time\n</li>\n<li>\nOrganizer\n</li>\n<li>\nMeeting Title\n</li>\n<li>\nInvitees\n</li>\n<li>\nExternal Meeting Id - The ID as it is formed on an external system\n</li>\n</ul>\n"
    },
    {
      "name": "Permissions",
      "description": "<h3>Gong’s \"Permission\" API endpoints allow you to:</h3>\n<ul>\n<li>\nList all permission profiles in a given workspace\n</li>\n<li>\nCreate permission profile\n</li>\n<li>\nGet a permission profile\n</li>\n<li>\nUpdate permission profile\n</li>\n<li>\nList all users controlled by a permission profile\n</li>\n<li>\nAllow users individual access to calls\n</li>\n<li>\nRemove user's individual access to calls\n</li>\n<li>\nRetrieve users that have individual access to calls\n</li>\n</ul>\n"
    },
    {
      "name": "Engage Flows",
      "description": "<h3>Gong’s “Flows” API endpoints allow you to:</h3>\n<ul>\n<li>\nView a list of relevant Gong Engage flows to choose from and the current flow assignment status\n</li>\n<li>\nAdd prospects to Gong Engage flows\n</li>\n</ul>\n"
    },
    {
      "name": "Digital Interactions",
      "description": "<p>Digital interactions (DIs) are events people make when interacting with (mostly) digital content. It can be described as an action someone did on an object. Anything from viewing a document or a video, to registering/completing a course or someone visiting your website. </p><p>The below proposed Digital Interactions API allows mainly tech-partners (and also customers) to capture and track user interactions with various types of digital content. It provides a structured schema for recording a person’s identity, action, content details, and additional contextual information. The API enables seamless integration between tech-partner systems and the Gong platform, providing valuable insights into buyer-seller interactions that sometimes are hidden from a seller’s line-of-sight. </p><p> For simplicity & clarity, the API scheme is designed according to a real-world scenario, including the following terminology:For simplicity & clarity, the API scheme is designed according to a real-world scenario, including the following terminology:</p><ul>  <li>Event: Represents something that happened, described as an action verb + content engaged (e.g., \"signed a contract\").</li>  <li>Content: Refers to the specific content engaged during the event (e.g., contract). Provides details such as label, title, ID, and URLs.</li>  <li>Person: Represents the individual responsible for the action. Can be a known person or an anonymous user associated with a company.</li>  <li>Content Custom Fields: Custom properties for the content. Example: Custom field - \"Version: 2.0\", Custom field - \"Author: Jane Smith\".</li>  <li>Company: Refers to the organization associated with the person. Example: Company ID - \"7890\", Company name - \"XYZ Corp\".</li>  <li>Partner: An external collaborating organization that owns a software product involved in the digital interactions captured by the API.</li></ul>"
    },
    {
      "name": "Integration Settings",
      "description": "<p>Configure your integration settings for displaying your company data in iFrames. For example, use this API to configure dynamic links as the iFrame source. This endpoint includes validation mechanisms to ensure the integration is secure.</p><p>Mandatory fields are marked with a *.</p>"
    },
    {
      "name": "Engagement (Legacy – See “Digital Interactions”)",
      "description": "<h3>Limited release - contact <a href=\"mailto:integration.requests@gong.io\">integration.requests@gong.io</a> for more information.\n</h3>\n\n<h3>Gong’s \"Engagement\" API endpoints allow you to push engagement events into Gong and display them as events in Gong’s activity timeline.</h3>\n<h3>There are currently 3 types of events:</h3>\n<ul>\n<li>\n\"Content Shared\" Event Type - Use this event type to push engagement events into Gong when a Gong user shares content with external participants (for example, a contract was “shared” by the account executive with his prospects)</li>\n<li>\n\"Content Viewed\" Event Type - Use this event type to push engagement events into Gong when a content is viewed by an external participant (for example, a contract was “viewed” by the prospect)\n</li>\n<li>\n\"Custom Action\" Event Type -  Use this event type to push engagement events into Gong when a content is engaged by an external participant (for example, a contract was “signed” by the prospect)</li>\n</ul>\n"
    }
  ],
  "paths": {
    "/v2/crm/entity-schema": {
      "post": {
        "operationId": "uploadCrmSchemaField",
        "summary": "Upload Object Schema (/v2/crm/entity-schema)",
        "description": "<style>.public-api-info {    background: rgb(222, 235, 255);}.public-api-tip {    background: rgb(227, 252, 239);}.public-api-parameter {    background: rgba(9,30,66,0.08);}.public-api-note {    background: rgb(234, 230, 255);}.public-api-important {    background: rgb(255, 250, 230);}.public-api-critical {    background: rgb(255, 235, 230);}table, th, td {  border: 1px solid gray;  border-collapse: collapse;}th, td {  padding: 5px;}th {  text-align: left;}img {  border: 2px solid #D3D5D9;}</style><p>Enables you to add, edit or remove fields to Gong CRM entities, so that you can display additional CRM data in Gong. Fields that are not included in the Gong CRM objects, and are uploaded without updating your schema, are not displayed in Gong.</p><p>Update your schema when:</p><ul>  <li>You create a new integration</li>  <li>There are changes to the schema of any object type. You can also send a schema update request before any request to the <code>/v2/crm/entities</code> API.</li></ul><p>When updating your schema:</p><ul>  <li>Add or change field: include all fields you want in the schema, including those sent previously. Example:     <table>      <tr>        <th>Date</th>        <th>Action</th>        <th>Result</th>      </tr>      <tr>        <td>3/4/2023</td>        <td>Send account schema with fieldA</td>        <td>fieldA added to the account</td>      </tr>      <tr>        <td>6/4/23</td>        <td>Send account schema with fieldA and fieldB</td>        <td>fieldA still included in account schema. fieldB added to the account</td>      </tr>      <tr>        <td>8/4/23</td>        <td>Send account schema with fieldC but without fieldA and fieldB</td>        <td>Receive an error that you must include all fields in the schema</td>      </tr>      <tr>        <td>15/4/23</td>        <td>Send account schema with fieldB, fieldC, and isDeleted for fieldA</td>        <td>fieldA and all it's data are deleted. fieldB and fieldC remain in the schema</td>      </tr>    </table>  </li>  <li>Changing a field: if you change the field type, a new field is created and the data associated with the original field is deleted. Other changes, such as the label do not result in data being deleted.</li>  <li>Deleting a field: to delete a field and it's associated data, send the field with isDeleted = true</li></ul><p>When accessed using a bearer token, this endpoint requires the 'api:crm:schema' scope.</p><h2>Supported field types</h2><p>This table describes the field types that can be added to your schema</p><table>  <tr><th>Field type</th><th>Format in JSON</th><th>Possible values</th></tr>  <tr><td>BOOLEAN</td><td>boolean</td><td>true, false</td></tr>  <tr><td>DATE</td><td>string (ISO-8601 date without time)</td><td>\"2020-05-31\"</td></tr>  <tr><td>DATETIME</td><td>string (ISO-8601 datetime without milliseconds)</td><td>\"2020-12-17T07:37:21+02:00\"<p>\"2020-12-17T05:37:21Z\"</p></td></tr>  <tr><td>PICKLIST</td><td>string - one of the values in an orderedValueList</td><td>\"Analyst\"</td></tr>  <tr><td>NUMBER</td><td>number</td><td>45.66, 8453</td></tr>  <tr><td>PERCENT</td><td>number (between 0 to 100)</td><td>67.3</td></tr>  <tr><td>CURRENCY*</td><td>number</td><td>34.68</td></tr>  <tr><td>PHONENUMBER</td><td>string</td><td>\"+14055766687\"</td></tr>  <tr><td>EMAILADDRESS</td><td>string</td><td>\"john.doe@anywhere.com\"</td></tr>  <tr><td>REFERENCE</td><td>string - the id of another object</td><td>\"48b009drax\"</td></tr>  <tr><td>ID</td><td>string - the id of the object</td><td>\"843hf8484jr84htg\"</td></tr>  <tr><td>STRING</td><td>string</td><td>\"whatever you want\"</td></tr>  <tr><td>URL</td><td>string</td><td>\"https://crm.com/account/6d4r578f\"</td></tr></table><p>* In the integration send a number value, and specify the correct currency symbol in the Gong UI. Currently Gong does not support multiple currencies per company.</p><h3>Example</h3><h4>Request</h4><p><code>POST https://api.gong.io/v2/crm/entity-schema?integrationId=6286478263646&objectType=ACCOUNT</code></p><p><code>[{\"uniqueName\": \"orderId\", \"label\": \"ID\", \"type\": \"ID\", \"lastModified\": \"2020-11-11T08:11:34+01:00\"},</code></p><p><code>{\"uniqueName\": \"parentAccount\", \"label\": \"Main Account\", \"type\": \"REFERENCE\", \"referenceTo\": \"ACCOUNT\", \"lastModified\": \"2020-11-11T08:11:34+01:00\"},</code></p><p><code>{\"uniqueName\": \"category\", \"label\": \"Category\", \"type\": \"PICKLIST\", \"orderedValueList\": [\"Analyst\", \"Competitor\", \"Customer\", \"Integrator\", \"Investor\", \"Partner\", \"Other\"], \"lastModified\": \"2020-11-11T08:11:34+01:00\"}, </code></p><p>// remove custom field</p><p><code>{\"uniqueName\": \"industry\", \"isDeleted\": true, \"label\": \"Industry\", \"type\": \"PICKLIST\", \"lastModified\": \"2020-11-21T08:11:34+01:00\"}] </code></p>",
        "parameters": [
          {
            "name": "integrationId",
            "in": "query",
            "description": "Integration ID generated when creating the integration",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int64"
            }
          },
          {
            "name": "objectType",
            "in": "query",
            "description": "The object type to set the schema for (case-sensitive)",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "ACCOUNT",
                "CONTACT",
                "DEAL",
                "LEAD"
              ]
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/GenericSchemaFieldRequest"
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BaseResponse"
                }
              }
            }
          },
          "201": {
            "description": "Successfully uploaded crm schema fields",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SchemaUpdateResponse"
                }
              }
            }
          },
          "400": {
            "description": "Malformed request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Access denied",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "API request limit exceeded",
            "headers": {
              "Retry-After": {
                "description": "Number of seconds to wait before making a new request.",
                "style": "simple",
                "schema": {
                  "type": "integer",
                  "format": "int32"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Failed to complete the operation due to an unexpected error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "tags": [
          "CRM"
        ]
      }
    }
  },
  "components": {
    "schemas": {
      "GenericSchemaFieldRequest": {
        "description": "selectedFields",
        "type": "object",
        "properties": {
          "uniqueName": {
            "description": "The unique name of the field in the CRM system",
            "type": "string",
            "example": "accountowner"
          },
          "label": {
            "description": "The label to use in the UI for this field",
            "type": "string",
            "example": "Account Owner"
          },
          "type": {
            "description": "The field type (case-sensitive). Must be one of the types listed above.",
            "type": "string",
            "example": "REFERENCE",
            "enum": [
              "DATE",
              "DATETIME",
              "NUMBER",
              "PERCENT",
              "CURRENCY",
              "ID",
              "URL",
              "STRING",
              "BOOLEAN",
              "PHONENUMBER",
              "EMAILADDRESS",
              "PICKLIST",
              "REFERENCE",
              "STRINGARRAY"
            ]
          },
          "lastModified": {
            "description": "The date and time the schema was last modified. <br>Valid format: ISO-8601 format without milliseconds e.g., \"2020-12-17T13:45:01Z\"",
            "type": "string",
            "example": "2020-12-17T13:45:01Z"
          },
          "isDeleted": {
            "description": "When true, deletes the field from the schema and its value is removed from all objects. Use with caution",
            "type": "boolean",
            "example": false
          },
          "referenceTo": {
            "description": "The object type this field refers to. Required for field of type REFERENCE. Must be one of \"ACCOUNT\", \"CONTACT\", \"DEAL\", \"LEAD\" or \"USER\"",
            "type": "string",
            "example": "USER"
          },
          "orderedValueList": {
            "description": "The list of values for the field. Required for PICKLIST fields",
            "type": "array",
            "items": {
              "type": "string",
              "description": "The list of values for the field. Required for PICKLIST fields",
              "example": "[\"Analyst\",\"Competitor\",\"Customer\",\"Integrator\",\"Investor\",\"Partner\",\"Other\"]"
            },
            "example": [
              "Analyst",
              "Competitor",
              "Customer",
              "Integrator",
              "Investor",
              "Partner",
              "Other"
            ]
          }
        },
        "required": [
          "label",
          "type",
          "uniqueName"
        ]
      },
      "BaseResponse": {
        "type": "object",
        "properties": {
          "requestId": {
            "description": "A Gong request reference Id, generated for this request. Can be used for troubleshooting purposes.",
            "type": "string",
            "example": "4al018gzaztcr8nbukw"
          }
        }
      },
      "SchemaUpdateResponse": {
        "type": "object",
        "properties": {
          "requestId": {
            "description": "A Gong request reference Id, generated for this request. Can be used for troubleshooting purposes.",
            "type": "string",
            "example": "4al018gzaztcr8nbukw"
          }
        }
      },
      "ErrorResponse": {
        "type": "object",
        "properties": {
          "requestId": {
            "description": "A Gong request reference Id, generated for this request. Can be used for troubleshooting purposes.",
            "type": "string",
            "example": "4al018gzaztcr8nbukw"
          },
          "errors": {
            "description": "Error messages.",
            "type": "array",
            "items": {
              "type": "string"
            },
            "example": [
              "An error has occurred"
            ]
          }
        }
      }
    }
  }
}
````

