Coelevate Documentation
API ReferenceContext Repository

List asset types

Returns every asset type the project can hold: the built-in types and any the project declared itself.

GET /context/v1/asset-types

Returns every asset type the project can hold: the built-in types and any the project declared itself. Each entry gives the type's display names, its fields with their media types and declared limits, and a custom flag that is true for a type the project declared. Call this first to learn what exists before listing or searching assets; the type names it returns are the values to pass as asset_type elsewhere.

Requires the context:read scope.

Responses

StatusMeaning
200The request succeeded.
401The token is missing, expired or invalid.
403The token does not carry the scope this operation requires.
404No such project, or the token belongs to a different project.

The 200 response body:

FieldTypeRequiredDescription
asset_typesarray of AssetTypeEntryyesEvery asset type, built-in and project-declared.
link_floorarray of LinkRuleyesThe relationships any asset may have, and between which kinds.

Shapes

The named shapes used above.

AssetTypeEntry

One asset type the project can hold.

FieldTypeRequiredDescription
asset_typestringyesThe type's name; the value to pass as asset_type elsewhere.
cardobjectyesWhich of the type's fields feed an asset's card: its title, summary and tags.
content_schemaarray of AssetTypeFieldyesThe fields of an asset of this type, with their declared limits.
custombooleanyesTrue for a type the project declared itself, false for a built-in one.
declared_schemaobject or nullnoFor a type the project declared itself, the JSON Schema its assets' content must satisfy; absent for a built-in type, whose fields are in content_schema.
display_labelstringyesThe name to show a person.
enabledbooleanyesWhether the project can currently use the type.
kit_rolestring or nullnoThe role a kit holds assets of this type in (contains, offers or carries), or null for a type a kit cannot hold.
nounstringyesWhat one asset of this type is called.
object_typestringyesThe id prefix assets of this type carry.
purposestringyesWhat the type is for.
tableobject or nullnoFor a type the project declared as a table: its key_column, typed columns, max_rows and rows_field; null for every other type.
when_not_to_usestringyesWhen another type is the better choice.
when_to_usestringyesWhen to create an asset of this type.

AssetTypeField

One field of an asset type's body.

FieldTypeRequiredDescription
cardinalitystringyesWhether the field holds one value or many.
declared_maxinteger or nullnoThe most items or entries the field may hold, when limited.
descriptionstringyesWhat the field is for.
enumarray of object or nullnoThe only values the field accepts, when it is restricted to a set.
kindstringyesWhat kind of value it holds, for example text, a list or a map.
mime_typestring or nullnoThe media type of the field's content, when it has a fixed one.
mime_type_fieldstring or nullnoThe name of another field that says this field's media type, when it varies.
namestringyesThe field's name.
requiredbooleanyesWhether the field must be present.

LinkRule

A relationship the project's assets may have.

FieldTypeRequiredDescription
bidirectionalbooleanyesWhether the relationship reads the same in both directions.
endpoint_asset_typesobjectnoA narrower set of asset types the two ends may be, when the relationship is restricted.
from_kindsarray of stringyesThe kinds of asset it may start from.
predicatestringyesThe relationship's name.
to_kindsarray of stringyesThe kinds of asset it may point to.

Example

curl -sS "$API_URL/context/v1/asset-types" \
  -H "Authorization: Bearer $TOKEN"