Skip to main content

Entity metamodel API

The curation API works with entities: a table, a dashboard, a tag. This API works one level up, with the shapes those entities take — the entity types, and the attributes each type carries.

An entity type is a class; an entity is an instance of it. An attribute definition declares that instances of a type may carry a value of a given kind, under a given name. Nothing here writes values; that is the curation API.

All endpoints require authentication and return the standard DataDios response envelope:

{
"STATUS": "SUCCESS",
"MESSAGE": "",
"DATA": {}
}

A refused request has STATUS: "FAIL" and a machine-readable code in DATA.reason. Branch on DATA.reason, never on the text in MESSAGE.

Endpoints​

Method and pathPurposeSuccess status
POST /entities/typesCreate an entity type201 when created; 200 when the name already exists
GET /entities/typesList entity types200
POST /entities/types/{guid}/attributesDeclare an attribute on an entity type201
GET /entities/types/{guid}/attributesList the attributes that apply to a type200
PATCH /entities/types/{guid}/attributes/{name}/allowed-ref-typesAdd or remove the types a reference attribute allows200

Create an entity type​

{
"name": "Data Product"
}

Creating a type is create-or-get, not create-or-update. Names are compared after trimming spaces and ignoring letter case. If the name already resolves to a type, the API returns that type with "created": false and writes nothing.

From the DataDios release after v1.13.0, a type name may be up to 256 characters. A longer name is refused with 400 value_too_long, and the message names the field and the limit, for example name is 268 characters, exceeding the 256-character cap.

Two consequences follow from the identity rule, and both are easier to know than to discover:

  • Creating "Data Product" twice converges on one type. There is no way to end up with two.
  • A type's identity is derived from its name, so a type that is deleted and later recreated under the same name comes back with the same guid. Any curation that outlived the delete points at it again.

The response carries origin, which separates the types DataDios ships from the ones you create:

{
"entity_type": {
"guid": "...",
"name": "Data Product",
"origin": "user_defined",
"catalog_level": true
},
"created": true
}

catalog_level is one of the fields a type row carries to say how a client should treat the type. List entity types describes them all.

Say where a type's entities may sit​

From the DataDios release after v1.13.0, a type you create can carry a parent rule. Send it with the create:

{
"name": "Term",
"parent_types": ["<guid of the Glossary type>"],
"parent_required": true
}
  • parent_types lists the type guids an entity of this type may sit under, at most 50. An empty or absent list means any type.
  • parent_required: true refuses an entity of this type with no parent.

Every create of an entity follows the rule, through every route that can create one. An entity can have at most 10 ancestors. A create deeper than that is refused with hierarchy_too_deep. An entity type row is never a valid parent.

parent_types takes guids only. A name, or a guid that names no type, is refused with 404 entity_type_not_found. If the name already resolves to a type, a request that carries a rule is refused with 409 entity_already_exists, and the rule is not applied.

To change the rule later, write it on the type row with PATCH /entities/{type guid}/attributes from the curation API:

{
"attributes": {
"parent_types": ["<guid of the Glossary type>", "<guid of the Folder type>"],
"parent_required": [false]
}
}

Dropping the requirement always works. Adding a type to a list that already holds one always works. The first type on an empty list narrows the rule from any type, so it is checked like a remove. A change that existing entities would break is refused with 409 parent_rule_in_use. MESSAGE gives the count, for example "3 entities of this type have no parent". Other refusals:

  • parent_type_by_name (400): parent_types holds a name instead of a guid.
  • parent_rule_on_system_type (409): the type is not one you created.
  • parent_rule_not_bulk (400): a bulk curation job cannot change a parent rule.

The built-in levels follow their own parent_type. A schema needs a database parent, and a datasource or a vocabulary value takes no parent. A business_category may sit at the root, and a business_term takes no parent (see Glossary types).

List entity types​

GET /entities/types returns both the seeded system types and your own, told apart by origin. You need that distinction: only user-created types can be renamed or deleted.

The listing is paged with a cursor. Pass cursor and page_size as query parameters; the response carries next_cursor, which is null on the last page.

{
"entity_types": [
{ "guid": "...", "name": "Data Product", "origin": "user_defined", "catalog_level": true }
],
"next_cursor": null
}

What a type row tells a client​

From the DataDios release after v1.13.0, each row also says how to treat the type, so a client does not need its own list of type names. A field that does not apply is left out, not sent as false or null.

FieldSent onMeaning
catalog_levelBuilt-in levels, managed types, your typestrue: the type's entities are rows in the Entity Catalog table
vocabularydomain, env, tag, classification, grouptrue: the type's entities are values picked in an attribute cell, not rows of the table
labelBuilt-in levels, managed typesThe name to show for the type
iconBuilt-in levels, managed typesA key the client maps to an icon
parent_typedatabase, schema, table, column, business_categoryThe guid of the level one step above. Left out on datasource, the top level
creatableManaged typesfalse: creating an instance of the type is refused
name_locked_hintManaged typesText to show where an instance's name can't be edited
parent_typesYour typesThe type guids an instance may sit under. An empty list means any type
parent_requiredYour types; business_categorytrue: an instance must have a parent. business_category sends only false: it may sit at the root

The built-in levels are datasource, database, schema, table and column, in that order from the top:

{
"guid": "...",
"name": "table",
"origin": "system",
"label": "Object",
"icon": "table",
"catalog_level": true,
"parent_type": "<guid of the schema type>"
}

A vocabulary type carries only its mark:

{ "guid": "...", "name": "tag", "origin": "system", "vocabulary": true }

Every type you create is a catalog level, shown under its own name. From the DataDios release after v1.13.0, it also carries its parent rule:

{
"guid": "...",
"name": "Term",
"origin": "user_defined",
"catalog_level": true,
"parent_types": ["<guid of the Glossary type>"],
"parent_required": true
}

A type that a connector reported, and that is none of the above, carries none of these fields.

From the DataDios release after v1.13.0, a few types are managed by DataDios itself: today, dashboard. Their entries are added and kept in step by the feature they belong to (see Dashboards in the catalog), never by hand. A managed type's row also carries how to show it:

{
"guid": "...",
"name": "dashboard",
"origin": "system",
"label": "Dashboard",
"icon": "dashboard",
"catalog_level": true,
"creatable": false,
"name_locked_hint": "The name comes from the dashboard. Rename it on the dashboard's page."
}

creatable: false means creating an instance is refused (see the curation API). Creating a type with a managed type's name returns that type with "created": false, the same as any existing name.

A type named dashboard that you created yourself before this release stays yours (user_defined), and while it exists DataDios adds no dashboards to the catalog (see Dashboards in the catalog). Since this release, you can't create your own type with that name.

Glossary types​

From the DataDios release after v1.13.0, two more system types hold the business glossary. Both are catalog levels. Their rows carry the label Category and Term, and no icon. No routes are added: you create and read them with the curation API.

TypeWhere it may sit
business_categoryAt the root, or under another business_category. Its row sends parent_type and "parent_required": false
business_termUnder no parent. A term belongs to a category through glossary_category

A category under any other type is refused with 400 parent_not_allowed.

The seed gives business_term these attributes. The glossary_ prefix keeps them apart from attributes you declare yourself:

AttributeValueLimit
glossary_definitionOne text value1,000 characters
glossary_synonymsSeveral text values1,000 characters each, 500 values
glossary_categoryOne business_categoryOptional
glossary_statusOne text valueDraft, Approved or Deprecated
glossary_relatedSeveral business_term entities500 values

The seed also adds glossary_terms to table and to column: several business_term entities, at most 500. It lists with the other attributes of those types, and it is filterable. None of these attributes is required.

If you declared an attribute with one of these names before the upgrade, the upgrade adds none of the glossary's types or attributes.

Declare an attribute​

{
"name": "sla_tier",
"value_type": "string",
"cardinality": "multi",
"allowed_values": ["gold", "silver", "bronze"],
"required": false,
"default_value": "bronze",
"filterable": false
}
FieldRequiredMeaning
nameyesAttribute name, unique within the owning type; from the DataDios release after v1.13.0, at most 128 characters
value_typeyesOne of string, number, boolean, date, json, entity_ref
cardinalityyessingle for one value, multi for a list
allowed_valuesnoEnumerated values, for scalar types only
allowed_ref_typesfor refsFrom the DataDios release after v1.13.0: guids of the types an entity_ref value may be, at most 50
allowed_ref_typefor refsOne type guid. The same as a one-item allowed_ref_types
requirednoWhether instances must carry a value
default_valuenoApplied when an instance is created without one; an entity guid for references
filterablenoWhether the attribute can be filtered on; entity_ref only

Every malformed combination is refused with its own reason code rather than being quietly ignored. The rules that are easiest to get wrong:

  • allowed_values is for scalars only. A reference attribute is constrained by allowed_ref_types instead. Sending both is refused.
  • An entity_ref attribute must declare at least one type. Send allowed_ref_type. From the DataDios release after v1.13.0, you can send allowed_ref_types instead, but not both. An empty list is refused.
  • A value by name needs a one-type list. From the DataDios release after v1.13.0, an attribute can allow several types. A name does not say which type to find or create, so with several types a value must be an entity guid. A name is refused with ref_name_needs_one_type.
  • filterable applies to entity_ref only. Filtering is built on reference values, so a filterable string attribute would look filter-ready and match nothing, permanently.

A "used by" attribute that holds tables and columns:

{
"name": "used_by",
"value_type": "entity_ref",
"cardinality": "multi",
"allowed_ref_types": ["<guid of the table type>", "<guid of the column type>"]
}

Limits​

LimitValueRefusal reason
Attributes declared on one type200too_many_attribute_defs
Entries in allowed_values1,000too_many_allowed_values
Entries in allowed_ref_types (from the DataDios release after v1.13.0)50too_many_allowed_ref_types
Characters in an attribute name (from the DataDios release after v1.13.0)128value_too_long
Request body, before it is parsed8 MBrequest_too_large (413)

The first two are not about the size of a single request. A type's attribute definitions are read on every curation write against that type, so an unbounded set is a cost paid by every later write rather than by the call that declared them.

Attribute names cannot be changed​

An attribute's declaration is fixed once created. There is no rename and no edit: changing any field means withdrawing the attribute and declaring a new one. The one exception is a reference attribute's list of allowed types (see Change a reference attribute's allowed types). filterable is the field callers most often want to flip, and flipping it would rewrite the stored filter data of every instance of the owning type — a background job, not a field edit.

To withdraw one, use DELETE /entities/attributes/{type_guid}/{name} from the curation API.

Change a reference attribute's allowed types​

From the DataDios release after v1.13.0, PATCH /entities/types/{guid}/attributes/{name}/allowed-ref-types adds types to a reference attribute's list, or removes them. Every other field stays fixed.

{
"add": ["<guid of the datasource type>"],
"remove": ["<guid of the column type>"]
}
{
"attribute": {
"name": "used_by",
"allowed_ref_types": ["<guid of the table type>", "<guid of the datasource type>"],
"allowed_ref_type": null
},
"changed": true,
"names_refused": false
}
  • An add always works. If it takes a one-type list to several, the response has "names_refused": true. From then on, a value sent by name is refused with ref_name_needs_one_type, and you must send the entity's guid.
  • A remove is refused while the type is in use. If any value or the default_value points at an entity of that type, the answer is 409 allowed_ref_type_in_use. MESSAGE gives the count, for example "12 value(s) of 'used_by' point at an entity of a type being removed".
  • A change that would empty the list is refused with allowed_ref_type_required.
  • A request that leaves the list as it was answers "changed": false and writes nothing.
  • The platform attributes' lists are fixed. A change to tags, for example, is refused with 409 system_def_not_changeable.

add and remove each take at most 50 distinct guids, and the list can hold at most 50 types.

List a type's attributes​

GET /entities/types/{guid}/attributes returns every attribute that applies to the type: the ones declared on it, plus the ten platform attributes every system type carries — domain, env, tags, classification, groups, owner, member_of, and the three person fields owner_by_person, same_as and same_as_by_admin (see Person fields). A type you create yourself carries six of them: it leaves out owner, member_of, same_as and same_as_by_admin.

A brand-new type with no attributes of its own still lists those platform attributes: six on a type you created, ten on a system type. They are owned by the framework rather than by any one type, so they come back with "owner_type": null. That null is deliberate and is not a missing value: naming an owning type would claim a per-type attribute where the platform has a schema-wide one.

From the DataDios release after v1.13.0, table and column also list glossary_terms, and business_term lists its glossary_ attributes (see Glossary types).

Withdrawn attributes are absent from this listing.

{
"attributes": [
{
"guid": "...",
"name": "tags",
"owner_type": null,
"value_type": "entity_ref",
"cardinality": "multi",
"allowed_values": null,
"allowed_ref_types": ["..."],
"allowed_ref_type": "...",
"required": false,
"default_value": null,
"filterable": true,
"origin": "system",
"editable": true
}
]
}

From the DataDios release after v1.13.0, each of the three seeded person attributes (owner_by_person, same_as and same_as_by_admin) also carries "refers_to": "person": its value is a user's GUID held as text. same_as_by_admin alone also carries "not_a_person_value": "none", the value that means "not the same person" (see Person fields). Read these two fields to pick out a person attribute, not the attribute's name. Every other attribute omits both.

From the DataDios release after v1.13.0, each attribute also carries allowed_ref_types, the full list. allowed_ref_type repeats the one type when the list holds exactly one. It is null when the list holds several, so read allowed_ref_types.

From the DataDios release after v1.13.0, each attribute also carries editable: whether you may write it by hand. It is false for the attributes the scan writes (owner, member_of and same_as; account_read and account_read_at on a data source; account_status and source_email on an account). It is false for same_as_by_admin unless you are a tenant admin. A form should leave out an attribute whose editable is false, or show it read-only. The attribute returned when you declare one, or change its allowed types, carries editable too.

This listing is not paged. It returns the type's full applicable attribute set, which the 200-per-type limit above bounds.

Refusal reasons​

ReasonStatusWhen
attribute_def_already_exists409An attribute of that name is already declared on the type, or the name is reserved for a built-in attribute (see below)
attribute_def_withdrawn409An attribute of that name was withdrawn and its data is still being removed
type_instances_managed409Creating a type: the name belongs to a type DataDios manages, and that type has not been set up for you yet (DataDios sets it up when it writes your first dashboard's catalog row)
too_many_attribute_defs400The type is at the 200-attribute limit
base_type_not_owner400An attribute was declared against the platform's own attribute owner
unknown_entity_type404The type guid does not resolve
unknown_value_type400value_type is outside the six
invalid_cardinality400cardinality is neither single nor multi
allowed_values_not_supported400allowed_values was sent on an entity_ref attribute
allowed_ref_type_not_supported400allowed_ref_types or allowed_ref_type was sent on a non-reference attribute, or its allowed types were changed
allowed_ref_type_required400An entity_ref attribute named no type, or a change would empty its list
too_many_allowed_ref_types400allowed_ref_types, parent_types, or an add or remove list holds more than 50 types
allowed_ref_type_in_use409A remove of a type that a value or the default still uses
system_def_not_changeable409A change to a platform attribute's allowed types
attribute_withdrawn409A change to the allowed types of a withdrawn attribute
entity_type_not_found404The {guid} in the path, or a type guid in parent_types, add or remove, names no type
invalid_request400A change to allowed types sends both add and remove empty, or a blank guid
entity_already_exists409Creating a type: the name already exists and a parent rule was sent
filterable_not_supported400filterable was set on a non-reference attribute
referent_not_found404A reference default_value does not resolve
ref_type_mismatch400An entity_ref default_value names an entity of the wrong type
empty_value400name normalizes to nothing once spaces are trimmed
value_too_long400A type name is over 256 characters, or an attribute name over 128
invalid_page_size400page_size on the type listing is outside the permitted range
invalid_cursor400cursor on the type listing is not one this API issued
request_too_large413The body exceeds 8 MB

The two attribute 409s are temporary in different ways​

attribute_def_already_exists means the attribute is live. Declaring it again is refused rather than treated as a no-op, because a declaration carries a shape: answering SUCCESS would report a definition you may not have asked for. Withdraw it first if you need a different shape.

The same reason answers a name reserved for a built-in attribute, on any type: domain, env, tags, classification, groups, owner, member_of, owner_by_person, same_as, same_as_by_admin, account_read, account_read_at and account_status. Case and surrounding spaces do not matter, so Domain is refused too. These attributes already apply to the types they belong to, and a type's own attribute of the same name would hide them. Withdrawing does not clear this refusal: choose another name, such as business_domain.

attribute_def_withdrawn means the attribute was withdrawn but its stored values have not finished being removed. That refusal clears on its own — a daily job deletes the withdrawn definition once its data is gone, after which the name can be declared afresh. It is a window, not a permanent block.