Coelevate Documentation
API ReferenceContext Repository

Add assets to a kit

Adds assets of any type to the kit and appends the next kit version.

POST /context/v1/kits/{kit_id}/members

Adds assets of any type to the kit and appends the next kit version. The role follows from each asset's type; an omitted rank appends after the kit's last member of that role. Send the version you read as base_version: a kit that has moved is a 409 kit_moved. An asset already in the kit, one that does not exist, or a kit is refused.

Requires the context:kits scope.

Parameters

ParameterLocationRequiredDescription
kit_idpathyesThe kit's id.

Request body

FieldTypeRequiredDescription
base_versionintegeryesThe kit version you read. A kit that has moved is a 409.
membersarray of KitMemberInputyesThe assets to add. At least one.
rationalestringnoWhy, recorded in the kit's journal.

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
auto_maintainbooleanyesWhether the kit has opted in to automatic upkeep of its members. Off by default.
descriptionstringyesWhat the kit is for.
entriesarray of KitEntryyesThe kit's skills and the tools each binds.
gapsarray of objectyesKnowledge gaps the kit carries.
idstringyesThe kit's id.
ignored_membersarray of KitIgnoredMemberRecordyesMembers the release this read named could not serve, with the reason. Empty when nothing was skipped.
last_changed_bystring or nullnoWho last changed the kit.
last_changed_by_kindstring or nullnoperson or automation.
last_updatedstring or nullnoWhen the kit last changed.
last_updated_bystring or nullnoWhether a person (human) or an automation (ai) last changed the kit.
member_cardsmap of array of AssetCard or nullnoThe short form of each served asset, grouped by asset type.
member_rolesmap of stringyesFor each kind of asset id, the role a kit holds it in.
membersarray of KitMemberRecordyesWhat this version of the kit holds, in serving order.
members_by_typemap of array of stringyesThe ids of the assets the kit served at that release, grouped by asset type.
metadatamap of stringyesThe kit's free-form key-value pairs.
namestring or nullnoThe kit's canonical name, projects/{project}/kits/{id}. A request that takes a kit 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.
project_idstringyesThe project the kit belongs to.
releaseinteger or nullnoThe release this read resolved the kit's assets at.
retiredbooleanyesWhether the kit has been retired.
tagsarray of stringyesThe kit's free-form labels.
titlestringyesThe kit's title.
versionintegeryesThe kit's version. It moves when the kit's fields or its members change.
versionsarray of integer or nullnoEvery version the kit has had. Present when a kit is read.

Shapes

The named shapes used above.

KitMemberInput

An asset to put in a kit, and optionally where.

FieldTypeRequiredDescription
asset_idstringyesThe asset's id. It must exist; a kit cannot hold another kit.
rankinteger or nullnoWhere in the kit's order of that role the asset goes. Leave out to append.
rolestring, one of contains, offers, carries or nullnoLeave out. The role follows from the asset's type.

KitEntry

A skill a kit holds and the tools it binds.

FieldTypeRequiredDescription
skill_idstringyesThe skill's id.
skill_namestringyesThe skill's name.
tool_idsarray of stringyesThe ids of the tools the skill binds.

KitIgnoredMemberRecord

A held asset the kit did not serve at the release the read named, and why.

FieldTypeRequiredDescription
memberKitMemberRecordyesThe held asset.
reasonstringyesretired (a release retired it and nothing replaced it), superseded (a release retired it and the successors below were served in its place) or unpublished (the pinned release does not contain it yet).
successor_idsarray of stringyesThe assets served in its place, in order. Empty unless superseded.

KitMemberRecord

One asset a kit holds.

FieldTypeRequiredDescription
asset_idstringyesThe held asset's id.
asset_kindstringyesThe kind the id names: skill, knowledge, tool, gap, memory, example, pointer or asset.
rankintegeryesIts place within the role. Ranks are sparse, so an asset can be put between two others without renumbering them.
rolestringyesHow the kit holds it: contains, offers or carries.

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.

Example

curl -sS -X POST "$API_URL/context/v1/kits/$KIT_ID/members" \
  -H "Authorization: Bearer $TOKEN" \
  -H "Content-Type: application/json" \
  -d @body.json