Skip to main content

Alation: Register Metadata using API

What is Alation

When your datasets, reports, and other assets are spread across environments (AWS, Azure, GitHub, Power Bi etc), it can take days to hunt down the right information (to find out where is what data). Metadata management is the cornerstone of modern data strategy. Like a skilled librarian, it ensures the right data is cataloged, easy to locate, properly maintained, and aligned with organizational needs. One of the Metadata management solutions is Alation.

Video explanations:

Connectors

Alation provides connectors for over 120 sources:all connectors.

Alation can extract most of the metadata automatically but not all.
Let’s take the example of Denodo & Alation case. Alation has a connector for Denodo.

Supported Authentications methods:

  • Authentication with username and password
  • SSL Authentication

Alation automatically extracts following metadata :

  • List of schemas
  • List of tables
  • List of views
  • List of columns
  • popularity of the data
  • Primary key information for extracted tables
  • Retrieval of data samples from extracted table
  • Retrieval of data samples from extracted columns

But, connector cannot extract:

  • Column comments
  • Column data types
  • Source comments

To compliment the metadata extracted by the connector (to add the metadata that Alation does not automatically extract), API can/should be used.

Create Custom Fields

Before explaining how to use API to add metadata fields to the data sources, I need to explain custom fields.

On the Alation UI, the data sources such as tables, schemas etc. are presented with the metadata fields like title and description. Often times default metadata fields such as title, description etc. is enough, but if you need to add new, custom fields, it is possible.

Alation has built-in fields such as title and description. In addition tot hat, Alation also allows creation of the custom fields. Custom fields are reusable objects.
Custom fields are attached to object templates. A (object) template specifies how metadata is presented for a type of object (table, schema, column etc).
Each object type has its own template.

Almost all the objects of the same type share a common template, in other words, a template applies to all the objects of the same type. For example, all the schemas use the same schema template.

To add a custom field (to a schema).

  1. You must have the Catalog Admin or Server Admin role to customize the Alation catalog.
  2. Create a custom field
  3. Edit the (schema) template by adding the newly created custom field.

graph
(it is AI generated image, there are some inaccuracies in the text)

Note: Alation assigns an ID to every custom field. The title of the custom field might be “Data Sensitivity” and its field_id 1002.

APIs

Upload Logical Metadata (ULM) API

There is an old api, Upload Logical Metadata (ULM) API. This api is deprecated. DO NOT USE IT. (Alation doesn’t recommend using the ULM API.)
Upload Logical Metadata (ULM) API Deprecation

Relational Integration API

To update titles, descriptions and custom fields, use Relational Integration APIs.

Permissions needed: Data Source Viewer or Data Source Admin

API Payload limitation per api call:

Object Type Max Objects in POST Payload
Schema 1,000
Table 1,000
Column 10,000

Update schema example

import requests

url = "https://alation_domain/integration/v2/schema/"

payload = [
    {
        "key": "95.employees", # schema name is employees
        "title": "Schema for employees data.",
        "description": "Stores all the tables related to employees from marketing department.",
        "db_comment": "This schema is part of company database storing important PII data.",
        "custom_fields": [
             {
            "field_id": 101,
            "value": "Finance Team"       // Business Owner custom field
            "op": "replace"
            },
            {
            "field_id": 102,
            "value": "Highly Confidential" // Data Sensitivity custom field
            "op": "replace"
            }
        ]
    }
]
headers = {
    "accept": "application/json",
    "content-type": "application/json",
    "TOKEN": "my_secret_token"
}

response = requests.patch(url, json=payload, headers=headers)

print(response.text)
Term Explanation
key Name of a schema/table etc
title title of a schema/table (It exits only in Alation’s catalog, not in the database.)
db_comment Comments on the schema from the data source.
op Operation need to perform for custom field. It can be add, remove or replace. add and remove operation are only apllicable for MULTI_PICKER and OBJECT_SET. replace is applicable for all custom fields.

custom_fields should be array of objects.
Alation assigns an ID to every custom field. The title of the custom field might be “Data Sensitivity” and its field_id 1002.
But, Relational Integration API does NOT allow creation of new custom fields. It can also update them.

These custom fields first should be associated with the schema otype template. You can create and add a new custom field to the schema otype template from Customize Catalog option in the UI.

Custom Field Value API

Custom Field Values Async API can be used to update custom fields.

Note: The Custom Field Value APIs will not allow you to update titles and descriptions on schemas, tables, and columns. Use Relational Integration API instead.

Limit: Maximum of 10,000 objects per request.

import requests

url = "https://alation_domain/integration/v2/custom_field_value/async/"

payload = [
    {
        "field_id": 10006, # custom field id
        "oid": 5,  # id of the object this custom field belongs to
        "otype": "table", # the type of the object this field belongs to
        "ts_updated": "2025-09-10T07:07:33.884Z",
        "value": "my custom field value"
    },
    {
        "field_id": 10007,
        "oid": "7", # id of the object this custom field belongs to
        "otype": "attribute", # the type of the object this field belongs to
        "ts_updated": "2025-09-10T07:07:33.884Z",
        "value": ["high, medium, low"]
    }
]
headers = {
    "accept": "application/json",
    "content-type": "application/json",
    "TOKEN": "my_secret_token"
}

response = requests.put(url, json=payload, headers=headers)

print(response.text)

Comments

Popular posts from this blog

Introduction to SQLFluff: How to make your SQL code clean and error-free

Image by Jake Aldridge from Pixabay You know oftentimes, the cause of runtime or compile errors and hours of debugging agony is all due to simply a missing semicolon. Have you ever had such experience? If you had, you are not alone. There are two ways to avoid these unfortunate situations: either become a perfect developer who never makes mistakes, or use helpful tools such as linters that can catch these errors early on. I am nowhere near being a perfect developer who never makes a mistake. In fact, I'm probably the opposite of a perfect developer, so even if I wanted to, I wouldn’t be able to teach you how to become a perfect developer. But what I can teach you is using linters. A Wikipedia defines a linter as a "static code analysis tool used to flag programming errors, bugs, stylistic errors and suspicious constructs." If you're not convinced yet on using linters, consider this scenario: in a large project with multiple members, different people tend to ...

Git squash merge explained

There are many ways to integrate changes in git: regular / normal git merge, git squash merge, git rebase etc. This article explains git squash merge by comparing it to regular merge. Let’s use below example: In the repository with default main branch, after two commits, a new feature branch is created. Some work happened in feature branch. feature branch now has 2 commits that it shares with main branch, and three exclusive commits (exists only in feature branch). In the meantime, others worked on main branch and added two new commits (exists only in main branch). git log output of the main branch: c72d4a9 ( HEAD - > main ) fourth commit on main 2c3dd61 third commit on main 0c2eec3 second commit on main 9b968e8 first commit on main git log output of the feature branch: 786650f ( HEAD - > feature ) third commit on feature 21cbaf1 second commit on feature 677bc7f first commit on feature 0c2eec3 second commit on main 9b968e8 first commit on mai...

How To Use KeePassXC Cli

There are similarly named programs: KeePass, KeePassX and KeePassXC (many of which are each others’ forks). Program Condition KeePass primarily for Windows. KeePassX no longer actively maintained. KeePassXC actively maintained and runs natively on Linux, macOS and Windows . Note: GUI version of the KeePassXC has more features than cli version. GUI version has variety of shortcuts as well. Regarding how to use GUI version of the KeePassXC, visit Getting Started Guide . Below features are available only in GUI version. Setting “Name” and “Description” fields of passwords database. Nesting Groups. Creating entry attributes ( open issue ). Adding Timed One-Time Passwords (TOTP). Adding entry with the same title as existing entry. KeePassXC stores all the passwords in passwords database. A passwords database (hereafter referred to as database) is an (encrypted) binary file. It can have any or no extension, but the .kdbx extension is commonly used. The ...