{"componentChunkName":"component---src-templates-simple-markdown-js","path":"/developer-portal/v2/recipes/custom-connections/","matchPath":"","result":{"data":{"markdownRemark":{"html":"<h1 style=\"position:relative;\"><a href=\"#work-with-custom-connections\" aria-label=\"work with custom connections permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a><div class=\"hidden-anchor\" id=\"work-with-custom-connections\"></div>Work with Custom Connections</h1>\n<h2 style=\"position:relative;\"><a href=\"#1-general\" aria-label=\"1 general permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a><div class=\"hidden-anchor\" id=\"1-general\"></div>1. General</h2>\n<p>Custom Connections let you push your own data into Drata so it can be used for compliance evidence. The behavior depends on the provider type you choose when creating the connection:</p>\n<table>\n<thead>\n<tr>\n<th>Provider type</th>\n<th>Schema required?</th>\n<th>Record endpoint</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td><code class=\"language-text\">CUSTOM</code></td>\n<td>Yes — you define the schema via <code class=\"language-text\">schema</code> or <code class=\"language-text\">sampleData</code> + <code class=\"language-text\">displayNameKey</code></td>\n<td><code class=\"language-text\">/custom-connections/{connectionId}/resources/{resourceId}/records</code></td>\n</tr>\n<tr>\n<td><code class=\"language-text\">MDM</code></td>\n<td>No — Drata uses a fixed common device model</td>\n<td><code class=\"language-text\">/custom-connections/{connectionId}/devices</code></td>\n</tr>\n<tr>\n<td><code class=\"language-text\">HRIS</code></td>\n<td>No — Drata uses a fixed common HRIS model</td>\n<td><code class=\"language-text\">/custom-connections/{connectionId}/hris-user-identities</code></td>\n</tr>\n</tbody>\n</table>\n<blockquote>\n<p><strong>Note:</strong> Passing <code class=\"language-text\">schema</code>, <code class=\"language-text\">sampleData</code>, <code class=\"language-text\">displayNameKey</code>, or <code class=\"language-text\">workspaceIds</code> for an <code class=\"language-text\">MDM</code> or <code class=\"language-text\">HRIS</code> connection will return a <code class=\"language-text\">400 Bad Request</code>.</p>\n</blockquote>\n<p>Sections 3 and 4 of this recipe (record and session management) apply to <strong><code class=\"language-text\">CUSTOM</code> connections only</strong>. For <code class=\"language-text\">MDM</code> and <code class=\"language-text\">HRIS</code> connections, refer to the <a href=\"https://developers.drata.com/docs/openapi/reference/v2/tag/Devices/\">Devices</a> and <a href=\"https://developers.drata.com/docs/openapi/reference/v2/tag/HRIS-User-Identities/\">HRIS User Identities</a> endpoint references respectively.</p>\n<p>For <code class=\"language-text\">CUSTOM</code> connections, records can be uploaded two ways:</p>\n<ul>\n<li>\n<strong>Direct upload</strong>\n — immediately live, good for incremental updates to individual records\n</li>\n<li>\n<strong>Session-based upload</strong>\n — stage a full batch before committing it; when you complete the session, Drata atomically replaces the active dataset with the new batch\n</li>\n</ul>\n<p>The session-based approach is recommended for bulk syncs where you want an all-or-nothing replacement of your data.</p>\n<hr>\n<h2 style=\"position:relative;\"><a href=\"#2-setup\" aria-label=\"2 setup permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a><div class=\"hidden-anchor\" id=\"2-setup\"></div>2. Setup</h2>\n<h3 style=\"position:relative;\"><a href=\"#21-create-a-custom-connection\" aria-label=\"21 create a custom connection permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a><div class=\"hidden-anchor\" id=\"21-create-a-custom-connection\"></div>2.1 Create a Custom Connection</h3>\n<div class=\"code-wrapper\">\n        <div class=\"gatsby-code-button-container\"\n             data-toaster-id=\"68974308791522220000\"\n             data-toaster-duration=\"1500\"\n             onClick=\"copyCodeToClipboard(`POST https://public-api.drata.com/public/v2/custom-connections`, `68974308791522220000`)\"\n        >\n          <div class=\"gatsby-code-button\" title=\"Copy the code snippet\">Copy</div>\n          <div class=\"done-indicator done-indicator-68974308791522220000\">Copied</div>\n        </div>\n        <div class=\"gatsby-highlight\" data-language=\"http\"><pre class=\"language-http\"><code class=\"language-http\">POST https://public-api.drata.com/public/v2/custom-connections</code></pre></div>\n      </div>\n<h4 style=\"position:relative;\"><a href=\"#custom-connection-user-defined-schema\" aria-label=\"custom connection user defined schema permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a><div class=\"hidden-anchor\" id=\"custom-connection-user-defined-schema\"></div>CUSTOM connection (user-defined schema)</h4>\n<p>You define the schema for your records. Use <code class=\"language-text\">schema</code> to provide a JSON Schema directly, or <code class=\"language-text\">sampleData</code> to have Drata infer the schema from a representative record. <code class=\"language-text\">displayNameKey</code> is required and must be a top-level key in the schema.</p>\n<p><strong>Option A: Provide a JSON Schema directly</strong></p>\n<div class=\"code-wrapper\">\n        <div class=\"gatsby-code-button-container\"\n             data-toaster-id=\"71085778600484970000\"\n             data-toaster-duration=\"1500\"\n             onClick=\"copyCodeToClipboard(`{\n  &quot;name&quot;: &quot;Software Inventory&quot;,\n  &quot;providerTypes&quot;: [&quot;CUSTOM&quot;],\n  &quot;workspaceIds&quot;: [1],\n  &quot;displayNameKey&quot;: &quot;packageName&quot;,\n  &quot;description&quot;: &quot;Software packages installed across the fleet.&quot;,\n  &quot;schema&quot;: {\n    &quot;type&quot;: &quot;object&quot;,\n    &quot;properties&quot;: {\n      &quot;packageName&quot;: { &quot;type&quot;: &quot;string&quot; },\n      &quot;version&quot;: { &quot;type&quot;: &quot;string&quot; },\n      &quot;vendor&quot;: { &quot;type&quot;: &quot;string&quot; },\n      &quot;installedAt&quot;: { &quot;type&quot;: &quot;string&quot; },\n      &quot;isApproved&quot;: { &quot;type&quot;: &quot;boolean&quot; }\n    },\n    &quot;additionalProperties&quot;: true\n  }\n}`, `71085778600484970000`)\"\n        >\n          <div class=\"gatsby-code-button\" title=\"Copy the code snippet\">Copy</div>\n          <div class=\"done-indicator done-indicator-71085778600484970000\">Copied</div>\n        </div>\n        <div class=\"gatsby-highlight\" data-language=\"json\"><pre class=\"language-json\"><code class=\"language-json\"><span class=\"token punctuation\">{</span>\n  <span class=\"token property\">\"name\"</span><span class=\"token operator\">:</span> <span class=\"token string\">\"Software Inventory\"</span><span class=\"token punctuation\">,</span>\n  <span class=\"token property\">\"providerTypes\"</span><span class=\"token operator\">:</span> <span class=\"token punctuation\">[</span><span class=\"token string\">\"CUSTOM\"</span><span class=\"token punctuation\">]</span><span class=\"token punctuation\">,</span>\n  <span class=\"token property\">\"workspaceIds\"</span><span class=\"token operator\">:</span> <span class=\"token punctuation\">[</span><span class=\"token number\">1</span><span class=\"token punctuation\">]</span><span class=\"token punctuation\">,</span>\n  <span class=\"token property\">\"displayNameKey\"</span><span class=\"token operator\">:</span> <span class=\"token string\">\"packageName\"</span><span class=\"token punctuation\">,</span>\n  <span class=\"token property\">\"description\"</span><span class=\"token operator\">:</span> <span class=\"token string\">\"Software packages installed across the fleet.\"</span><span class=\"token punctuation\">,</span>\n  <span class=\"token property\">\"schema\"</span><span class=\"token operator\">:</span> <span class=\"token punctuation\">{</span>\n    <span class=\"token property\">\"type\"</span><span class=\"token operator\">:</span> <span class=\"token string\">\"object\"</span><span class=\"token punctuation\">,</span>\n    <span class=\"token property\">\"properties\"</span><span class=\"token operator\">:</span> <span class=\"token punctuation\">{</span>\n      <span class=\"token property\">\"packageName\"</span><span class=\"token operator\">:</span> <span class=\"token punctuation\">{</span> <span class=\"token property\">\"type\"</span><span class=\"token operator\">:</span> <span class=\"token string\">\"string\"</span> <span class=\"token punctuation\">}</span><span class=\"token punctuation\">,</span>\n      <span class=\"token property\">\"version\"</span><span class=\"token operator\">:</span> <span class=\"token punctuation\">{</span> <span class=\"token property\">\"type\"</span><span class=\"token operator\">:</span> <span class=\"token string\">\"string\"</span> <span class=\"token punctuation\">}</span><span class=\"token punctuation\">,</span>\n      <span class=\"token property\">\"vendor\"</span><span class=\"token operator\">:</span> <span class=\"token punctuation\">{</span> <span class=\"token property\">\"type\"</span><span class=\"token operator\">:</span> <span class=\"token string\">\"string\"</span> <span class=\"token punctuation\">}</span><span class=\"token punctuation\">,</span>\n      <span class=\"token property\">\"installedAt\"</span><span class=\"token operator\">:</span> <span class=\"token punctuation\">{</span> <span class=\"token property\">\"type\"</span><span class=\"token operator\">:</span> <span class=\"token string\">\"string\"</span> <span class=\"token punctuation\">}</span><span class=\"token punctuation\">,</span>\n      <span class=\"token property\">\"isApproved\"</span><span class=\"token operator\">:</span> <span class=\"token punctuation\">{</span> <span class=\"token property\">\"type\"</span><span class=\"token operator\">:</span> <span class=\"token string\">\"boolean\"</span> <span class=\"token punctuation\">}</span>\n    <span class=\"token punctuation\">}</span><span class=\"token punctuation\">,</span>\n    <span class=\"token property\">\"additionalProperties\"</span><span class=\"token operator\">:</span> <span class=\"token boolean\">true</span>\n  <span class=\"token punctuation\">}</span>\n<span class=\"token punctuation\">}</span></code></pre></div>\n      </div>\n<p><strong>Option B: Provide sample data and let Drata infer the schema</strong></p>\n<div class=\"code-wrapper\">\n        <div class=\"gatsby-code-button-container\"\n             data-toaster-id=\"91083430325246510000\"\n             data-toaster-duration=\"1500\"\n             onClick=\"copyCodeToClipboard(`{\n  &quot;name&quot;: &quot;Software Inventory&quot;,\n  &quot;providerTypes&quot;: [&quot;CUSTOM&quot;],\n  &quot;workspaceIds&quot;: [1],\n  &quot;displayNameKey&quot;: &quot;packageName&quot;,\n  &quot;description&quot;: &quot;Software packages installed across the fleet.&quot;,\n  &quot;sampleData&quot;: {\n    &quot;packageName&quot;: &quot;1Password&quot;,\n    &quot;version&quot;: &quot;8.10.36&quot;,\n    &quot;vendor&quot;: &quot;AgileBits&quot;,\n    &quot;installedAt&quot;: &quot;2024-01-15T00:00:00Z&quot;,\n    &quot;isApproved&quot;: true\n  }\n}`, `91083430325246510000`)\"\n        >\n          <div class=\"gatsby-code-button\" title=\"Copy the code snippet\">Copy</div>\n          <div class=\"done-indicator done-indicator-91083430325246510000\">Copied</div>\n        </div>\n        <div class=\"gatsby-highlight\" data-language=\"json\"><pre class=\"language-json\"><code class=\"language-json\"><span class=\"token punctuation\">{</span>\n  <span class=\"token property\">\"name\"</span><span class=\"token operator\">:</span> <span class=\"token string\">\"Software Inventory\"</span><span class=\"token punctuation\">,</span>\n  <span class=\"token property\">\"providerTypes\"</span><span class=\"token operator\">:</span> <span class=\"token punctuation\">[</span><span class=\"token string\">\"CUSTOM\"</span><span class=\"token punctuation\">]</span><span class=\"token punctuation\">,</span>\n  <span class=\"token property\">\"workspaceIds\"</span><span class=\"token operator\">:</span> <span class=\"token punctuation\">[</span><span class=\"token number\">1</span><span class=\"token punctuation\">]</span><span class=\"token punctuation\">,</span>\n  <span class=\"token property\">\"displayNameKey\"</span><span class=\"token operator\">:</span> <span class=\"token string\">\"packageName\"</span><span class=\"token punctuation\">,</span>\n  <span class=\"token property\">\"description\"</span><span class=\"token operator\">:</span> <span class=\"token string\">\"Software packages installed across the fleet.\"</span><span class=\"token punctuation\">,</span>\n  <span class=\"token property\">\"sampleData\"</span><span class=\"token operator\">:</span> <span class=\"token punctuation\">{</span>\n    <span class=\"token property\">\"packageName\"</span><span class=\"token operator\">:</span> <span class=\"token string\">\"1Password\"</span><span class=\"token punctuation\">,</span>\n    <span class=\"token property\">\"version\"</span><span class=\"token operator\">:</span> <span class=\"token string\">\"8.10.36\"</span><span class=\"token punctuation\">,</span>\n    <span class=\"token property\">\"vendor\"</span><span class=\"token operator\">:</span> <span class=\"token string\">\"AgileBits\"</span><span class=\"token punctuation\">,</span>\n    <span class=\"token property\">\"installedAt\"</span><span class=\"token operator\">:</span> <span class=\"token string\">\"2024-01-15T00:00:00Z\"</span><span class=\"token punctuation\">,</span>\n    <span class=\"token property\">\"isApproved\"</span><span class=\"token operator\">:</span> <span class=\"token boolean\">true</span>\n  <span class=\"token punctuation\">}</span>\n<span class=\"token punctuation\">}</span></code></pre></div>\n      </div>\n<table>\n<thead>\n<tr>\n<th>Field</th>\n<th>Required</th>\n<th>Description</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td><code class=\"language-text\">name</code></td>\n<td>Yes</td>\n<td>Display name for the connection</td>\n</tr>\n<tr>\n<td><code class=\"language-text\">providerTypes</code></td>\n<td>Yes</td>\n<td><code class=\"language-text\">[\"CUSTOM\"]</code></td>\n</tr>\n<tr>\n<td><code class=\"language-text\">workspaceIds</code></td>\n<td>Yes</td>\n<td>At least one workspace ID</td>\n</tr>\n<tr>\n<td><code class=\"language-text\">schema</code></td>\n<td>No*</td>\n<td>JSON Schema for your records. Provide either <code class=\"language-text\">schema</code> or <code class=\"language-text\">sampleData</code>, not both. *Required if <code class=\"language-text\">sampleData</code> is not provided.</td>\n</tr>\n<tr>\n<td><code class=\"language-text\">sampleData</code></td>\n<td>No*</td>\n<td>A representative record from which Drata infers the schema. Provide either <code class=\"language-text\">sampleData</code> or <code class=\"language-text\">schema</code>, not both. *Required if <code class=\"language-text\">schema</code> is not provided.</td>\n</tr>\n<tr>\n<td><code class=\"language-text\">displayNameKey</code></td>\n<td>Yes</td>\n<td>Top-level schema field used as the human-readable label for each record in the Drata UI (e.g. <code class=\"language-text\">\"packageName\"</code>). Must exist as a property in the provided or inferred schema.</td>\n</tr>\n<tr>\n<td><code class=\"language-text\">description</code></td>\n<td>No</td>\n<td>Optional description</td>\n</tr>\n</tbody>\n</table>\n<hr>\n<h4 style=\"position:relative;\"><a href=\"#mdm-connection-fixed-device-model\" aria-label=\"mdm connection fixed device model permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a><div class=\"hidden-anchor\" id=\"mdm-connection-fixed-device-model\"></div>MDM connection (fixed device model)</h4>\n<p>MDM connections use Drata's built-in device data model. Do <strong>not</strong> provide <code class=\"language-text\">schema</code>, <code class=\"language-text\">sampleData</code>, <code class=\"language-text\">displayNameKey</code>, or <code class=\"language-text\">workspaceIds</code> — MDM connections are global.</p>\n<div class=\"code-wrapper\">\n        <div class=\"gatsby-code-button-container\"\n             data-toaster-id=\"67608761124316840000\"\n             data-toaster-duration=\"1500\"\n             onClick=\"copyCodeToClipboard(`{\n  &quot;name&quot;: &quot;Fleet MDM&quot;,\n  &quot;providerTypes&quot;: [&quot;MDM&quot;],\n  &quot;description&quot;: &quot;Device inventory synced from our MDM solution.&quot;\n}`, `67608761124316840000`)\"\n        >\n          <div class=\"gatsby-code-button\" title=\"Copy the code snippet\">Copy</div>\n          <div class=\"done-indicator done-indicator-67608761124316840000\">Copied</div>\n        </div>\n        <div class=\"gatsby-highlight\" data-language=\"json\"><pre class=\"language-json\"><code class=\"language-json\"><span class=\"token punctuation\">{</span>\n  <span class=\"token property\">\"name\"</span><span class=\"token operator\">:</span> <span class=\"token string\">\"Fleet MDM\"</span><span class=\"token punctuation\">,</span>\n  <span class=\"token property\">\"providerTypes\"</span><span class=\"token operator\">:</span> <span class=\"token punctuation\">[</span><span class=\"token string\">\"MDM\"</span><span class=\"token punctuation\">]</span><span class=\"token punctuation\">,</span>\n  <span class=\"token property\">\"description\"</span><span class=\"token operator\">:</span> <span class=\"token string\">\"Device inventory synced from our MDM solution.\"</span>\n<span class=\"token punctuation\">}</span></code></pre></div>\n      </div>\n<p>After creating, use the <a href=\"https://developers.drata.com/docs/openapi/reference/v2/tag/Devices/\">Devices endpoints</a> to upload device records.</p>\n<hr>\n<h4 style=\"position:relative;\"><a href=\"#hris-connection-fixed-hris-model\" aria-label=\"hris connection fixed hris model permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a><div class=\"hidden-anchor\" id=\"hris-connection-fixed-hris-model\"></div>HRIS connection (fixed HRIS model)</h4>\n<p>HRIS connections use Drata's built-in HRIS data model. Do <strong>not</strong> provide <code class=\"language-text\">schema</code>, <code class=\"language-text\">sampleData</code>, <code class=\"language-text\">displayNameKey</code>, or <code class=\"language-text\">workspaceIds</code> — HRIS connections are global.</p>\n<div class=\"code-wrapper\">\n        <div class=\"gatsby-code-button-container\"\n             data-toaster-id=\"2995875644272794000\"\n             data-toaster-duration=\"1500\"\n             onClick=\"copyCodeToClipboard(`{\n  &quot;name&quot;: &quot;Employee Directory&quot;,\n  &quot;providerTypes&quot;: [&quot;HRIS&quot;],\n  &quot;description&quot;: &quot;Employee roster synced from our internal HRIS.&quot;\n}`, `2995875644272794000`)\"\n        >\n          <div class=\"gatsby-code-button\" title=\"Copy the code snippet\">Copy</div>\n          <div class=\"done-indicator done-indicator-2995875644272794000\">Copied</div>\n        </div>\n        <div class=\"gatsby-highlight\" data-language=\"json\"><pre class=\"language-json\"><code class=\"language-json\"><span class=\"token punctuation\">{</span>\n  <span class=\"token property\">\"name\"</span><span class=\"token operator\">:</span> <span class=\"token string\">\"Employee Directory\"</span><span class=\"token punctuation\">,</span>\n  <span class=\"token property\">\"providerTypes\"</span><span class=\"token operator\">:</span> <span class=\"token punctuation\">[</span><span class=\"token string\">\"HRIS\"</span><span class=\"token punctuation\">]</span><span class=\"token punctuation\">,</span>\n  <span class=\"token property\">\"description\"</span><span class=\"token operator\">:</span> <span class=\"token string\">\"Employee roster synced from our internal HRIS.\"</span>\n<span class=\"token punctuation\">}</span></code></pre></div>\n      </div>\n<p>After creating, use the <a href=\"https://developers.drata.com/docs/openapi/reference/v2/tag/HRIS-User-Identities/\">HRIS User Identities endpoints</a> to upload employee records.</p>\n<hr>\n<p><strong>Common fields for all connection types:</strong></p>\n<table>\n<thead>\n<tr>\n<th>Field</th>\n<th>Required</th>\n<th>Description</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td><code class=\"language-text\">name</code></td>\n<td>Yes</td>\n<td>Display name for the connection</td>\n</tr>\n<tr>\n<td><code class=\"language-text\">providerTypes</code></td>\n<td>Yes</td>\n<td>One of: <code class=\"language-text\">CUSTOM</code>, <code class=\"language-text\">MDM</code>, <code class=\"language-text\">HRIS</code></td>\n</tr>\n<tr>\n<td><code class=\"language-text\">description</code></td>\n<td>No</td>\n<td>Optional description</td>\n</tr>\n</tbody>\n</table>\n<p><strong>Reference:</strong> <a href=\"https://developers.drata.com/docs/openapi/reference/v2/operation/CustomConnectionsPublicV2Controller_createCustomConnection/\">Create Custom Connection API</a></p>\n<hr>\n<h3 style=\"position:relative;\"><a href=\"#22-retrieve-the-resource-id-custom-connections-only\" aria-label=\"22 retrieve the resource id custom connections only permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a><div class=\"hidden-anchor\" id=\"22-retrieve-the-resource-id-custom-connections-only\"></div>2.2 Retrieve the Resource ID (CUSTOM connections only)</h3>\n<p>All <code class=\"language-text\">CUSTOM</code> record and session operations require a <code class=\"language-text\">resourceId</code>. This is created automatically when you create the connection and is tied to the schema you provided.</p>\n<p>Fetch it by expanding <code class=\"language-text\">customResources</code> on the connection:</p>\n<div class=\"code-wrapper\">\n        <div class=\"gatsby-code-button-container\"\n             data-toaster-id=\"85620015187448100000\"\n             data-toaster-duration=\"1500\"\n             onClick=\"copyCodeToClipboard(`GET https://public-api.drata.com/public/v2/custom-connections/{connectionId}?expand[]=customResources`, `85620015187448100000`)\"\n        >\n          <div class=\"gatsby-code-button\" title=\"Copy the code snippet\">Copy</div>\n          <div class=\"done-indicator done-indicator-85620015187448100000\">Copied</div>\n        </div>\n        <div class=\"gatsby-highlight\" data-language=\"http\"><pre class=\"language-http\"><code class=\"language-http\">GET https://public-api.drata.com/public/v2/custom-connections/{connectionId}?expand[]=customResources</code></pre></div>\n      </div>\n<p><strong>Response (relevant fields):</strong></p>\n<div class=\"code-wrapper\">\n        <div class=\"gatsby-code-button-container\"\n             data-toaster-id=\"1647470551563135000\"\n             data-toaster-duration=\"1500\"\n             onClick=\"copyCodeToClipboard(`{\n  &quot;id&quot;: 42,\n  &quot;customResources&quot;: [\n    {\n      &quot;id&quot;: 7,\n      &quot;name&quot;: &quot;Software Inventory&quot;,\n      &quot;schema&quot;: { ... },\n      &quot;createdAt&quot;: &quot;2025-01-01T00:00:00Z&quot;,\n      &quot;updatedAt&quot;: &quot;2025-01-01T00:00:00Z&quot;\n    }\n  ]\n}`, `1647470551563135000`)\"\n        >\n          <div class=\"gatsby-code-button\" title=\"Copy the code snippet\">Copy</div>\n          <div class=\"done-indicator done-indicator-1647470551563135000\">Copied</div>\n        </div>\n        <div class=\"gatsby-highlight\" data-language=\"json\"><pre class=\"language-json\"><code class=\"language-json\"><span class=\"token punctuation\">{</span>\n  <span class=\"token property\">\"id\"</span><span class=\"token operator\">:</span> <span class=\"token number\">42</span><span class=\"token punctuation\">,</span>\n  <span class=\"token property\">\"customResources\"</span><span class=\"token operator\">:</span> <span class=\"token punctuation\">[</span>\n    <span class=\"token punctuation\">{</span>\n      <span class=\"token property\">\"id\"</span><span class=\"token operator\">:</span> <span class=\"token number\">7</span><span class=\"token punctuation\">,</span>\n      <span class=\"token property\">\"name\"</span><span class=\"token operator\">:</span> <span class=\"token string\">\"Software Inventory\"</span><span class=\"token punctuation\">,</span>\n      <span class=\"token property\">\"schema\"</span><span class=\"token operator\">:</span> <span class=\"token punctuation\">{</span> ... <span class=\"token punctuation\">}</span><span class=\"token punctuation\">,</span>\n      <span class=\"token property\">\"createdAt\"</span><span class=\"token operator\">:</span> <span class=\"token string\">\"2025-01-01T00:00:00Z\"</span><span class=\"token punctuation\">,</span>\n      <span class=\"token property\">\"updatedAt\"</span><span class=\"token operator\">:</span> <span class=\"token string\">\"2025-01-01T00:00:00Z\"</span>\n    <span class=\"token punctuation\">}</span>\n  <span class=\"token punctuation\">]</span>\n<span class=\"token punctuation\">}</span></code></pre></div>\n      </div>\n<p>Use <code class=\"language-text\">customResources[0].id</code> as the <code class=\"language-text\">resourceId</code> in all subsequent record and session requests.</p>\n<p><strong>Reference:</strong> <a href=\"https://developers.drata.com/docs/openapi/reference/v2/operation/CustomConnectionsPublicV2Controller_getCustomConnection/\">Get Custom Connection API</a></p>\n<hr>\n<h2 style=\"position:relative;\"><a href=\"#3-managing-records-directly\" aria-label=\"3 managing records directly permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a><div class=\"hidden-anchor\" id=\"3-managing-records-directly\"></div>3. Managing Records Directly</h2>\n<blockquote>\n<p><strong><code class=\"language-text\">CUSTOM</code> connections only.</strong> For <code class=\"language-text\">MDM</code> and <code class=\"language-text\">HRIS</code> connections, use the <a href=\"https://developers.drata.com/docs/openapi/reference/v2/tag/Devices/\">Devices</a> and <a href=\"https://developers.drata.com/docs/openapi/reference/v2/tag/HRIS-User-Identities/\">HRIS User Identities</a> endpoints instead.</p>\n</blockquote>\n<p>Use the direct upload approach for incremental updates — adding, updating, or removing individual records without replacing the full dataset.</p>\n<h3 style=\"position:relative;\"><a href=\"#31-upsert-records\" aria-label=\"31 upsert records permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a><div class=\"hidden-anchor\" id=\"31-upsert-records\"></div>3.1 Upsert Records</h3>\n<p>Records are matched by <code class=\"language-text\">id</code>. If a record with that ID already exists it is updated; otherwise a new record is created. You can send a single object or an array.</p>\n<div class=\"code-wrapper\">\n        <div class=\"gatsby-code-button-container\"\n             data-toaster-id=\"10939285303360680000\"\n             data-toaster-duration=\"1500\"\n             onClick=\"copyCodeToClipboard(`POST https://public-api.drata.com/public/v2/custom-connections/{connectionId}/resources/{resourceId}/records`, `10939285303360680000`)\"\n        >\n          <div class=\"gatsby-code-button\" title=\"Copy the code snippet\">Copy</div>\n          <div class=\"done-indicator done-indicator-10939285303360680000\">Copied</div>\n        </div>\n        <div class=\"gatsby-highlight\" data-language=\"http\"><pre class=\"language-http\"><code class=\"language-http\">POST https://public-api.drata.com/public/v2/custom-connections/{connectionId}/resources/{resourceId}/records</code></pre></div>\n      </div>\n<p><strong>Request Payload (single record):</strong></p>\n<div class=\"code-wrapper\">\n        <div class=\"gatsby-code-button-container\"\n             data-toaster-id=\"67038234493638020000\"\n             data-toaster-duration=\"1500\"\n             onClick=\"copyCodeToClipboard(`{\n  &quot;data&quot;: {\n    &quot;id&quot;: &quot;PKG-001&quot;,\n    &quot;packageName&quot;: &quot;1Password&quot;,\n    &quot;version&quot;: &quot;8.10.36&quot;,\n    &quot;isApproved&quot;: true\n  }\n}`, `67038234493638020000`)\"\n        >\n          <div class=\"gatsby-code-button\" title=\"Copy the code snippet\">Copy</div>\n          <div class=\"done-indicator done-indicator-67038234493638020000\">Copied</div>\n        </div>\n        <div class=\"gatsby-highlight\" data-language=\"json\"><pre class=\"language-json\"><code class=\"language-json\"><span class=\"token punctuation\">{</span>\n  <span class=\"token property\">\"data\"</span><span class=\"token operator\">:</span> <span class=\"token punctuation\">{</span>\n    <span class=\"token property\">\"id\"</span><span class=\"token operator\">:</span> <span class=\"token string\">\"PKG-001\"</span><span class=\"token punctuation\">,</span>\n    <span class=\"token property\">\"packageName\"</span><span class=\"token operator\">:</span> <span class=\"token string\">\"1Password\"</span><span class=\"token punctuation\">,</span>\n    <span class=\"token property\">\"version\"</span><span class=\"token operator\">:</span> <span class=\"token string\">\"8.10.36\"</span><span class=\"token punctuation\">,</span>\n    <span class=\"token property\">\"isApproved\"</span><span class=\"token operator\">:</span> <span class=\"token boolean\">true</span>\n  <span class=\"token punctuation\">}</span>\n<span class=\"token punctuation\">}</span></code></pre></div>\n      </div>\n<p><strong>Request Payload (multiple records):</strong></p>\n<div class=\"code-wrapper\">\n        <div class=\"gatsby-code-button-container\"\n             data-toaster-id=\"42238579492212610000\"\n             data-toaster-duration=\"1500\"\n             onClick=\"copyCodeToClipboard(`{\n  &quot;data&quot;: [\n    {\n      &quot;id&quot;: &quot;PKG-001&quot;,\n      &quot;packageName&quot;: &quot;1Password&quot;,\n      &quot;version&quot;: &quot;8.10.36&quot;,\n      &quot;isApproved&quot;: true\n    },\n    {\n      &quot;id&quot;: &quot;PKG-002&quot;,\n      &quot;packageName&quot;: &quot;Zoom&quot;,\n      &quot;version&quot;: &quot;6.2.0&quot;,\n      &quot;isApproved&quot;: true\n    }\n  ]\n}`, `42238579492212610000`)\"\n        >\n          <div class=\"gatsby-code-button\" title=\"Copy the code snippet\">Copy</div>\n          <div class=\"done-indicator done-indicator-42238579492212610000\">Copied</div>\n        </div>\n        <div class=\"gatsby-highlight\" data-language=\"json\"><pre class=\"language-json\"><code class=\"language-json\"><span class=\"token punctuation\">{</span>\n  <span class=\"token property\">\"data\"</span><span class=\"token operator\">:</span> <span class=\"token punctuation\">[</span>\n    <span class=\"token punctuation\">{</span>\n      <span class=\"token property\">\"id\"</span><span class=\"token operator\">:</span> <span class=\"token string\">\"PKG-001\"</span><span class=\"token punctuation\">,</span>\n      <span class=\"token property\">\"packageName\"</span><span class=\"token operator\">:</span> <span class=\"token string\">\"1Password\"</span><span class=\"token punctuation\">,</span>\n      <span class=\"token property\">\"version\"</span><span class=\"token operator\">:</span> <span class=\"token string\">\"8.10.36\"</span><span class=\"token punctuation\">,</span>\n      <span class=\"token property\">\"isApproved\"</span><span class=\"token operator\">:</span> <span class=\"token boolean\">true</span>\n    <span class=\"token punctuation\">}</span><span class=\"token punctuation\">,</span>\n    <span class=\"token punctuation\">{</span>\n      <span class=\"token property\">\"id\"</span><span class=\"token operator\">:</span> <span class=\"token string\">\"PKG-002\"</span><span class=\"token punctuation\">,</span>\n      <span class=\"token property\">\"packageName\"</span><span class=\"token operator\">:</span> <span class=\"token string\">\"Zoom\"</span><span class=\"token punctuation\">,</span>\n      <span class=\"token property\">\"version\"</span><span class=\"token operator\">:</span> <span class=\"token string\">\"6.2.0\"</span><span class=\"token punctuation\">,</span>\n      <span class=\"token property\">\"isApproved\"</span><span class=\"token operator\">:</span> <span class=\"token boolean\">true</span>\n    <span class=\"token punctuation\">}</span>\n  <span class=\"token punctuation\">]</span>\n<span class=\"token punctuation\">}</span></code></pre></div>\n      </div>\n<blockquote>\n<p><strong>Note:</strong> If an active session exists for this connection/resource, directly uploaded records are automatically grouped under it.</p>\n</blockquote>\n<p><strong>Reference:</strong> <a href=\"https://developers.drata.com/docs/openapi/reference/v2/operation/CustomDataRecordsPublicV2Controller_createCustomData/\">Upsert Records API</a></p>\n<hr>\n<h3 style=\"position:relative;\"><a href=\"#32-update-a-record\" aria-label=\"32 update a record permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a><div class=\"hidden-anchor\" id=\"32-update-a-record\"></div>3.2 Update a Record</h3>\n<p>Update a specific record by its <code class=\"language-text\">recordId</code>.</p>\n<div class=\"code-wrapper\">\n        <div class=\"gatsby-code-button-container\"\n             data-toaster-id=\"74521809512529460000\"\n             data-toaster-duration=\"1500\"\n             onClick=\"copyCodeToClipboard(`PUT https://public-api.drata.com/public/v2/custom-connections/{connectionId}/resources/{resourceId}/records/{recordId}`, `74521809512529460000`)\"\n        >\n          <div class=\"gatsby-code-button\" title=\"Copy the code snippet\">Copy</div>\n          <div class=\"done-indicator done-indicator-74521809512529460000\">Copied</div>\n        </div>\n        <div class=\"gatsby-highlight\" data-language=\"http\"><pre class=\"language-http\"><code class=\"language-http\">PUT https://public-api.drata.com/public/v2/custom-connections/{connectionId}/resources/{resourceId}/records/{recordId}</code></pre></div>\n      </div>\n<p><strong>Request Payload:</strong></p>\n<div class=\"code-wrapper\">\n        <div class=\"gatsby-code-button-container\"\n             data-toaster-id=\"51830426896068140000\"\n             data-toaster-duration=\"1500\"\n             onClick=\"copyCodeToClipboard(`{\n  &quot;data&quot;: {\n    &quot;version&quot;: &quot;8.10.40&quot;,\n    &quot;isApproved&quot;: false\n  }\n}`, `51830426896068140000`)\"\n        >\n          <div class=\"gatsby-code-button\" title=\"Copy the code snippet\">Copy</div>\n          <div class=\"done-indicator done-indicator-51830426896068140000\">Copied</div>\n        </div>\n        <div class=\"gatsby-highlight\" data-language=\"json\"><pre class=\"language-json\"><code class=\"language-json\"><span class=\"token punctuation\">{</span>\n  <span class=\"token property\">\"data\"</span><span class=\"token operator\">:</span> <span class=\"token punctuation\">{</span>\n    <span class=\"token property\">\"version\"</span><span class=\"token operator\">:</span> <span class=\"token string\">\"8.10.40\"</span><span class=\"token punctuation\">,</span>\n    <span class=\"token property\">\"isApproved\"</span><span class=\"token operator\">:</span> <span class=\"token boolean\">false</span>\n  <span class=\"token punctuation\">}</span>\n<span class=\"token punctuation\">}</span></code></pre></div>\n      </div>\n<p><strong>Reference:</strong> <a href=\"https://developers.drata.com/docs/openapi/reference/v2/operation/CustomDataRecordsPublicV2Controller_updateCustomData/\">Update Record API</a></p>\n<hr>\n<h3 style=\"position:relative;\"><a href=\"#33-delete-a-record\" aria-label=\"33 delete a record permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a><div class=\"hidden-anchor\" id=\"33-delete-a-record\"></div>3.3 Delete a Record</h3>\n<div class=\"code-wrapper\">\n        <div class=\"gatsby-code-button-container\"\n             data-toaster-id=\"14342154509780470000\"\n             data-toaster-duration=\"1500\"\n             onClick=\"copyCodeToClipboard(`DELETE https://public-api.drata.com/public/v2/custom-connections/{connectionId}/resources/{resourceId}/records/{recordId}`, `14342154509780470000`)\"\n        >\n          <div class=\"gatsby-code-button\" title=\"Copy the code snippet\">Copy</div>\n          <div class=\"done-indicator done-indicator-14342154509780470000\">Copied</div>\n        </div>\n        <div class=\"gatsby-highlight\" data-language=\"http\"><pre class=\"language-http\"><code class=\"language-http\">DELETE https://public-api.drata.com/public/v2/custom-connections/{connectionId}/resources/{resourceId}/records/{recordId}</code></pre></div>\n      </div>\n<p>Returns <code class=\"language-text\">204 No Content</code> on success.</p>\n<p><strong>Reference:</strong> <a href=\"https://developers.drata.com/docs/openapi/reference/v2/operation/CustomDataRecordsPublicV2Controller_deleteCustomData/\">Delete Record API</a></p>\n<hr>\n<h3 style=\"position:relative;\"><a href=\"#34-list-records\" aria-label=\"34 list records permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a><div class=\"hidden-anchor\" id=\"34-list-records\"></div>3.4 List Records</h3>\n<div class=\"code-wrapper\">\n        <div class=\"gatsby-code-button-container\"\n             data-toaster-id=\"87612572327138640000\"\n             data-toaster-duration=\"1500\"\n             onClick=\"copyCodeToClipboard(`GET https://public-api.drata.com/public/v2/custom-connections/{connectionId}/resources/{resourceId}/records`, `87612572327138640000`)\"\n        >\n          <div class=\"gatsby-code-button\" title=\"Copy the code snippet\">Copy</div>\n          <div class=\"done-indicator done-indicator-87612572327138640000\">Copied</div>\n        </div>\n        <div class=\"gatsby-highlight\" data-language=\"http\"><pre class=\"language-http\"><code class=\"language-http\">GET https://public-api.drata.com/public/v2/custom-connections/{connectionId}/resources/{resourceId}/records</code></pre></div>\n      </div>\n<p>Optionally filter by session using the <code class=\"language-text\">sessionId</code> query parameter:</p>\n<div class=\"code-wrapper\">\n        <div class=\"gatsby-code-button-container\"\n             data-toaster-id=\"18408512131794307000\"\n             data-toaster-duration=\"1500\"\n             onClick=\"copyCodeToClipboard(`GET https://public-api.drata.com/public/v2/custom-connections/{connectionId}/resources/{resourceId}/records?sessionId=upload-2025-04-01`, `18408512131794307000`)\"\n        >\n          <div class=\"gatsby-code-button\" title=\"Copy the code snippet\">Copy</div>\n          <div class=\"done-indicator done-indicator-18408512131794307000\">Copied</div>\n        </div>\n        <div class=\"gatsby-highlight\" data-language=\"http\"><pre class=\"language-http\"><code class=\"language-http\">GET https://public-api.drata.com/public/v2/custom-connections/{connectionId}/resources/{resourceId}/records?sessionId=upload-2025-04-01</code></pre></div>\n      </div>\n<p><strong>Reference:</strong> <a href=\"https://developers.drata.com/docs/openapi/reference/v2/operation/CustomDataRecordsPublicV2Controller_listCustomDataRecords/\">List Records API</a></p>\n<hr>\n<h2 style=\"position:relative;\"><a href=\"#4-session-based-record-management\" aria-label=\"4 session based record management permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a><div class=\"hidden-anchor\" id=\"4-session-based-record-management\"></div>4. Session-Based Record Management</h2>\n<blockquote>\n<p><strong><code class=\"language-text\">CUSTOM</code> connections only.</strong> For <code class=\"language-text\">MDM</code> and <code class=\"language-text\">HRIS</code> connections, use the <a href=\"https://developers.drata.com/docs/openapi/reference/v2/tag/Devices/\">Devices</a> and <a href=\"https://developers.drata.com/docs/openapi/reference/v2/tag/HRIS-User-Identities/\">HRIS User Identities</a> endpoints instead.</p>\n</blockquote>\n<p>Sessions are designed for bulk syncs where you want to stage an entire dataset and commit it atomically. When you complete a session, it becomes the authoritative dataset — everything not in that session is permanently deleted.</p>\n<h3 style=\"position:relative;\"><a href=\"#41-session-states\" aria-label=\"41 session states permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a><div class=\"hidden-anchor\" id=\"41-session-states\"></div>4.1 Session States</h3>\n<table>\n<thead>\n<tr>\n<th>State</th>\n<th>Description</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td><code class=\"language-text\">IN_PROGRESS</code></td>\n<td>Session is open. Records are staged but not yet live.</td>\n</tr>\n<tr>\n<td><code class=\"language-text\">ACTIVE</code></td>\n<td>Session has been completed. Its records are the live dataset.</td>\n</tr>\n<tr>\n<td><code class=\"language-text\">CANCELLED</code></td>\n<td>Session was aborted. All staged records are discarded.</td>\n</tr>\n<tr>\n<td><code class=\"language-text\">ARCHIVED</code></td>\n<td>System-managed. A previously ACTIVE session that was replaced by a newer one. Its records have been deleted.</td>\n</tr>\n</tbody>\n</table>\n<p>Only one session can be <code class=\"language-text\">IN_PROGRESS</code> at a time per connection/resource.</p>\n<hr>\n<h3 style=\"position:relative;\"><a href=\"#42-upload-records-to-a-session\" aria-label=\"42 upload records to a session permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a><div class=\"hidden-anchor\" id=\"42-upload-records-to-a-session\"></div>4.2 Upload Records to a Session</h3>\n<p>Choose any string as your <code class=\"language-text\">sessionId</code> — if the session doesn't exist yet it will be created in <code class=\"language-text\">IN_PROGRESS</code> state. You can call this endpoint multiple times with the same <code class=\"language-text\">sessionId</code> to upload in batches.</p>\n<div class=\"code-wrapper\">\n        <div class=\"gatsby-code-button-container\"\n             data-toaster-id=\"82973992471295620000\"\n             data-toaster-duration=\"1500\"\n             onClick=\"copyCodeToClipboard(`POST https://public-api.drata.com/public/v2/custom-connections/{connectionId}/resources/{resourceId}/sessions/{sessionId}`, `82973992471295620000`)\"\n        >\n          <div class=\"gatsby-code-button\" title=\"Copy the code snippet\">Copy</div>\n          <div class=\"done-indicator done-indicator-82973992471295620000\">Copied</div>\n        </div>\n        <div class=\"gatsby-highlight\" data-language=\"http\"><pre class=\"language-http\"><code class=\"language-http\">POST https://public-api.drata.com/public/v2/custom-connections/{connectionId}/resources/{resourceId}/sessions/{sessionId}</code></pre></div>\n      </div>\n<p><strong>Session ID rules:</strong> 3–64 characters, letters/numbers/hyphens/underscores only (e.g. <code class=\"language-text\">upload-2025-04-01</code>, <code class=\"language-text\">batch_sync_v2</code>).</p>\n<p><strong>Request Payload:</strong></p>\n<div class=\"code-wrapper\">\n        <div class=\"gatsby-code-button-container\"\n             data-toaster-id=\"14590275985488476000\"\n             data-toaster-duration=\"1500\"\n             onClick=\"copyCodeToClipboard(`{\n  &quot;data&quot;: [\n    {\n      &quot;id&quot;: &quot;PKG-001&quot;,\n      &quot;packageName&quot;: &quot;1Password&quot;,\n      &quot;version&quot;: &quot;8.10.36&quot;,\n      &quot;isApproved&quot;: true\n    },\n    {\n      &quot;id&quot;: &quot;PKG-002&quot;,\n      &quot;packageName&quot;: &quot;Zoom&quot;,\n      &quot;version&quot;: &quot;6.2.0&quot;,\n      &quot;isApproved&quot;: true\n    }\n  ]\n}`, `14590275985488476000`)\"\n        >\n          <div class=\"gatsby-code-button\" title=\"Copy the code snippet\">Copy</div>\n          <div class=\"done-indicator done-indicator-14590275985488476000\">Copied</div>\n        </div>\n        <div class=\"gatsby-highlight\" data-language=\"json\"><pre class=\"language-json\"><code class=\"language-json\"><span class=\"token punctuation\">{</span>\n  <span class=\"token property\">\"data\"</span><span class=\"token operator\">:</span> <span class=\"token punctuation\">[</span>\n    <span class=\"token punctuation\">{</span>\n      <span class=\"token property\">\"id\"</span><span class=\"token operator\">:</span> <span class=\"token string\">\"PKG-001\"</span><span class=\"token punctuation\">,</span>\n      <span class=\"token property\">\"packageName\"</span><span class=\"token operator\">:</span> <span class=\"token string\">\"1Password\"</span><span class=\"token punctuation\">,</span>\n      <span class=\"token property\">\"version\"</span><span class=\"token operator\">:</span> <span class=\"token string\">\"8.10.36\"</span><span class=\"token punctuation\">,</span>\n      <span class=\"token property\">\"isApproved\"</span><span class=\"token operator\">:</span> <span class=\"token boolean\">true</span>\n    <span class=\"token punctuation\">}</span><span class=\"token punctuation\">,</span>\n    <span class=\"token punctuation\">{</span>\n      <span class=\"token property\">\"id\"</span><span class=\"token operator\">:</span> <span class=\"token string\">\"PKG-002\"</span><span class=\"token punctuation\">,</span>\n      <span class=\"token property\">\"packageName\"</span><span class=\"token operator\">:</span> <span class=\"token string\">\"Zoom\"</span><span class=\"token punctuation\">,</span>\n      <span class=\"token property\">\"version\"</span><span class=\"token operator\">:</span> <span class=\"token string\">\"6.2.0\"</span><span class=\"token punctuation\">,</span>\n      <span class=\"token property\">\"isApproved\"</span><span class=\"token operator\">:</span> <span class=\"token boolean\">true</span>\n    <span class=\"token punctuation\">}</span>\n  <span class=\"token punctuation\">]</span>\n<span class=\"token punctuation\">}</span></code></pre></div>\n      </div>\n<p>Records uploaded to a session are staged and not visible as live data until the session is completed.</p>\n<p><strong>Reference:</strong> <a href=\"https://developers.drata.com/docs/openapi/reference/v2/operation/CustomDataRecordsPublicV2Controller_manageSession/\">Upsert Records with Session API</a></p>\n<hr>\n<h3 style=\"position:relative;\"><a href=\"#43-complete-a-session\" aria-label=\"43 complete a session permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a><div class=\"hidden-anchor\" id=\"43-complete-a-session\"></div>4.3 Complete a Session</h3>\n<p>Once all records are uploaded, complete the session to make them live.</p>\n<div class=\"code-wrapper\">\n        <div class=\"gatsby-code-button-container\"\n             data-toaster-id=\"35066767454023418000\"\n             data-toaster-duration=\"1500\"\n             onClick=\"copyCodeToClipboard(`POST https://public-api.drata.com/public/v2/custom-connections/{connectionId}/resources/{resourceId}/sessions/{sessionId}/actions`, `35066767454023418000`)\"\n        >\n          <div class=\"gatsby-code-button\" title=\"Copy the code snippet\">Copy</div>\n          <div class=\"done-indicator done-indicator-35066767454023418000\">Copied</div>\n        </div>\n        <div class=\"gatsby-highlight\" data-language=\"http\"><pre class=\"language-http\"><code class=\"language-http\">POST https://public-api.drata.com/public/v2/custom-connections/{connectionId}/resources/{resourceId}/sessions/{sessionId}/actions</code></pre></div>\n      </div>\n<p><strong>Request Payload:</strong></p>\n<div class=\"code-wrapper\">\n        <div class=\"gatsby-code-button-container\"\n             data-toaster-id=\"34624828595995427000\"\n             data-toaster-duration=\"1500\"\n             onClick=\"copyCodeToClipboard(`{\n  &quot;action&quot;: &quot;complete&quot;\n}`, `34624828595995427000`)\"\n        >\n          <div class=\"gatsby-code-button\" title=\"Copy the code snippet\">Copy</div>\n          <div class=\"done-indicator done-indicator-34624828595995427000\">Copied</div>\n        </div>\n        <div class=\"gatsby-highlight\" data-language=\"json\"><pre class=\"language-json\"><code class=\"language-json\"><span class=\"token punctuation\">{</span>\n  <span class=\"token property\">\"action\"</span><span class=\"token operator\">:</span> <span class=\"token string\">\"complete\"</span>\n<span class=\"token punctuation\">}</span></code></pre></div>\n      </div>\n<p><strong>What happens on completion:</strong></p>\n<ol>\n<li>\nThe session transitions from \n<code class=\"language-text\">IN_PROGRESS</code>\n → \n<code class=\"language-text\">ACTIVE</code>\n</li>\n<li>\nAll records in the session become the live dataset\n</li>\n<li>\nAny previously ACTIVE session is archived and its records are \n<strong>permanently deleted</strong>\n</li>\n<li>\nAny records that were uploaded directly (not via a session) are also \n<strong>permanently deleted</strong>\n</li>\n</ol>\n<blockquote>\n<p><strong>Warning:</strong> Completing a session is destructive and irreversible. Every record not part of the completing session — including any records uploaded via the direct endpoint — will be hard deleted.</p>\n</blockquote>\n<p><strong>Response:</strong></p>\n<div class=\"code-wrapper\">\n        <div class=\"gatsby-code-button-container\"\n             data-toaster-id=\"35540871117508055000\"\n             data-toaster-duration=\"1500\"\n             onClick=\"copyCodeToClipboard(`{\n  &quot;sessionId&quot;: &quot;upload-2025-04-01&quot;,\n  &quot;status&quot;: &quot;ACTIVE&quot;,\n  &quot;action&quot;: &quot;complete&quot;,\n  &quot;connectionId&quot;: 42,\n  &quot;resourceId&quot;: 7\n}`, `35540871117508055000`)\"\n        >\n          <div class=\"gatsby-code-button\" title=\"Copy the code snippet\">Copy</div>\n          <div class=\"done-indicator done-indicator-35540871117508055000\">Copied</div>\n        </div>\n        <div class=\"gatsby-highlight\" data-language=\"json\"><pre class=\"language-json\"><code class=\"language-json\"><span class=\"token punctuation\">{</span>\n  <span class=\"token property\">\"sessionId\"</span><span class=\"token operator\">:</span> <span class=\"token string\">\"upload-2025-04-01\"</span><span class=\"token punctuation\">,</span>\n  <span class=\"token property\">\"status\"</span><span class=\"token operator\">:</span> <span class=\"token string\">\"ACTIVE\"</span><span class=\"token punctuation\">,</span>\n  <span class=\"token property\">\"action\"</span><span class=\"token operator\">:</span> <span class=\"token string\">\"complete\"</span><span class=\"token punctuation\">,</span>\n  <span class=\"token property\">\"connectionId\"</span><span class=\"token operator\">:</span> <span class=\"token number\">42</span><span class=\"token punctuation\">,</span>\n  <span class=\"token property\">\"resourceId\"</span><span class=\"token operator\">:</span> <span class=\"token number\">7</span>\n<span class=\"token punctuation\">}</span></code></pre></div>\n      </div>\n<p><strong>Reference:</strong> <a href=\"https://developers.drata.com/docs/openapi/reference/v2/operation/CustomDataRecordsPublicV2Controller_performSessionAction/\">Perform Session Action API</a></p>\n<hr>\n<h3 style=\"position:relative;\"><a href=\"#44-cancel-a-session\" aria-label=\"44 cancel a session permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a><div class=\"hidden-anchor\" id=\"44-cancel-a-session\"></div>4.4 Cancel a Session</h3>\n<p>To discard a session and all its staged records without committing them:</p>\n<div class=\"code-wrapper\">\n        <div class=\"gatsby-code-button-container\"\n             data-toaster-id=\"2246976253672827600\"\n             data-toaster-duration=\"1500\"\n             onClick=\"copyCodeToClipboard(`POST https://public-api.drata.com/public/v2/custom-connections/{connectionId}/resources/{resourceId}/sessions/{sessionId}/actions`, `2246976253672827600`)\"\n        >\n          <div class=\"gatsby-code-button\" title=\"Copy the code snippet\">Copy</div>\n          <div class=\"done-indicator done-indicator-2246976253672827600\">Copied</div>\n        </div>\n        <div class=\"gatsby-highlight\" data-language=\"http\"><pre class=\"language-http\"><code class=\"language-http\">POST https://public-api.drata.com/public/v2/custom-connections/{connectionId}/resources/{resourceId}/sessions/{sessionId}/actions</code></pre></div>\n      </div>\n<p><strong>Request Payload:</strong></p>\n<div class=\"code-wrapper\">\n        <div class=\"gatsby-code-button-container\"\n             data-toaster-id=\"3488914287815370000\"\n             data-toaster-duration=\"1500\"\n             onClick=\"copyCodeToClipboard(`{\n  &quot;action&quot;: &quot;cancel&quot;\n}`, `3488914287815370000`)\"\n        >\n          <div class=\"gatsby-code-button\" title=\"Copy the code snippet\">Copy</div>\n          <div class=\"done-indicator done-indicator-3488914287815370000\">Copied</div>\n        </div>\n        <div class=\"gatsby-highlight\" data-language=\"json\"><pre class=\"language-json\"><code class=\"language-json\"><span class=\"token punctuation\">{</span>\n  <span class=\"token property\">\"action\"</span><span class=\"token operator\">:</span> <span class=\"token string\">\"cancel\"</span>\n<span class=\"token punctuation\">}</span></code></pre></div>\n      </div>\n<p>The session transitions to <code class=\"language-text\">CANCELLED</code> and all staged records are deleted. The previously active dataset (if any) is unaffected.</p>\n<p><strong>Reference:</strong> <a href=\"https://developers.drata.com/docs/openapi/reference/v2/operation/CustomDataRecordsPublicV2Controller_performSessionAction/\">Perform Session Action API</a></p>\n<hr>\n<h3 style=\"position:relative;\"><a href=\"#45-list-sessions\" aria-label=\"45 list sessions permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a><div class=\"hidden-anchor\" id=\"45-list-sessions\"></div>4.5 List Sessions</h3>\n<div class=\"code-wrapper\">\n        <div class=\"gatsby-code-button-container\"\n             data-toaster-id=\"40331678561262320000\"\n             data-toaster-duration=\"1500\"\n             onClick=\"copyCodeToClipboard(`GET https://public-api.drata.com/public/v2/custom-connections/{connectionId}/resources/{resourceId}/sessions`, `40331678561262320000`)\"\n        >\n          <div class=\"gatsby-code-button\" title=\"Copy the code snippet\">Copy</div>\n          <div class=\"done-indicator done-indicator-40331678561262320000\">Copied</div>\n        </div>\n        <div class=\"gatsby-highlight\" data-language=\"http\"><pre class=\"language-http\"><code class=\"language-http\">GET https://public-api.drata.com/public/v2/custom-connections/{connectionId}/resources/{resourceId}/sessions</code></pre></div>\n      </div>\n<p>Filter by status using the <code class=\"language-text\">status</code> query parameter:</p>\n<div class=\"code-wrapper\">\n        <div class=\"gatsby-code-button-container\"\n             data-toaster-id=\"1054256287789678800\"\n             data-toaster-duration=\"1500\"\n             onClick=\"copyCodeToClipboard(`GET https://public-api.drata.com/public/v2/custom-connections/{connectionId}/resources/{resourceId}/sessions?status=IN_PROGRESS`, `1054256287789678800`)\"\n        >\n          <div class=\"gatsby-code-button\" title=\"Copy the code snippet\">Copy</div>\n          <div class=\"done-indicator done-indicator-1054256287789678800\">Copied</div>\n        </div>\n        <div class=\"gatsby-highlight\" data-language=\"http\"><pre class=\"language-http\"><code class=\"language-http\">GET https://public-api.drata.com/public/v2/custom-connections/{connectionId}/resources/{resourceId}/sessions?status=IN_PROGRESS</code></pre></div>\n      </div>\n<p><strong>Reference:</strong> <a href=\"https://developers.drata.com/docs/openapi/reference/v2/operation/CustomDataRecordsPublicV2Controller_listSessions/\">List Sessions API</a></p>\n<hr>\n<h2 style=\"position:relative;\"><a href=\"#5-managing-custom-connections\" aria-label=\"5 managing custom connections permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a><div class=\"hidden-anchor\" id=\"5-managing-custom-connections\"></div>5. Managing Custom Connections</h2>\n<h3 style=\"position:relative;\"><a href=\"#51-list-custom-connections\" aria-label=\"51 list custom connections permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a><div class=\"hidden-anchor\" id=\"51-list-custom-connections\"></div>5.1 List Custom Connections</h3>\n<div class=\"code-wrapper\">\n        <div class=\"gatsby-code-button-container\"\n             data-toaster-id=\"42316413384356260000\"\n             data-toaster-duration=\"1500\"\n             onClick=\"copyCodeToClipboard(`GET https://public-api.drata.com/public/v2/custom-connections`, `42316413384356260000`)\"\n        >\n          <div class=\"gatsby-code-button\" title=\"Copy the code snippet\">Copy</div>\n          <div class=\"done-indicator done-indicator-42316413384356260000\">Copied</div>\n        </div>\n        <div class=\"gatsby-highlight\" data-language=\"http\"><pre class=\"language-http\"><code class=\"language-http\">GET https://public-api.drata.com/public/v2/custom-connections</code></pre></div>\n      </div>\n<p>Use <code class=\"language-text\">expand[]</code> to include sub-objects in the response:</p>\n<table>\n<thead>\n<tr>\n<th>Value</th>\n<th>Description</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td><code class=\"language-text\">customResources</code></td>\n<td>Includes the resource(s) and their schemas</td>\n</tr>\n<tr>\n<td><code class=\"language-text\">createdByUser</code></td>\n<td>Includes the user or API key that created the connection</td>\n</tr>\n</tbody>\n</table>\n<div class=\"code-wrapper\">\n        <div class=\"gatsby-code-button-container\"\n             data-toaster-id=\"61283885781745260000\"\n             data-toaster-duration=\"1500\"\n             onClick=\"copyCodeToClipboard(`GET https://public-api.drata.com/public/v2/custom-connections?expand[]=customResources`, `61283885781745260000`)\"\n        >\n          <div class=\"gatsby-code-button\" title=\"Copy the code snippet\">Copy</div>\n          <div class=\"done-indicator done-indicator-61283885781745260000\">Copied</div>\n        </div>\n        <div class=\"gatsby-highlight\" data-language=\"http\"><pre class=\"language-http\"><code class=\"language-http\">GET https://public-api.drata.com/public/v2/custom-connections?expand[]=customResources</code></pre></div>\n      </div>\n<p><strong>Reference:</strong> <a href=\"https://developers.drata.com/docs/openapi/reference/v2/operation/CustomConnectionsPublicV2Controller_listCustomConnections/\">List Custom Connections API</a></p>\n<hr>\n<h3 style=\"position:relative;\"><a href=\"#52-get-custom-connection\" aria-label=\"52 get custom connection permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a><div class=\"hidden-anchor\" id=\"52-get-custom-connection\"></div>5.2 Get Custom Connection</h3>\n<div class=\"code-wrapper\">\n        <div class=\"gatsby-code-button-container\"\n             data-toaster-id=\"1614045565431166000\"\n             data-toaster-duration=\"1500\"\n             onClick=\"copyCodeToClipboard(`GET https://public-api.drata.com/public/v2/custom-connections/{connectionId}`, `1614045565431166000`)\"\n        >\n          <div class=\"gatsby-code-button\" title=\"Copy the code snippet\">Copy</div>\n          <div class=\"done-indicator done-indicator-1614045565431166000\">Copied</div>\n        </div>\n        <div class=\"gatsby-highlight\" data-language=\"http\"><pre class=\"language-http\"><code class=\"language-http\">GET https://public-api.drata.com/public/v2/custom-connections/{connectionId}</code></pre></div>\n      </div>\n<p>Supports the same <code class=\"language-text\">expand[]</code> values as List.</p>\n<p><strong>Reference:</strong> <a href=\"https://developers.drata.com/docs/openapi/reference/v2/operation/CustomConnectionsPublicV2Controller_getCustomConnection/\">Get Custom Connection API</a></p>\n<hr>\n<h3 style=\"position:relative;\"><a href=\"#53-update-custom-connection\" aria-label=\"53 update custom connection permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a><div class=\"hidden-anchor\" id=\"53-update-custom-connection\"></div>5.3 Update Custom Connection</h3>\n<p>Only <code class=\"language-text\">clientAlias</code> and <code class=\"language-text\">description</code> can be updated after creation.</p>\n<div class=\"code-wrapper\">\n        <div class=\"gatsby-code-button-container\"\n             data-toaster-id=\"43016886285660050000\"\n             data-toaster-duration=\"1500\"\n             onClick=\"copyCodeToClipboard(`PUT https://public-api.drata.com/public/v2/custom-connections/{connectionId}`, `43016886285660050000`)\"\n        >\n          <div class=\"gatsby-code-button\" title=\"Copy the code snippet\">Copy</div>\n          <div class=\"done-indicator done-indicator-43016886285660050000\">Copied</div>\n        </div>\n        <div class=\"gatsby-highlight\" data-language=\"http\"><pre class=\"language-http\"><code class=\"language-http\">PUT https://public-api.drata.com/public/v2/custom-connections/{connectionId}</code></pre></div>\n      </div>\n<p><strong>Request Payload:</strong></p>\n<div class=\"code-wrapper\">\n        <div class=\"gatsby-code-button-container\"\n             data-toaster-id=\"62525627491176690000\"\n             data-toaster-duration=\"1500\"\n             onClick=\"copyCodeToClipboard(`{\n  &quot;clientAlias&quot;: &quot;Fleet Software Tracker&quot;,\n  &quot;description&quot;: &quot;Software packages synced nightly from our asset management tool&quot;\n}`, `62525627491176690000`)\"\n        >\n          <div class=\"gatsby-code-button\" title=\"Copy the code snippet\">Copy</div>\n          <div class=\"done-indicator done-indicator-62525627491176690000\">Copied</div>\n        </div>\n        <div class=\"gatsby-highlight\" data-language=\"json\"><pre class=\"language-json\"><code class=\"language-json\"><span class=\"token punctuation\">{</span>\n  <span class=\"token property\">\"clientAlias\"</span><span class=\"token operator\">:</span> <span class=\"token string\">\"Fleet Software Tracker\"</span><span class=\"token punctuation\">,</span>\n  <span class=\"token property\">\"description\"</span><span class=\"token operator\">:</span> <span class=\"token string\">\"Software packages synced nightly from our asset management tool\"</span>\n<span class=\"token punctuation\">}</span></code></pre></div>\n      </div>\n<p><strong>Reference:</strong> <a href=\"https://developers.drata.com/docs/openapi/reference/v2/operation/CustomConnectionsPublicV2Controller_updateCustomConnection/\">Update Custom Connection API</a></p>\n<hr>\n<h3 style=\"position:relative;\"><a href=\"#54-delete-custom-connection\" aria-label=\"54 delete custom connection permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a><div class=\"hidden-anchor\" id=\"54-delete-custom-connection\"></div>5.4 Delete Custom Connection</h3>\n<div class=\"code-wrapper\">\n        <div class=\"gatsby-code-button-container\"\n             data-toaster-id=\"59468607148028215000\"\n             data-toaster-duration=\"1500\"\n             onClick=\"copyCodeToClipboard(`DELETE https://public-api.drata.com/public/v2/custom-connections/{connectionId}`, `59468607148028215000`)\"\n        >\n          <div class=\"gatsby-code-button\" title=\"Copy the code snippet\">Copy</div>\n          <div class=\"done-indicator done-indicator-59468607148028215000\">Copied</div>\n        </div>\n        <div class=\"gatsby-highlight\" data-language=\"http\"><pre class=\"language-http\"><code class=\"language-http\">DELETE https://public-api.drata.com/public/v2/custom-connections/{connectionId}</code></pre></div>\n      </div>\n<p>Returns <code class=\"language-text\">204 No Content</code> on success. Deletes the connection and all associated records.</p>\n<p><strong>Reference:</strong> <a href=\"https://developers.drata.com/docs/openapi/reference/v2/operation/CustomConnectionsPublicV2Controller_deleteCustomConnection/\">Delete Custom Connection API</a></p>","headings":[{"value":"Work with Custom Connections","depth":1},{"value":"1. General","depth":2},{"value":"2. Setup","depth":2},{"value":"2.1 Create a Custom Connection","depth":3},{"value":"CUSTOM connection (user-defined schema)","depth":4},{"value":"MDM connection (fixed device model)","depth":4},{"value":"HRIS connection (fixed HRIS model)","depth":4},{"value":"2.2 Retrieve the Resource ID (CUSTOM connections only)","depth":3},{"value":"3. Managing Records Directly","depth":2},{"value":"3.1 Upsert Records","depth":3},{"value":"3.2 Update a Record","depth":3},{"value":"3.3 Delete a Record","depth":3},{"value":"3.4 List Records","depth":3},{"value":"4. Session-Based Record Management","depth":2},{"value":"4.1 Session States","depth":3},{"value":"4.2 Upload Records to a Session","depth":3},{"value":"4.3 Complete a Session","depth":3},{"value":"4.4 Cancel a Session","depth":3},{"value":"4.5 List Sessions","depth":3},{"value":"5. Managing Custom Connections","depth":2},{"value":"5.1 List Custom Connections","depth":3},{"value":"5.2 Get Custom Connection","depth":3},{"value":"5.3 Update Custom Connection","depth":3},{"value":"5.4 Delete Custom Connection","depth":3}]},"contentItem":{"data":{"lastModified":"2026-05-01T19:59:45.000Z","enableToc":null,"disableLastModified":null,"tocMaxDepth":null,"requestLogin":false}},"siteConfig":{"enableToc":false,"disableLastModified":false,"tocMaxDepth":4}},"pageContext":{"matchPath":"","id":"9a8df30e-e5aa-57c3-bbbb-bf736942eece__redocly content/developer-portal/v2/recipes/custom-connections/","seo":{"title":"Work with Custom Connections","description":null,"image":"","keywords":null,"jsonLd":null,"lang":null,"siteUrl":null},"pageId":"developer-portal/v2/recipes/custom-connections.md","pageBaseUrl":"/developer-portal/v2/recipes/custom-connections","type":"markdown","toc":{"enable":true,"maxDepth":4,"headings":[{"depth":1,"value":"Work with Custom Connections","id":"work-with-custom-connections"},{"depth":2,"value":"1. General","id":"1-general"},{"depth":2,"value":"2. Setup","id":"2-setup"},{"depth":3,"value":"2.1 Create a Custom Connection","id":"21-create-a-custom-connection"},{"depth":4,"value":"CUSTOM connection (user-defined schema)","id":"custom-connection-user-defined-schema"},{"depth":4,"value":"MDM connection (fixed device model)","id":"mdm-connection-fixed-device-model"},{"depth":4,"value":"HRIS connection (fixed HRIS model)","id":"hris-connection-fixed-hris-model"},{"depth":3,"value":"2.2 Retrieve the Resource ID (CUSTOM connections only)","id":"22-retrieve-the-resource-id-custom-connections-only"},{"depth":2,"value":"3. Managing Records Directly","id":"3-managing-records-directly"},{"depth":3,"value":"3.1 Upsert Records","id":"31-upsert-records"},{"depth":3,"value":"3.2 Update a Record","id":"32-update-a-record"},{"depth":3,"value":"3.3 Delete a Record","id":"33-delete-a-record"},{"depth":3,"value":"3.4 List Records","id":"34-list-records"},{"depth":2,"value":"4. Session-Based Record Management","id":"4-session-based-record-management"},{"depth":3,"value":"4.1 Session States","id":"41-session-states"},{"depth":3,"value":"4.2 Upload Records to a Session","id":"42-upload-records-to-a-session"},{"depth":3,"value":"4.3 Complete a Session","id":"43-complete-a-session"},{"depth":3,"value":"4.4 Cancel a Session","id":"44-cancel-a-session"},{"depth":3,"value":"4.5 List Sessions","id":"45-list-sessions"},{"depth":2,"value":"5. Managing Custom Connections","id":"5-managing-custom-connections"},{"depth":3,"value":"5.1 List Custom Connections","id":"51-list-custom-connections"},{"depth":3,"value":"5.2 Get Custom Connection","id":"52-get-custom-connection"},{"depth":3,"value":"5.3 Update Custom Connection","id":"53-update-custom-connection"},{"depth":3,"value":"5.4 Delete Custom Connection","id":"54-delete-custom-connection"}]},"data":{"title":""},"catalogInfo":null,"link":"/developer-portal/v2/recipes/custom-connections/","sidebarName":"training","isLanding":false,"showPrevButton":null,"showNextButton":null,"apiVersions":null,"apiVersionId":null,"isDefaultApiVersion":null}},"staticQueryHashes":["1123603147","1302185487","1344209882","1398840060","1520077861","1975142765","2667623876","2950305614","3240152602","3743992808","561138138"]}