Coelevate Documentation
API ReferenceContext Repository

Get an asset

Returns one asset by its id; the id's prefix says which type it is.

GET /context/v1/assets/{asset_id}

Returns one asset by its id; the id's prefix says which type it is. Pass version to read an archived version instead of the live one. Pass expand=links to attach the asset's incoming and outgoing relationships, each with the neighbour's type and display name already resolved, so you do not need a request per relationship.

Requires the context:read scope.

Parameters

ParameterLocationRequiredDescription
asset_idpathyesThe asset's id.
versionquerynoReturn this archived version of the asset instead of the live one.
expandquerynoPass links to attach incoming and outgoing relationships, each with the neighbour's type and display name already resolved.

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.
422The request was not valid: a parameter or the body failed validation.

The 200 response body:

FieldTypeRequiredDescription
assetobjectyesThe asset's whole body; its fields depend on the asset's type.
asset_idstringyesThe asset's id.
asset_typestringyesThe asset's type.
cardAssetCardyesThe asset's short form.
labelstringyesThe asset's display name.
linksAssetLinks or nullnoThe asset's relationships. Present when expand=links was asked for.
namestring or nullnoThe asset's canonical name, projects/{project}/assets/{asset_id}. A request that takes an asset id in its body or query accepts this name in its place; a URL path takes the bare id. It is null when the id cannot be written in a canonical name.
nounstringyesWhat an asset of this type is called.

Shapes

The named shapes used above.

AssetCard

The short form of an asset: enough to show it in a list without reading its body.

FieldTypeRequiredDescription
idstringyesThe asset's id.
summarystring or nullnoA one- or two-line summary, or null when the asset's type has none.
tagsarray of stringyesThe asset's tags.
titlestring or nullnoA short title, or null when the asset's type has none.

An asset's relationships.

FieldTypeRequiredDescription
incomingarray of AssetLinkyesRelationships that point at this asset.
outgoingarray of AssetLinkyesRelationships that start at this asset.

One relationship an asset has.

FieldTypeRequiredDescription
directionstringyesWhether it leaves this asset or arrives at it.
directionalitystringyesWhether the relationship reads the same in both directions.
neighbourAssetNeighbouryesThe asset at the other end.
predicatestringyesThe relationship's name.
rankinteger or nullnoThe position of this relationship among those of the same kind, or null when the relationship has no order.
versionintegeryesHow many times this relationship has changed.

AssetNeighbour

The asset at the other end of a relationship.

FieldTypeRequiredDescription
asset_idstringyesIts id.
asset_typestring or nullnoIts type, or null if the id cannot be resolved.
labelstringyesIts display name.
namestring or nullnoIts canonical name, projects/{project}/assets/{asset_id}. A request that takes an asset id in its body or query accepts this name in its place; a URL path takes the bare id. It is null when the id cannot be written in a canonical name.

Example

curl -sS "$API_URL/context/v1/assets/$ASSET_ID" \
  -H "Authorization: Bearer $TOKEN"