This article explains how you can use the Unity Catalog REST API to store and manage your data and AI assets.
There are two ways to use Unity Catalog:
- the built-in Command Line Interface,
- the REST API.
The Unity Catalog REST API is a great alternative to using the Command Line Interface. It can give you more flexibility, it’s less verbose, and it gives you the freedom to use your own IDE and easily add new functionalities. In fact, the CLI uses the REST API under the hood, with some limitations in place. If you want access to all Unity Catalog features, use the REST API.

If you’re new to Unity Catalog, you may want to check out the Unity Catalog 101 tutorial first to understand what Unity Catalog is and how its basic architecture works. The 101 tutorial uses the Unity Catalog CLI, while this tutorial focuses on the REST API. If you’re new to data catalogs in general, consider reading the article What is a data catalog and why do I need one? first.
This tutorial will first explain what a REST API is. Then we will demonstrate how to use the Unity Catalog REST API to perform common operations like listing and creating catalogs, tables and volumes. We will end with a comparison of the REST API and CLI and an example of how you can add your own functionality to the existing REST API.
What is a REST API?
A Representational State Transfer (REST) API is a standardized way for computer systems to communicate over HTTP using simple, stateless requests. A stateless request contains all the information needed to fulfill the requested operation. This means that the server receiving the request does not need to remember anything about previous requests.
This is important for:
Scalability
: Servers don't need to store session data in memory so it’s easier to distribute and scale.Consistency
: Any request can be routed to any server, they will all respond the same way.Debugging
: Each request is isolated, so issues are easier to trace.
REST APIs are a popular way for developers to interact with cloud services and data platforms, because they are lightweight, scalable and easy to test and debug.
At the heart of any REST API are five core HTTP methods
, each with a specific purpose:
Unity Catalog follows the OpenAPI standard for defining its REST API.
What is the OpenAPI standard?
The OpenAPI standard is a machine-readable specification for describing REST APIs. The spec is usually written in YAML or JSON and it allows developers to generate documentation, client SDKs, and perform automated testing. This improves interoperability and speeds up development.
The Unity Catalog REST API follows the OpenAPI standard. You can take a look at the YAML file with the entire API here on Github. Don’t worry if it looks overwhelming, we’ll break it down into simple steps below!
For now all you need to know is that a REST API sends requests for operations to a server at specific endpoints. The server
is the system or application that receives HTTP requests, processes them, and returns responses. The endpoint
is a subsection within a web service to which a client can send requests to interact with a particular resource.
For example, if you were building a webshop with a REST API, then your server might be the backend database containing the inventory data and it would have an endpoint for each item category, e.g. /books, /clothing, /food, etc. Clients can then list, add or delete items for specific inventory categories using the HTTP methods.

Having the API available in this standardized, lightweight, and machine-readable format makes it easy for any developer to incorporate the API into their existing workflows and to add new functionality to it. We’ll take a look at adding functionality to the Unity Catalog REST API at the end of the article.
What should I use the REST API for?
The Unity Catalog REST API is designed for metadata operations like listing catalogs, schemas, and tables, or managing access controls. It is not meant for querying or viewing the actual data stored in your assets. To query and manipulate data, use a query engine like Apache Spark ™.
Read more about managing access controls and credentials vending in the Authentication and Authorization tutorial.
Unity Catalog Architecture
Unity Catalog stores all of your data assets in a three-level namespace:
- Catalog
- Schema
- Data asset
This universal namespace means that you can access data stored in your Unity Catalog using the same Unity Catalog reference from any query engine. For example, to access data stored in a Unity Catalog volume, use: < catalog >
.< schema >
.< volume_name >
. This is great because users don’t need to know where the data is stored or remember the exact path.

The local Unity Catalog server comes preloaded with some sample data for testing and experimentation. It includes one catalog unity
with one schema default
and a number of sample tables
and other sample data.
We’ll take a look at using these assets in a moment.
How do I use a REST API?
A REST API sends messages over HTTP. The most common way to do this is with curl
or the requests
library if you’re working in Python. For this tutorial we will use requests
. You can install this library using:
Once you have it installed, you can use the REST API to perform data operations using a Python script, Jupyter Notebook, or any other method for running Python code.
First import the requests
library:
Then define your Base URL. This is the URL to which all requests will be sent. It should point to the system, application or server with which you want to communicate. In our case, that will be the local Unity Catalog server running at:
Next, define the endpoint to which you want to send your request. For this example, let’s communicate with the catalogs
endpoint.
You can include additional metadata, like content type and credentials, in the headers
. For working with the local Unity Catalog server you will not need any credentials by default. Read the Authentication and Authorization tutorial to learn more.
Now build a simple Python script using a try/except
clause to execute the request. The requests
library has methods that correspond to the 5 core HTTP methods listed above: get
, put
, post
, patch
and delete
.
Let’s start with a get
operation:
This REST request will list all available catalogs registered in your local Unity Catalog server. You can run it anywhere you can run Python code, provided you have a local Unity Catalog server up and running. The server will then return something like this:
You can also implement the same operation using curl commands in your terminal:
Great job! Let’s now take a look at how to use the REST API to perform common operations in Unity Catalog.
Working with Catalogs
Use the /catalogs
endpoint to work with catalogs.
How to list catalogs
Use the GET
command at the /catalogs
endpoint to retrieve a list of all available catalogs on the server.
This will output:
Here we use a second GET
command and a for
loop to fetch only the catalog names from the return data
JSON response. Note that there is no guarantee of a specific ordering of the elements in the list.
How to retrieve catalog metadata
To retrieve metadata about a specific catalog, use the GET
command at the /catalogs/<catalog-name
endpoint. For example:
This will output:
This returns all available metadata for the specified catalog.
How to create a catalog
Use the POST
command at the /catalogs
endpoint to create a new catalog:
This will output:
Well done, you’ve created a new catalog! You can verify by running the GET
command again to list all available catalogs. This should now return:
How to update a catalog
Use the PATCH
command at the /catalogs/<catalog-name>
endpoint to partially update an existing catalog. Include the fields to update in a dictionary and send this with the PATCH
request. For example, to update the comment
field of the catalog we just created above:
This will output:
This has successfully updated only the comment
field without having to rewrite the entire catalog.
How to delete a catalog
Use the DELETE
command at the /catalogs/<catalog-name>
endpoint to delete a specific catalog. You can add the force
parameter to force a delete even if the catalog is not empty.
You can confirm by using the GET
command to list available catalogs. This should now return:
Working with Tables
Use the /tables
endpoint to work with tables registered in Unity Catalog.
How to list tables
Use the GET
command at the /tables
endpoint to retrieve a list of all available tables on the server. You will need to specify the catalog
and schema
names using the params
keyword argument.
This will output:
Here we use a second GET
command and a for
loop to fetch only the table names from the return data
JSON response. Note that there is no guarantee of a specific ordering of the elements in the list.
How to retrieve table metadata
To retrieve metadata about a specific table, use the GET
command at the /tables/<full-table-name>
endpoint. The full name means the 3-level namespace reference in the standard Unity Catalog format: catalog.schema.table
. For example:
This will output:
This returns all available metadata for the specified table (truncated here for legibility).
How to create a table
Use the POST
command at the /tables
endpoint to create a new table. You will need to supply a dictionary containing the table, catalog and schema names as well as the Table Type, Data Source Format, and Storage Location.
This will output:
Well done, you’ve created a new external table in Delta Lake format, stored in the tmp
folder of your local user. You can verify by running the GET
command again to list all available catalogs. This should now return:
Note that currently only external tables are supported. Read more about external tables in the Managed vs External tables blog.
How to delete a table
Use the DELETE
command at the /tables/<full-table-name>
endpoint to delete a specific table. The full name is the 3-level namespace reference to your table: catalog.schema.table
. Let’s delete the table we just created:
You can confirm by using the GET command to list available tables. This should now return:
Working with Schemas
Use the /schemas
endpoint to work with schemas registered in Unity Catalog. You will need to supply the name of the relevant catalog.
Working with Volumes
Use the /volumes
endpoint to work with volumes registered in Unity Catalog. The commands for Volumes follow the same convention as those for working with Tables: you will need to supply the names of the relevant catalog and schema.
You can also read more about working with volumes in the Unity Catalog Volumes tutorial.
Working with Functions
Use the /functions
endpoint to work with functions registered in Unity Catalog. You will need to supply the names of the relevant catalog and schema.
Working with Models
Use the /models
endpoint to work with schemas registered in Unity Catalog. You will need to supply the names of the relevant catalog and schema.
Unity Catalog REST API
The Unity Catalog REST API is a flexible and efficient way to manage your data assets and manage metadata operations. It lets you interact with catalogs, schemas, and tables in a simple, scalable way. You can easily automate tasks and integrate it into your workflows, making your metadata management easy and streamlined. Consider using the REST API when you want to build production-grade, reproducible workflows that integrate with other applications or that incorporate new custom functionality you’ve created.
If you’d like to learn more about how Unity Catalog handles metadata, check out the dedicated Metadata and Data Catalogs tutorial.