Coelevate Documentation
API ReferenceContext Repository

Get several assets by id

Returns the named assets in one call, of whatever types their ids name.

GET /context/v1/assets/by-id

Returns the named assets in one call, of whatever types their ids name. Pass the ids as a comma-separated list in asset_ids, at most 500 per call. Use it when you already hold ids, for example from a search or a link, and want their bodies without one request each. An id the project does not hold is left out of assets and listed in not_found.

Requires the context:read scope.

Parameters

ParameterLocationRequiredDescription
asset_idsquerynoComma-separated asset ids or canonical names (projects/{project}/assets/{id}), at most 500.

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
assetsarray of AssetsByIdEntryyesThe assets the project holds, in no particular order.
not_foundarray of stringyesThe ids that were asked for and are not in assets.

Shapes

The named shapes used above.

AssetsByIdEntry

One asset returned by id.

FieldTypeRequiredDescription
assetobjectyesThe asset's whole body; its fields depend on the asset's type.
asset_typestringyesThe asset's type.
declared_typeobject or nullnoFor an asset of a type the project declared: that type's card rules, content schema and, when it is a table, its table spec.
namestring or nullnoThe asset's canonical name, projects/{project}/assets/{id}, where {id} is the id inside asset. 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.

Example

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