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
| Status | Meaning |
|---|---|
200 | The request succeeded. |
401 | The token is missing, expired or invalid. |
403 | The token does not carry the scope this operation requires. |
404 | No such project, or the token belongs to a different project. |
The 200 response body:
| Field | Type | Required | Description |
|---|---|---|---|
asset_types | array of AssetTypeEntry | yes | Every asset type, built-in and project-declared. |
link_floor | array of LinkRule | yes | The relationships any asset may have, and between which kinds. |
Shapes
The named shapes used above.
AssetTypeEntry
One asset type the project can hold.
| Field | Type | Required | Description |
|---|---|---|---|
asset_type | string | yes | The type's name; the value to pass as asset_type elsewhere. |
card | object | yes | Which of the type's fields feed an asset's card: its title, summary and tags. |
content_schema | array of AssetTypeField | yes | The fields of an asset of this type, with their declared limits. |
custom | boolean | yes | True for a type the project declared itself, false for a built-in one. |
declared_schema | object or null | no | For 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_label | string | yes | The name to show a person. |
enabled | boolean | yes | Whether the project can currently use the type. |
kit_role | string or null | no | The role a kit holds assets of this type in (contains, offers or carries), or null for a type a kit cannot hold. |
noun | string | yes | What one asset of this type is called. |
object_type | string | yes | The id prefix assets of this type carry. |
purpose | string | yes | What the type is for. |
table | object or null | no | For 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_use | string | yes | When another type is the better choice. |
when_to_use | string | yes | When to create an asset of this type. |
AssetTypeField
One field of an asset type's body.
| Field | Type | Required | Description |
|---|---|---|---|
cardinality | string | yes | Whether the field holds one value or many. |
declared_max | integer or null | no | The most items or entries the field may hold, when limited. |
description | string | yes | What the field is for. |
enum | array of object or null | no | The only values the field accepts, when it is restricted to a set. |
kind | string | yes | What kind of value it holds, for example text, a list or a map. |
mime_type | string or null | no | The media type of the field's content, when it has a fixed one. |
mime_type_field | string or null | no | The name of another field that says this field's media type, when it varies. |
name | string | yes | The field's name. |
required | boolean | yes | Whether the field must be present. |
LinkRule
A relationship the project's assets may have.
| Field | Type | Required | Description |
|---|---|---|---|
bidirectional | boolean | yes | Whether the relationship reads the same in both directions. |
endpoint_asset_types | object | no | A narrower set of asset types the two ends may be, when the relationship is restricted. |
from_kinds | array of string | yes | The kinds of asset it may start from. |
predicate | string | yes | The relationship's name. |
to_kinds | array of string | yes | The kinds of asset it may point to. |
Example
curl -sS "$API_URL/context/v1/asset-types" \
-H "Authorization: Bearer $TOKEN"