cancel
Showing results forย 
Search instead forย 
Did you mean:ย 
Warehousing & Analytics
Engage in discussions on data warehousing, analytics, and BI solutions within the Databricks Community. Share insights, tips, and best practices for leveraging data for informed decision-making.
cancel
Showing results forย 
Search instead forย 
Did you mean:ย 

Free account: Genie API isn't working

hch_fiq
Visitor

Hi, I've created a service principal and setup OAuth - I can successfully call REST APIs to see workspace details. But, when I try to list the genie spaces in a workspace, I get {} as the result. In the UI, I can see two genie spaces I've created. Any hints on what to do now?

2 REPLIES 2

Louis_Frolio
Databricks Employee
Databricks Employee

Greetings @hch_fiq ,  thanks for sharing the contextโ€”this behavior is almost always a permissions/entitlements mismatch between the service principal and the Genie space ACLs.

 

Whatโ€™s happening

  • The List Genie spaces endpoint (GET /api/2.0/genie/spaces) only returns spaces the caller has access to; if the caller has no access, youโ€™ll see an empty result (often rendered as {} by some clients).
  • To even see a space in the list, the caller needs at least CAN VIEW/CAN RUN on that space per Genie space ACLs.
  • For using the Conversation APIs, the caller also needs the Databricks SQL entitlement and warehouse access; if these are missing, subsequent calls will fail even after you can list spaces.

Fix it step-by-step

  • In the Genie UI, open each space and use Share โ†’ add your service principal โ†’ grant CAN VIEW (or CAN EDIT). This is what allows the SP to see the space in listings.
  • Ensure the service principal has the Databricks SQL entitlement and at least CAN USE on the target SQL warehouse for that space (if you plan to call conversation/query endpoints).
  • Verify you are calling the workspace-scoped host (not the account-level host) and the correct endpoint: bash curl -s -H "Authorization: Bearer $TOKEN" \ https://<workspace-host>/api/2.0/genie/spaces
  • Optionally, check audit logs for the aibiGenie.listSpaces event to confirm requests are reaching the workspace and how theyโ€™re being authorized.

Expected response shape

When the SP has access, the endpoint returns a spaces array with each spaceโ€™s id, title, and description (and other fields depending on version).
 

Why your UI view differs from the API

You can see your two spaces in the UI because theyโ€™re shared with your user, but your service principal is a different identity without space-level permissions. The List Spaces API reflects the callerโ€™s access, not the creatorโ€™s. The screenshot you attached matches this scenario (community post describing {} when listing with SP).
 
Hope this helps, Louis.

szymon_dybczak
Esteemed Contributor III

Hi @hch_fiq ,

You need setup proper permissions for your service account to see genie space. Look at below Genie space ACL table from documentation. When there's no ACL set you won't see anynting. So, your Service Principal needs at least CAN VIEW/CAN RUN permission.

szymon_dybczak_0-1762462568978.png

 

 

Join Us as a Local Community Builder!

Passionate about hosting events and connecting people? Help us grow a vibrant local communityโ€”sign up today to get started!

Sign Up Now