Merge the change request
Publishes the approved ops: writes their bodies and makes the next release, which is what agents are served from then on.
POST /context/v1/changeset/merge
Publishes the approved ops: writes their bodies and makes the next release, which is what agents are served from then on. A merge touches assets only; a kit is written separately and directly, with the kits scope, and a merge never changes one. Ops nobody decided are not published; they carry over to a new changeset opened on the release this merge makes, and the response names it. Rejected ops stay on the merged changeset as the record. Nothing approved is a 422. The merge is a 409 when the changeset moved since you reviewed it (send expected_revision), or when another release was published after the changeset opened, in which case the changeset is settled invalidated and nothing is published. Needs the review scope.
Requires the context:review scope.
Request body
| Field | Type | Required | Description |
|---|---|---|---|
changeset_id | string or null | no | The changeset you mean to merge. Omit for the open one. |
expected_revision | integer or null | no | The changeset revision you reviewed. When it has moved the merge is a 409. |
provenance | object or null | no | Who merged and why, for the revision journal. Omit to have it filled in from the key. |
tags | array of string or null | no | Release tags to put on the release this merge makes. |
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 |
|---|---|---|---|
carried_op_ids | array of string | yes | The undecided ops that moved to that changeset. |
carried_to_changeset_id | string or null | no | The changeset that took over the ops nobody had decided, or null when there were none. |
changed_asset_ids | array of string | yes | The assets the merge wrote or changed. |
changeset_id | string | yes | The changeset that was merged. |
conflicted_op_ids | array of string | yes | Carried ops that no longer apply cleanly and need review again. |
deleted_asset_ids | array of string | yes | The assets the merge retired. |
object_versions | map of integer | yes | The version of every object as the new release publishes it. |
ops_published | integer | yes | How many approved ops were published. |
release | integer | yes | The release the merge made. |
Example
A request body (ids and values are placeholders), saved as body.json:
{
"expected_revision": 3,
"tags": [
"production"
]
}curl -sS -X POST "$API_URL/context/v1/changeset/merge" \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d @body.json