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

# Connect Databricks Workspace with OAuth 2.0 (M2M - Machine to Machine) – StackOne Hub

> Link a Databricks Workspace account in the StackOne Hub using OAuth 2.0 (M2M - Machine to Machine). End-user guide to authorize the integration and start using Databricks Workspace actions.

<Warning>You must have Databricks workspace admin privileges to create service principals, generate OAuth secrets, and grant workspace-object permissions.</Warning>

<Panel>
  <div className="not-prose guides-scope-selector" data-guides-scope-selector data-guide-actions-json="[{&#x22;id&#x22;:&#x22;databricksworkspace_list_catalogs&#x22;,&#x22;label&#x22;:&#x22;List Catalogs&#x22;,&#x22;scopes&#x22;:[&#x22;unity-catalog&#x22;]},{&#x22;id&#x22;:&#x22;databricksworkspace_get_catalog&#x22;,&#x22;label&#x22;:&#x22;Get Catalog&#x22;,&#x22;scopes&#x22;:[&#x22;unity-catalog&#x22;]},{&#x22;id&#x22;:&#x22;databricksworkspace_create_catalog&#x22;,&#x22;label&#x22;:&#x22;Create Catalog&#x22;,&#x22;scopes&#x22;:[&#x22;unity-catalog&#x22;]},{&#x22;id&#x22;:&#x22;databricksworkspace_update_catalog&#x22;,&#x22;label&#x22;:&#x22;Update Catalog&#x22;,&#x22;scopes&#x22;:[&#x22;unity-catalog&#x22;]},{&#x22;id&#x22;:&#x22;databricksworkspace_delete_catalog&#x22;,&#x22;label&#x22;:&#x22;Delete Catalog&#x22;,&#x22;scopes&#x22;:[&#x22;unity-catalog&#x22;]},{&#x22;id&#x22;:&#x22;databricksworkspace_list_clusters&#x22;,&#x22;label&#x22;:&#x22;List Clusters&#x22;,&#x22;scopes&#x22;:[&#x22;clusters&#x22;]},{&#x22;id&#x22;:&#x22;databricksworkspace_get_cluster&#x22;,&#x22;label&#x22;:&#x22;Get Cluster&#x22;,&#x22;scopes&#x22;:[&#x22;clusters&#x22;]},{&#x22;id&#x22;:&#x22;databricksworkspace_create_cluster&#x22;,&#x22;label&#x22;:&#x22;Create Cluster&#x22;,&#x22;scopes&#x22;:[&#x22;clusters&#x22;]},{&#x22;id&#x22;:&#x22;databricksworkspace_edit_cluster&#x22;,&#x22;label&#x22;:&#x22;Edit Cluster&#x22;,&#x22;scopes&#x22;:[&#x22;clusters&#x22;]},{&#x22;id&#x22;:&#x22;databricksworkspace_start_cluster&#x22;,&#x22;label&#x22;:&#x22;Start Cluster&#x22;,&#x22;scopes&#x22;:[&#x22;clusters&#x22;]},{&#x22;id&#x22;:&#x22;databricksworkspace_restart_cluster&#x22;,&#x22;label&#x22;:&#x22;Restart Cluster&#x22;,&#x22;scopes&#x22;:[&#x22;clusters&#x22;]},{&#x22;id&#x22;:&#x22;databricksworkspace_terminate_cluster&#x22;,&#x22;label&#x22;:&#x22;Terminate Cluster&#x22;,&#x22;scopes&#x22;:[&#x22;clusters&#x22;]},{&#x22;id&#x22;:&#x22;databricksworkspace_permanent_delete_cluster&#x22;,&#x22;label&#x22;:&#x22;Permanently Delete Cluster&#x22;,&#x22;scopes&#x22;:[&#x22;clusters&#x22;]},{&#x22;id&#x22;:&#x22;databricksworkspace_list_spark_versions&#x22;,&#x22;label&#x22;:&#x22;List Spark Versions&#x22;,&#x22;scopes&#x22;:[&#x22;clusters&#x22;]},{&#x22;id&#x22;:&#x22;databricksworkspace_list_node_types&#x22;,&#x22;label&#x22;:&#x22;List Node Types&#x22;,&#x22;scopes&#x22;:[&#x22;clusters&#x22;]},{&#x22;id&#x22;:&#x22;databricksworkspace_list_jobs&#x22;,&#x22;label&#x22;:&#x22;List Jobs&#x22;,&#x22;scopes&#x22;:[&#x22;jobs&#x22;]},{&#x22;id&#x22;:&#x22;databricksworkspace_get_job&#x22;,&#x22;label&#x22;:&#x22;Get Job&#x22;,&#x22;scopes&#x22;:[&#x22;jobs&#x22;]},{&#x22;id&#x22;:&#x22;databricksworkspace_create_job&#x22;,&#x22;label&#x22;:&#x22;Create Job&#x22;,&#x22;scopes&#x22;:[&#x22;jobs&#x22;]},{&#x22;id&#x22;:&#x22;databricksworkspace_update_job&#x22;,&#x22;label&#x22;:&#x22;Update Job&#x22;,&#x22;scopes&#x22;:[&#x22;jobs&#x22;]},{&#x22;id&#x22;:&#x22;databricksworkspace_delete_job&#x22;,&#x22;label&#x22;:&#x22;Delete Job&#x22;,&#x22;scopes&#x22;:[&#x22;jobs&#x22;]},{&#x22;id&#x22;:&#x22;databricksworkspace_run_job&#x22;,&#x22;label&#x22;:&#x22;Run Job&#x22;,&#x22;scopes&#x22;:[&#x22;jobs&#x22;]},{&#x22;id&#x22;:&#x22;databricksworkspace_list_job_runs&#x22;,&#x22;label&#x22;:&#x22;List Job Runs&#x22;,&#x22;scopes&#x22;:[&#x22;jobs&#x22;]},{&#x22;id&#x22;:&#x22;databricksworkspace_get_job_run&#x22;,&#x22;label&#x22;:&#x22;Get Job Run&#x22;,&#x22;scopes&#x22;:[&#x22;jobs&#x22;]},{&#x22;id&#x22;:&#x22;databricksworkspace_cancel_job_run&#x22;,&#x22;label&#x22;:&#x22;Cancel Job Run&#x22;,&#x22;scopes&#x22;:[&#x22;jobs&#x22;]},{&#x22;id&#x22;:&#x22;databricksworkspace_get_job_run_output&#x22;,&#x22;label&#x22;:&#x22;Get Job Run Output&#x22;,&#x22;scopes&#x22;:[&#x22;jobs&#x22;]},{&#x22;id&#x22;:&#x22;databricksworkspace_list_schemas&#x22;,&#x22;label&#x22;:&#x22;List Schemas&#x22;,&#x22;scopes&#x22;:[&#x22;unity-catalog&#x22;]},{&#x22;id&#x22;:&#x22;databricksworkspace_get_schema&#x22;,&#x22;label&#x22;:&#x22;Get Schema&#x22;,&#x22;scopes&#x22;:[&#x22;unity-catalog&#x22;]},{&#x22;id&#x22;:&#x22;databricksworkspace_create_schema&#x22;,&#x22;label&#x22;:&#x22;Create Schema&#x22;,&#x22;scopes&#x22;:[&#x22;unity-catalog&#x22;]},{&#x22;id&#x22;:&#x22;databricksworkspace_update_schema&#x22;,&#x22;label&#x22;:&#x22;Update Schema&#x22;,&#x22;scopes&#x22;:[&#x22;unity-catalog&#x22;]},{&#x22;id&#x22;:&#x22;databricksworkspace_delete_schema&#x22;,&#x22;label&#x22;:&#x22;Delete Schema&#x22;,&#x22;scopes&#x22;:[&#x22;unity-catalog&#x22;]},{&#x22;id&#x22;:&#x22;databricksworkspace_execute_sql_statement&#x22;,&#x22;label&#x22;:&#x22;Execute SQL Statement&#x22;,&#x22;scopes&#x22;:[&#x22;sql&#x22;]},{&#x22;id&#x22;:&#x22;databricksworkspace_get_sql_statement&#x22;,&#x22;label&#x22;:&#x22;Get SQL Statement&#x22;,&#x22;scopes&#x22;:[&#x22;sql&#x22;]},{&#x22;id&#x22;:&#x22;databricksworkspace_cancel_sql_statement&#x22;,&#x22;label&#x22;:&#x22;Cancel SQL Statement&#x22;,&#x22;scopes&#x22;:[&#x22;sql&#x22;]},{&#x22;id&#x22;:&#x22;databricksworkspace_list_sql_warehouses&#x22;,&#x22;label&#x22;:&#x22;List SQL Warehouses&#x22;,&#x22;scopes&#x22;:[&#x22;sql&#x22;]},{&#x22;id&#x22;:&#x22;databricksworkspace_get_sql_warehouse&#x22;,&#x22;label&#x22;:&#x22;Get SQL Warehouse&#x22;,&#x22;scopes&#x22;:[&#x22;sql&#x22;]},{&#x22;id&#x22;:&#x22;databricksworkspace_create_sql_warehouse&#x22;,&#x22;label&#x22;:&#x22;Create SQL Warehouse&#x22;,&#x22;scopes&#x22;:[&#x22;sql&#x22;]},{&#x22;id&#x22;:&#x22;databricksworkspace_edit_sql_warehouse&#x22;,&#x22;label&#x22;:&#x22;Edit SQL Warehouse&#x22;,&#x22;scopes&#x22;:[&#x22;sql&#x22;]},{&#x22;id&#x22;:&#x22;databricksworkspace_start_sql_warehouse&#x22;,&#x22;label&#x22;:&#x22;Start SQL Warehouse&#x22;,&#x22;scopes&#x22;:[&#x22;sql&#x22;]},{&#x22;id&#x22;:&#x22;databricksworkspace_stop_sql_warehouse&#x22;,&#x22;label&#x22;:&#x22;Stop SQL Warehouse&#x22;,&#x22;scopes&#x22;:[&#x22;sql&#x22;]},{&#x22;id&#x22;:&#x22;databricksworkspace_delete_sql_warehouse&#x22;,&#x22;label&#x22;:&#x22;Delete SQL Warehouse&#x22;,&#x22;scopes&#x22;:[&#x22;sql&#x22;]},{&#x22;id&#x22;:&#x22;databricksworkspace_list_tables&#x22;,&#x22;label&#x22;:&#x22;List Tables&#x22;,&#x22;scopes&#x22;:[&#x22;unity-catalog&#x22;]},{&#x22;id&#x22;:&#x22;databricksworkspace_list_table_summaries&#x22;,&#x22;label&#x22;:&#x22;List Table Summaries&#x22;,&#x22;scopes&#x22;:[&#x22;unity-catalog&#x22;]},{&#x22;id&#x22;:&#x22;databricksworkspace_get_table&#x22;,&#x22;label&#x22;:&#x22;Get Table&#x22;,&#x22;scopes&#x22;:[&#x22;unity-catalog&#x22;]},{&#x22;id&#x22;:&#x22;databricksworkspace_get_table_exists&#x22;,&#x22;label&#x22;:&#x22;Check Table Exists&#x22;,&#x22;scopes&#x22;:[&#x22;unity-catalog&#x22;]},{&#x22;id&#x22;:&#x22;databricksworkspace_delete_table&#x22;,&#x22;label&#x22;:&#x22;Delete Table&#x22;,&#x22;scopes&#x22;:[&#x22;unity-catalog&#x22;]},{&#x22;id&#x22;:&#x22;databricksworkspace_list_workspace_objects&#x22;,&#x22;label&#x22;:&#x22;List Workspace Objects&#x22;,&#x22;scopes&#x22;:[&#x22;workspace&#x22;]},{&#x22;id&#x22;:&#x22;databricksworkspace_get_workspace_object_status&#x22;,&#x22;label&#x22;:&#x22;Get Workspace Object Status&#x22;,&#x22;scopes&#x22;:[&#x22;workspace&#x22;]},{&#x22;id&#x22;:&#x22;databricksworkspace_create_workspace_directory&#x22;,&#x22;label&#x22;:&#x22;Create Workspace Directory&#x22;,&#x22;scopes&#x22;:[&#x22;workspace&#x22;]},{&#x22;id&#x22;:&#x22;databricksworkspace_import_workspace_object&#x22;,&#x22;label&#x22;:&#x22;Import Workspace Object&#x22;,&#x22;scopes&#x22;:[&#x22;workspace&#x22;]},{&#x22;id&#x22;:&#x22;databricksworkspace_export_workspace_object&#x22;,&#x22;label&#x22;:&#x22;Export Workspace Object&#x22;,&#x22;scopes&#x22;:[&#x22;workspace&#x22;]},{&#x22;id&#x22;:&#x22;databricksworkspace_delete_workspace_object&#x22;,&#x22;label&#x22;:&#x22;Delete Workspace Object&#x22;,&#x22;scopes&#x22;:[&#x22;workspace&#x22;]}]" style={{ borderRadius: '8px', padding: '16px', marginBottom: '24px' }}>
    <div className="guides-scope-selector__title" style={{ fontSize: '16px', fontWeight: '600', marginBottom: '12px' }}>Select Actions to adjust the guide</div>
    <div className="guides-scope-selector__muted" style={{ fontSize: '13px', marginBottom: '12px' }}>Some actions may require additional configuration in the provider to be accessible. Choose the actions you need and the guide will be updated.</div>

    <div style={{ display: 'flex', gap: '8px', marginBottom: '12px', flexWrap: 'wrap' }}>
      <input type="text" placeholder="Search actions..." className="guides-scope-selector__input" data-guide-action-search style={{ padding: '8px 12px', borderRadius: '6px', fontSize: '13px', flex: 1, minWidth: '160px' }} />

      <button type="button" className="guides-scope-selector__quick-btn" data-guide-select-all style={{ padding: '6px 10px', borderRadius: '6px', fontSize: '12px', cursor: 'pointer' }}>Select all</button>
      <button type="button" className="guides-scope-selector__quick-btn" data-guide-clear style={{ padding: '6px 10px', borderRadius: '6px', fontSize: '12px', cursor: 'pointer' }}>Clear</button>
    </div>

    <div className="guides-scope-selector__list" style={{ maxHeight: '240px', overflowY: 'auto', borderRadius: '6px', marginBottom: '12px' }}>
      <div className="guides-scope-selector__list-header" style={{ display: 'flex', alignItems: 'center', gap: '10px', padding: '8px 12px', fontSize: '12px', fontWeight: '600', position: 'sticky', top: 0, zIndex: 1 }}>
        <div style={{ width: '16px', flexShrink: 0 }} />

        <div style={{ flex: 1, textAlign: 'left' }}>Action</div>
        <div style={{ minWidth: '120px', marginLeft: 'auto', textAlign: 'right' }}>Scope(s)</div>
      </div>

      <div className="guides-scope-selector__muted" data-guide-loading style={{ padding: '16px', textAlign: 'center', fontSize: '13px' }}>Loading actions...</div>
      <div className="guides-scope-selector__muted" data-guide-no-results hidden style={{ padding: '16px', textAlign: 'center', fontSize: '13px' }}>No actions match your search.</div>
    </div>

    <div className="guides-scope-selector__url-section" style={{ marginTop: '12px', paddingTop: '12px' }}>
      <div className="guides-scope-selector__muted" style={{ fontSize: '12px', fontWeight: '500', marginBottom: '6px' }}>Dynamic Guide URL</div>

      <div style={{ display: 'flex', alignItems: 'center', gap: '8px', flexWrap: 'wrap' }}>
        <input type="text" readOnly className="guides-scope-selector__input" data-guide-url style={{ flex: 1, minWidth: '200px', padding: '8px 10px', borderRadius: '6px', fontSize: '12px', fontFamily: 'monospace' }} />

        <button type="button" className="guides-scope-selector__copy-btn" data-guide-copy-url style={{ width: '120px', padding: '8px 14px', borderRadius: '6px', fontSize: '13px', fontWeight: '500', cursor: 'pointer', whiteSpace: 'nowrap', marginLeft: 'auto' }}>Copy URL</button>
      </div>

      <div style={{ marginTop: '12px' }}>
        <div className="guides-scope-selector__muted" style={{ fontSize: '12px', fontWeight: '500', marginBottom: '6px' }}>Scopes Selected</div>

        <div style={{ display: 'flex', alignItems: 'stretch', gap: '8px', flexWrap: 'wrap' }}>
          <pre className="guides-scope-selector__input" role="textbox" aria-readonly="true" tabIndex={0} data-guide-scopes-output style={{ flex: 1, minWidth: '200px', minHeight: '88px', maxHeight: '120px', overflowY: 'auto', margin: 0, padding: '8px 10px', borderRadius: '6px', fontSize: '12px', fontFamily: 'monospace', whiteSpace: 'pre-wrap' }} />

          <div className="guides-scope-selector__muted" style={{ display: 'flex', flexDirection: 'column', gap: '8px', fontSize: '12px', fontWeight: '500', flexShrink: 0, alignItems: 'flex-start' }}>
            <div style={{ whiteSpace: 'nowrap' }}>Separator</div>

            <select className="guides-scope-selector__input" data-guide-scope-delimiter style={{ width: '100%', padding: '6px 10px', borderRadius: '6px', fontSize: '12px' }}>
              <option value="space">Space</option>
              <option value="comma">Comma</option>
              <option value="semicolon">Semicolon</option>
              <option value="pipe">Pipe</option>
              <option value="newline">Newline</option>
            </select>

            <button type="button" className="guides-scope-selector__copy-btn" data-guide-copy-scopes style={{ width: '120px', padding: '8px 14px', borderRadius: '6px', fontSize: '13px', fontWeight: '500', cursor: 'pointer', whiteSpace: 'nowrap' }}>Copy scopes</button>
          </div>
        </div>
      </div>
    </div>
  </div>
</Panel>

<section data-guide-section data-guide-scopes="">
  <h2>Finding Your Workspace URL</h2>

  <p>The Workspace URL is the hostname of your Databricks workspace (without `https://`).</p>

  <Steps>
    <Step title="Sign in to Databricks">
      <div data-guide-step data-guide-scopes="" data-guide-display-scopes-list="">
        <p>Open the <a href="https://accounts.cloud.databricks.com" target="_blank" rel="noopener noreferrer">Databricks Account Console</a> in a browser (or your cloud-specific equivalent — Azure or GCP) and sign in as a workspace admin. If you already know your workspace URL you can also navigate to it directly; typical formats are `https://<workspace-hostname>.cloud.databricks.com` (AWS), `https://adb-<id>.<n>.azuredatabricks.net` (Azure), or `https://<id>.<region>.gcp.databricks.com` (GCP).</p>
      </div>
    </Step>

    <Step title="Select your workspace">
      <div data-guide-step data-guide-scopes="" data-guide-display-scopes-list="">
        <p>After sign-in you may land on a <strong>Select a workspace</strong> screen at `accounts.cloud.databricks.com/select-workspace?account_id=...` (Free Edition / multi-workspace accounts). Click the row for the workspace you want to integrate (e.g. <strong>workspace</strong>). The browser will then redirect to that workspace's URL — this is the workspace URL you need.</p>
      </div>
    </Step>

    <Step title="Copy the Workspace Hostname">
      <div data-guide-step data-guide-scopes="" data-guide-display-scopes-list="">
        <p>Look at the URL bar. Your workspace URL is the hostname between `https://` and the first `/` — for example `dbc-e5d7119f-c9fa.cloud.databricks.com` or `adb-1234567890123456.7.azuredatabricks.net`. Paste this value (without `https://` and without a trailing slash) into the <strong>Workspace URL</strong> field in StackOne.</p>
      </div>
    </Step>
  </Steps>
</section>

<section data-guide-section data-guide-scopes="">
  <h2>Creating a Service Principal</h2>

  <p>A service principal is a machine identity used for automated API access without tying credentials to a user account.</p>

  <Steps>
    <Step title="Open Workspace Settings">
      <div data-guide-step data-guide-scopes="" data-guide-display-scopes-list="">
        <p>Click your <strong>user avatar</strong> in the top-right corner of the workspace. A dropdown appears — click <strong>Settings</strong> from that dropdown.</p>
      </div>
    </Step>

    <Step title="Navigate to Service Principals">
      <div data-guide-step data-guide-scopes="" data-guide-display-scopes-list="">
        <p>In the Settings sidebar select <strong>Identity and access</strong>, then click <strong>Manage</strong> next to <strong>Service principals</strong>.</p>
      </div>
    </Step>

    <Step title="Add a Service Principal">
      <div data-guide-step data-guide-scopes="" data-guide-display-scopes-list="">
        <p>Click <strong>Add service principal</strong>. A dialog opens with a dropdown to select an existing service principal and an <strong>Add new</strong> button — click <strong>Add new</strong> to create a new one. In the <strong>Service principal name</strong> field, enter a descriptive name (e.g. "StackOne Integration"), then click <strong>Add</strong>. Note the <strong>Application ID</strong> (UUID) shown on the service principal details page — you will need it later for granting workspace permissions.</p>
      </div>
    </Step>

    <Step title="Confirm Status and Required Entitlements">
      <div data-guide-step data-guide-scopes="" data-guide-display-scopes-list="">
        <p>On the service principal details page, open the <strong>Configurations</strong> tab. You will see two separate sections — <strong>Status</strong> and <strong>Entitlements</strong> (each with its own heading). First, in the <strong>Status</strong> section, confirm the <strong>Active</strong> checkbox is selected. Then, in the <strong>Entitlements</strong> section directly below it, confirm the following entitlements are enabled (the portal lists them in this order)</p>

        <ul>
          <li><strong>Databricks SQL access</strong> — required for SQL warehouse and statement execution actions</li>
          <li><strong>Workspace access</strong> — required to use the workspace at all</li>
        </ul>
      </div>
    </Step>

    <Step title="Save the Changes">
      <div data-guide-step data-guide-scopes="" data-guide-display-scopes-list="">
        <p>If you changed any of the checkboxes, click <strong>Update</strong> at the bottom of the Configurations tab to persist the changes.</p>
      </div>
    </Step>
  </Steps>
</section>

<section data-guide-section data-guide-scopes="">
  <h2>Generating OAuth Credentials</h2>

  <p>Generate an OAuth client secret for the service principal to use with the client credentials flow.</p>

  <Steps>
    <Step title="Open the Secrets Tab">
      <div data-guide-step data-guide-scopes="" data-guide-display-scopes-list="">
        <p>Still on the service principal details page, click the <strong>Secrets</strong> tab.</p>
      </div>
    </Step>

    <Step title="Generate a Secret">
      <div data-guide-step data-guide-scopes="" data-guide-display-scopes-list="">
        <p>Click the <strong>Generate secret</strong> button. A <strong>Generate OAuth secret</strong> popup appears with a field labelled <strong>Lifetime (days)</strong>. Enter a whole number between 1 and 730 in the text input, then click the blue <strong>Generate</strong> button.</p>
      </div>
    </Step>

    <Step title="Copy the Credentials">
      <div data-guide-step data-guide-scopes="" data-guide-display-scopes-list="">
        <p>Copy both values immediately — the secret is shown only once and cannot be retrieved later.</p>

        <ul>
          <li><strong>Client ID</strong> — paste into the <strong>Client ID</strong> field in StackOne</li>
          <li><strong>Client Secret</strong> — paste into the <strong>Client Secret</strong> field in StackOne</li>
        </ul>
      </div>
    </Step>
  </Steps>
</section>

<section data-guide-section data-guide-scopes="">
  <h2>Selecting Scopes</h2>

  <p>Scopes are entered only on the StackOne Hub link-account page — there is no scope selection step on the Databricks side.</p>

  <Steps>
    <Step title="Choose your scopes">
      <div data-guide-step data-guide-scopes="all-apis,clusters,jobs,sql,workspace,unity-catalog" data-guide-display-scopes-list="all-apis,clusters,jobs,sql,workspace,unity-catalog">
        <div className="connector-guide-actions-badge" data-guide-actions-badge data-guide-actions-badge-scopes="all-apis,clusters,jobs,sql,workspace,unity-catalog" style={{ display: 'block', width: 'fit-content', maxWidth: '100%', padding: '2px 8px', borderRadius: '8px', fontSize: '12px', marginBottom: '8px', marginTop: '-10px', whiteSpace: 'nowrap', overflowX: 'auto', overflowY: 'hidden', msOverflowStyle: 'none', scrollbarWidth: 'none' }}>
          <span>Enables actions: </span><span data-guide-actions-badge-labels>Cancel Job Run, Cancel SQL Statement, Check Table Exists, Create Catalog, Create Cluster, Create Job, Create SQL Warehouse, Create Schema, Create Workspace Directory, Delete Catalog, Delete Job, Delete SQL Warehouse, Delete Schema, Delete Table, Delete Workspace Object, Edit Cluster, Edit SQL Warehouse, Execute SQL Statement, Export Workspace Object, Get Catalog, Get Cluster, Get Job, Get Job Run, Get Job Run Output, Get SQL Statement, Get SQL Warehouse, Get Schema, Get Table, Get Workspace Object Status, Import Workspace Object, List Catalogs, List Clusters, List Job Runs, List Jobs, List Node Types, List SQL Warehouses, List Schemas, List Spark Versions, List Table Summaries, List Tables, List Workspace Objects, Permanently Delete Cluster, Restart Cluster, Run Job, Start Cluster, Start SQL Warehouse, Stop SQL Warehouse, Terminate Cluster, Update Catalog, Update Job, Update Schema</span>
        </div>

        <p>In the StackOne Hub, the <strong>Scopes</strong> field defaults to `all-apis` if left empty. To restrict access, enter individual scopes separated by spaces. If you use a custom scope list, **`clusters` is required** (the connection test action `list_clusters` needs it) — add `jobs`, `sql`, `workspace`, and/or `unity-catalog` alongside it for the resources you intend to use.</p>

        <div style={{ marginTop: '8px' }} data-guide-display-scopes>
          <div className="connector-guide-scopes-container">
            <ul className="not-prose" style={{ listStyleType: "'- '", paddingLeft: '1em', margin: 0 }}>
              <li style={{ overflowWrap: 'anywhere', wordBreak: 'break-word' }} data-guide-display-scope="all-apis">
                <button type="button" className="connector-guide-scope-copy" aria-label="Copy all-apis" title="Copy scope" data-copy="all-apis">
                  <span className="connector-guide-scope-copy__label">all-apis</span>
                  <span className="connector-guide-scope-copy__icon" aria-hidden="true">⧉</span>
                </button>
              </li>

              <li style={{ overflowWrap: 'anywhere', wordBreak: 'break-word' }} data-guide-display-scope="clusters">
                <button type="button" className="connector-guide-scope-copy" aria-label="Copy clusters" title="Copy scope" data-copy="clusters">
                  <span className="connector-guide-scope-copy__label">clusters</span>
                  <span className="connector-guide-scope-copy__icon" aria-hidden="true">⧉</span>
                </button>
              </li>

              <li style={{ overflowWrap: 'anywhere', wordBreak: 'break-word' }} data-guide-display-scope="jobs">
                <button type="button" className="connector-guide-scope-copy" aria-label="Copy jobs" title="Copy scope" data-copy="jobs">
                  <span className="connector-guide-scope-copy__label">jobs</span>
                  <span className="connector-guide-scope-copy__icon" aria-hidden="true">⧉</span>
                </button>
              </li>

              <li style={{ overflowWrap: 'anywhere', wordBreak: 'break-word' }} data-guide-display-scope="sql">
                <button type="button" className="connector-guide-scope-copy" aria-label="Copy sql" title="Copy scope" data-copy="sql">
                  <span className="connector-guide-scope-copy__label">sql</span>
                  <span className="connector-guide-scope-copy__icon" aria-hidden="true">⧉</span>
                </button>
              </li>

              <li style={{ overflowWrap: 'anywhere', wordBreak: 'break-word' }} data-guide-display-scope="workspace">
                <button type="button" className="connector-guide-scope-copy" aria-label="Copy workspace" title="Copy scope" data-copy="workspace">
                  <span className="connector-guide-scope-copy__label">workspace</span>
                  <span className="connector-guide-scope-copy__icon" aria-hidden="true">⧉</span>
                </button>
              </li>

              <li style={{ overflowWrap: 'anywhere', wordBreak: 'break-word' }} data-guide-display-scope="unity-catalog">
                <button type="button" className="connector-guide-scope-copy" aria-label="Copy unity-catalog" title="Copy scope" data-copy="unity-catalog">
                  <span className="connector-guide-scope-copy__label">unity-catalog</span>
                  <span className="connector-guide-scope-copy__icon" aria-hidden="true">⧉</span>
                </button>
              </li>
            </ul>
          </div>
        </div>
      </div>
    </Step>
  </Steps>
</section>

<section data-guide-section data-guide-scopes="">
  <h2>Granting Workspace-Object Permissions</h2>

  <p>By default, the service principal has full permissions only on its own home directory `/Users/<application-id>/`. For workspace-write actions (create\_workspace\_directory, import\_workspace\_object, delete\_workspace\_object) targeting any other path, a workspace admin must explicitly grant the service principal Can Edit (or Can Manage) on the target parent directory. For read actions targeting paths outside the SP home, at least Can Read is required.</p>

  <Steps>
    <Step title="Open the Workspace Browser">
      <div data-guide-step data-guide-scopes="" data-guide-display-scopes-list="">
        <p>Click <strong>Workspace</strong> in the left sidebar. Select the target folder row (or the workspace root `Workspace` for broad access — permissions on the root inherit to all sub-paths).</p>
      </div>
    </Step>

    <Step title="Open the Sharing Dialog">
      <div data-guide-step data-guide-scopes="" data-guide-display-scopes-list="">
        <p>Click the <strong>Share</strong> button at the top-right of the page. A <strong>Sharing</strong> modal opens.</p>
      </div>
    </Step>

    <Step title="Add the Service Principal">
      <div data-guide-step data-guide-scopes="" data-guide-display-scopes-list="">
        <p>Remove any default `All workspace users` chip from the search field if present. In the search field, type either the service principal's <strong>display name</strong> OR its <strong>Application ID</strong> (UUID) — both resolve. The autocomplete dropdown will show matching service principals with their Application IDs; click the entry corresponding to your service principal to select it as a chip in the search field.</p>
      </div>
    </Step>

    <Step title="Set Permission Level and Save">
      <div data-guide-step data-guide-scopes="" data-guide-display-scopes-list="">
        <p>Use the permission-level dropdown next to the principal to choose a level. The portal labels are Can Read, Can Run, Can Edit, and Can Manage (the underlying API values are CAN\_READ, CAN\_RUN, CAN\_EDIT, and CAN\_MANAGE respectively). For the StackOne integration to perform both read and write workspace actions, select <strong>Can Manage</strong> (recommended — also allows the principal to grant permissions to others). Click <strong>Add</strong>. Permissions on the workspace root inherit to all sub-paths.</p>
      </div>
    </Step>
  </Steps>
</section>

<div data-whitelabel-hide>
  <h2>Linking the Account from the Hub</h2>

  <Steps>
    <Step title="Navigate to the Hub">
      Use one of the three <a href="/guides/accounts-section#linking-accounts">Linking Account Methods</a> to access the Hub.
    </Step>

    <Step title="Fill out the fields">
      Fill out the following fields using details from your provider:

      <ul>
        <li><strong>Workspace URL</strong></li>
        <li><strong>Client ID</strong></li>
        <li><strong>Client Secret</strong></li>
        <li><strong>Scopes</strong> (Optional)</li>
      </ul>
    </Step>

    <Step title="Connect">
      <ul>
        <li>Click <strong>Connect</strong></li>
        <li>If applicable, the provider will redirect you to a sign-in or authorization page. Complete the provider's authorization flow.</li>
        <li>Once authorization is successful, you will see a confirmation popup</li>
      </ul>
    </Step>
  </Steps>

  <p>If the account linking is successful, you will see the newly linked account in your <a href="/guides/accounts-section">Accounts</a> page.</p>
</div>
