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 path | Purpose | Success status |
|---|---|---|
POST /entities/types | Create an entity type | 201 when created; 200 when the name already exists |
GET /entities/types | List entity types | 200 |
POST /entities/types/{guid}/attributes | Declare an attribute on an entity type | 201 |
GET /entities/types/{guid}/attributes | List the attributes that apply to a type | 200 |
PATCH /entities/types/{guid}/attributes/{name}/allowed-ref-types | Add or remove the types a reference attribute allows | 200 |
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_typeslists the type guids an entity of this type may sit under, at most 50. An empty or absent list means any type.parent_required: truerefuses 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_typesholds 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.
| Field | Sent on | Meaning |
|---|---|---|
catalog_level | Built-in levels, managed types, your types | true: the type's entities are rows in the Entity Catalog table |
vocabulary | domain, env, tag, classification, group | true: the type's entities are values picked in an attribute cell, not rows of the table |
label | Built-in levels, managed types | The name to show for the type |
icon | Built-in levels, managed types | A key the client maps to an icon |
parent_type | database, schema, table, column, business_category | The guid of the level one step above. Left out on datasource, the top level |
creatable | Managed types | false: creating an instance of the type is refused |
name_locked_hint | Managed types | Text to show where an instance's name can't be edited |
parent_types | Your types | The type guids an instance may sit under. An empty list means any type |
parent_required | Your types; business_category | true: 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.
| Type | Where it may sit |
|---|---|
business_category | At the root, or under another business_category. Its row sends parent_type and "parent_required": false |
business_term | Under 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:
| Attribute | Value | Limit |
|---|---|---|
glossary_definition | One text value | 1,000 characters |
glossary_synonyms | Several text values | 1,000 characters each, 500 values |
glossary_category | One business_category | Optional |
glossary_status | One text value | Draft, Approved or Deprecated |
glossary_related | Several business_term entities | 500 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
}
| Field | Required | Meaning |
|---|---|---|
name | yes | Attribute name, unique within the owning type; from the DataDios release after v1.13.0, at most 128 characters |
value_type | yes | One of string, number, boolean, date, json, entity_ref |
cardinality | yes | single for one value, multi for a list |
allowed_values | no | Enumerated values, for scalar types only |
allowed_ref_types | for refs | From the DataDios release after v1.13.0: guids of the types an entity_ref value may be, at most 50 |
allowed_ref_type | for refs | One type guid. The same as a one-item allowed_ref_types |
required | no | Whether instances must carry a value |
default_value | no | Applied when an instance is created without one; an entity guid for references |
filterable | no | Whether 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_valuesis for scalars only. A reference attribute is constrained byallowed_ref_typesinstead. Sending both is refused.- An
entity_refattribute must declare at least one type. Sendallowed_ref_type. From the DataDios release after v1.13.0, you can sendallowed_ref_typesinstead, 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. filterableapplies toentity_refonly. 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
| Limit | Value | Refusal reason |
|---|---|---|
| Attributes declared on one type | 200 | too_many_attribute_defs |
Entries in allowed_values | 1,000 | too_many_allowed_values |
Entries in allowed_ref_types (from the DataDios release after v1.13.0) | 50 | too_many_allowed_ref_types |
| Characters in an attribute name (from the DataDios release after v1.13.0) | 128 | value_too_long |
| Request body, before it is parsed | 8 MB | request_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 withref_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_valuepoints at an entity of that type, the answer is409 allowed_ref_type_in_use.MESSAGEgives 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": falseand writes nothing. - The platform attributes' lists are fixed. A change to
tags, for example, is refused with409 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
| Reason | Status | When |
|---|---|---|
attribute_def_already_exists | 409 | An attribute of that name is already declared on the type, or the name is reserved for a built-in attribute (see below) |
attribute_def_withdrawn | 409 | An attribute of that name was withdrawn and its data is still being removed |
type_instances_managed | 409 | Creating 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_defs | 400 | The type is at the 200-attribute limit |
base_type_not_owner | 400 | An attribute was declared against the platform's own attribute owner |
unknown_entity_type | 404 | The type guid does not resolve |
unknown_value_type | 400 | value_type is outside the six |
invalid_cardinality | 400 | cardinality is neither single nor multi |
allowed_values_not_supported | 400 | allowed_values was sent on an entity_ref attribute |
allowed_ref_type_not_supported | 400 | allowed_ref_types or allowed_ref_type was sent on a non-reference attribute, or its allowed types were changed |
allowed_ref_type_required | 400 | An entity_ref attribute named no type, or a change would empty its list |
too_many_allowed_ref_types | 400 | allowed_ref_types, parent_types, or an add or remove list holds more than 50 types |
allowed_ref_type_in_use | 409 | A remove of a type that a value or the default still uses |
system_def_not_changeable | 409 | A change to a platform attribute's allowed types |
attribute_withdrawn | 409 | A change to the allowed types of a withdrawn attribute |
entity_type_not_found | 404 | The {guid} in the path, or a type guid in parent_types, add or remove, names no type |
invalid_request | 400 | A change to allowed types sends both add and remove empty, or a blank guid |
entity_already_exists | 409 | Creating a type: the name already exists and a parent rule was sent |
filterable_not_supported | 400 | filterable was set on a non-reference attribute |
referent_not_found | 404 | A reference default_value does not resolve |
ref_type_mismatch | 400 | An entity_ref default_value names an entity of the wrong type |
empty_value | 400 | name normalizes to nothing once spaces are trimmed |
value_too_long | 400 | A type name is over 256 characters, or an attribute name over 128 |
invalid_page_size | 400 | page_size on the type listing is outside the permitted range |
invalid_cursor | 400 | cursor on the type listing is not one this API issued |
request_too_large | 413 | The 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.