Transfer ownership of Databricks SQL objects
This article shows how to transfer ownership of a query, dashboard, or alert using the UI or Permissions REST API.
Transfer ownership using the UI
Login to your Databricks SQL workspace as an Administrator.
Select the asset you wish to transfer ownership of.
Click on the “Share” button in the top right corner.
In the share modal, click on the gear icon and click “Assign new owner”.
In the next modal, select the user you wish to assign ownership to and click “Confirm”.
The asset has now been assigned to a new owner.
Transfer ownership using Permissions Rest API
Requirements
Important
To access Databricks REST APIs, you must authenticate.
The following examples authenticate by passing the personal access token in the HTTP header. To avoid leaking the personal access token in your shell’s command history, you can store the personal access token in a
.netrc
file. See Store tokens in a .netrc file and use them in curl.
Only an administrator can transfer ownership of a query, dashboard, or alert.
Transfer ownership of a query
curl --request POST \
--url https://<base-url>/api/2.0/preview/sql/permissions/query/<query-uuid>/transfer \
--header 'Authorization: Bearer <api-key>' \
--data '{"new_owner": "<new-owner-email>"}'
Replace the placeholders as follows:
<base-url>
: the URL of your workspace<query-uuid>
: the unique ID of the query. To find the query’s ID, open the query in the SQL editor and copy the value after/queries/
and beforeo=
.<new-owner-email>
: the email address of the new owner<api-key>
: your personal access token
Transfer ownership of a dashboard
curl --request POST \
--url https://<base-url>/api/2.0/preview/sql/permissions/dashboard/<dashboard-uuid>/transfer \
--header 'Authorization: Bearer <api-key>' \
--data '{"new_owner": "<new-owner-email>"}'
Replace the placeholders as follows:
<base-url>
: the URL of your workspace<dashboard-uuid>
: the unique ID of the dashboard. To find the dashboard’s ID, open the dashboard and copy the value after/dashboards/
and beforeo=
.<new-owner-email>
: the email address of the new owner<api-key>
: your personal access token
Transfer ownership of an alert
curl --request POST \
--url https://<base-url>/api/2.0/preview/sql/permissions/alert/<alert-uuid>/transfer \
--header 'Authorization: Bearer <api-key>' \
--data '{"new_owner": "<new-owner-email>"}'
Replace the placeholders as follows:
<base-url>
: the URL of your workspace<alert-uuid>
: the unique ID of the alert. To find the alert’s ID, open the alert and copy the value after/alerts/
and beforeo=
.<new-owner-email>
: the email address of the new owner. The new owner must be an administrator.<api-key>
: your personal access token