Acceldata
ADOC

Last updated: Oct 16, 2026 07:21 UTC

Unified Tags

This page describes how to create, manage, and assign tags to catalog entities in Acceldata Data Observability Cloud (ADOC) by using acceldata-sdk-python. Unified Tags replace the previous separate tags and labels model with a single, consistent key-value tagging system.

Tags are organized as key-value pairs. A tag key defines the classification dimension — for example, environment — and each key can have one or more values, such as prod or staging. You then associate one or more values with an entity such as a policy, asset, or rule.

This page covers SDK-level tag operations using acceldata-sdk-python. For UI-based tag management — including the tag library, Data Labelers, and Data Protection — see Tags.

Concepts

Concept

Description

Tag Key

A classification dimension. For example, environment.

Tag Value

An allowed value under a key. For example, prod or staging.

Tag Association

A link between one or more tag values and a catalog entity such as a policy or asset.

Prerequisites

Workflow overview

To tag a catalog entity, complete the following steps:

  1. Create a tag key.
  2. Add values to the key.
  3. Search for the key to retrieve value IDs.
  4. Associate the value IDs with an entity.

The following sections describe each step with code examples.

Step 1: Create a tag key

Use client.create_tag() to create a new tag key and define its first value. The tag type can be CreateTagType.USER for a user-defined tag or CreateTagType.GOVERNED for a governed tag.

from acceldata.client.adoc_client import AdocClient
from acceldata.models.api.tags.create_tag_request import CreateTagRequest
from acceldata.models.sdk.tags.create_tag_type import CreateTagType
client = AdocClient(
    url="https://<your-adoc-url>",
    access_key="<your-access-key>",
    secret_key="<your-secret-key>",
)
tag = client.create_tag(
    CreateTagRequest(
        key="environment",
        values=["prod"],
        type=CreateTagType.USER,
    )
)
print(tag.to_dict())

You must provide at least one value when you create a tag key.

Step 2: Add values to a tag key

Call add_values() on the tag object returned in Step 1 to add more values to the key:

tag.add_values(["staging", "dev"])

You can also add values by key ID using add_values_to_tag_key(...) if you don't have a reference to the original tag object:

client.add_values_to_tag_key(key_id=tag.id, values=["staging", "dev"])

Values must be unique within a key. Adding a value that already exists on the key returns an error.

Step 3: Search for tag keys and values

Before associating tags with an entity, use search_tag_key_values() to retrieve the key-value IDs you need. The key_value_id field on each result is required for the association step.

from acceldata.models.sdk.tags.search_key_values_request import SearchKeyValuesRequest
search = client.search_tag_key_values(
    SearchKeyValuesRequest(name="environment", page=0, size=20)
)

Step 4: Associate tags with an entity

Use client.associate_tags() to link one or more tag values to a catalog entity. The entity_type parameter specifies the type of entity being tagged. For the full list, see Supported entity types.

from acceldata.models.api.catalog.associate_tags_request import AssociateTagsRequest
from acceldata.models.sdk.tags import TagEntityType
key_value_ids = [item.key_value_id for item in (search.results or []) if item.key_value_id]
client.associate_tags(
    AssociateTagsRequest(
        entity_id=89,
        entity_type=TagEntityType.POLICY,
        key_value_ids=key_value_ids,
    )
)

The key_value_ids list must not be empty. Calling with an empty list will not associate any tags and may return an error.

Verify tag associations

Use get_tags_for_entity() to retrieve all tags currently associated with an entity and confirm that the association was applied:

entity_tags = client.get_tags_for_entity(89, TagEntityType.POLICY)
print([t.to_dict() for t in entity_tags])

Supported entity types

The TagEntityType enum defines the catalog entity types that support tag associations:

Entity Type

Description

TagEntityType.ASSET

A data asset such as a table, view, or file.

TagEntityType.POLICY

A data reliability policy.

TagEntityType.RULE

An individual rule within a policy.

TagEntityType.RULE_SET

A rule set grouping multiple rules.

TagEntityType.UDF

A user-defined function.

Common mistakes

Mistake

How to avoid it

Creating a key without providing any values.

Provide at least one value in the values list when calling create_tag().

Attempting to add a value that already exists on the key.

Check existing values before calling add_values(). Adding a duplicate returns an error.

Creating a key that already exists.

Use search_tag_key_values() to check whether a key already exists before creating it.

Calling associate_tags() with an empty key_value_ids list.

Verify that the search_tag_key_values() result is not empty before extracting IDs.

Using an entity ID that does not exist.

Confirm the entity exists in ADOC before attempting to associate tags with it.

Skipping verification after association.

Call get_tags_for_entity() after associating to confirm the tags were applied.