Coelevate Documentation
API ReferenceContext Repository

Change a gap

Changes the gap's kind, detail, evidence, origin, tags or metadata and appends the next version.

PATCH /context/v1/gaps/{gap_id}

Changes the gap's kind, detail, evidence, origin, tags or metadata and appends the next version. Send the version you read as base_version: a gap that has moved is a 409 gap_moved carrying the current version. Fields you omit are unchanged. A request that changes nothing, a change onto the words of another gap, or a change to a retired gap is refused.

Requires the context:gaps scope.

Parameters

ParameterLocationRequiredDescription
gap_idpathyesThe gap's id.

Request body

FieldTypeRequiredDescription
base_versionintegeryesThe gap version you read. A gap that has moved is a 409.
detailstring or nullnoA sharper description of what is missing.
evidencestring or nullnoNew evidence text.
kindstring or nullnoA new kind label.
metadatamap of string or nullnoThe complete new key-value pairs.
origin_context_idstring or nullnoA different run it was discovered in.
rationalestringnoWhy, recorded in the gap's journal.
tagsarray of string or nullnoThe complete new tag list.

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
closed_releaseinteger or nullnoThe release that covered the gap. Empty while the gap is still open.
content_keystringyesWhat makes two reports one open debt: a digest of the kind and the detail.
detailstringyesWhat is missing and what it was needed for.
evidencestringyesThe excerpt or reasoning that surfaced it.
idstringyesThe gap's id.
kindstringyesA short label for the sort of debt: missing_tool, missing_skill, missing_knowledge or any other short label.
kitsarray of GapKitRecordyesThe kits that carry this gap.
last_changed_bystring or nullnoWho last changed the gap.
last_changed_by_kindstring or nullnoperson or automation.
last_updatedstring or nullnoWhen the gap last changed.
last_updated_bystring or nullnoWhether the last change was made by a person (human) or by an automation (ai).
metadatamap of stringyesThe gap's free-form key-value pairs.
namestring or nullnoThe gap's canonical name, projects/{project}/gaps/{id}. It is null when the id cannot be written in a canonical name.
opened_releaseinteger or nullnoThe context release the gap was opened under. Provenance only: a gap is served from live state.
origin_context_idstring or nullnoThe recorded run it was discovered in.
retiredbooleanyesWhether the gap has been closed.
tagsarray of stringyesThe gap's free-form labels.
versionintegeryesThe gap's version. It moves each time the gap is changed, retired or reverted.

Shapes

The named shapes used above.

GapKitRecord

A kit that carries a gap.

FieldTypeRequiredDescription
idstringyesThe kit's id.
titlestringyesThe kit's title.
versionintegeryesThe kit version that holds the gap.

Example

curl -sS -X PATCH "$API_URL/context/v1/gaps/$GAP_ID" \
  -H "Authorization: Bearer $TOKEN" \
  -H "Content-Type: application/json" \
  -d @body.json