OpenFolia

Take changes out of a change set

POST
/change-sets/{changeSetId}/reverts

Takes modules, manuals, terms or the configuration back out of the change set: one commit on its branch, made as a save point is, that puts each subject's file back as it is at the change set's base commit (a subject the change set created is deleted), then drops their working copies and releases their locks, with a change-set.revert audit event (and the commit's own, and one lock.release per lock). A subject whose file is unchanged and that has only a working copy makes no commit (meta.commit null). Only the change set's author, while it is a draft, and only for subjects whose lock it holds; scope is checked as for deleting the file at the head and changing it at the base. A configuration put back that content kept at the head no longer fits is 422 config-in-use; a page design the change set added, taken out while the configuration or a manual names it, is 409 design-in-use (#554). Needs the content.edit permission.

Authorization

bearer
headerAuthorizationBearer <JWT>

A service account's token (ccms_sat_…, issued by POST /service-accounts/{id}/tokens), or, for local use and demo mode, the server's shared CCMS_API_TOKEN.

Path Parameters

changeSetId*string

The change set’s ID (a UUID). One that names no change set, malformed or not, is 404.

Formatuuid

Header Parameters

X-Ccms-User?string

Demo mode only (CCMS_AUTH_MODE=demo): the user ID to act as. The bearer token is still required; without demo mode the header is refused (400).

Request Body

application/vnd.api+json
  1. body
data*

Response Body

Taken out.

application/vnd.api+json
  1. response
meta*
Example Request
curl -X POST 'http://localhost:3000/change-sets/497f6eca-6276-4993-bfeb-53cbbbba6f08/reverts' \  -H 'Content-Type: application/vnd.api+json' \  -d '{  "data": {    "type": "Revert",    "attributes": {      "subjects": [        {          "type": "module",          "lang": "string",          "moduleId": "string"        }      ]    }  }}'
Example Response
{  "meta": {    "commit": "string",    "head": "string",    "restored": [      {        "type": "module",        "lang": "string",        "moduleId": "string"      }    ],    "deleted": [      {        "type": "module",        "lang": "string",        "moduleId": "string"      }    ],    "discarded": [      {        "type": "module",        "lang": "string",        "moduleId": "string"      }    ]  }}