Unicat API Reference

Up - API Reference - Home


/api/p/<project gid>/definitions/revert

Requires JWT

Revert all changes to a definition.

We used a copy to keep track of the changes; we delete the copy and return the original.

This will also revert the accompanying layout.

Note: you cannot revert an unmodified definition.

Note: you cannot revert an extended definition (use the records/definition api).

Request

POST /api/p/<project gid>/definitions/revert
Authorization: Bearer <JWT>

{
    "definition": "<definition gid>"
}

definition the definition to revert

Success response

Authorization: <JWT>

{
    "success": true,
    "result": {
        "definition": "<definition gid>"
    },
    "data": {
        "definitions": {
            "<definition gid>": {
                "gid": "<definition gid>",
                
            }
        }
    }
}

result

definition the original definition, no longer a working copy.

Note: if you revert a newly created definition, it is removed and you'll get null for the definition result - and no data either.

data

definitions Definition info with name, classes, fields.

Error responses

400 Bad request - missing parameters or wrong type or value
401 Unauthorized - missing or expired JWT
403 Forbidden - not a member of this project
422 Unprocessable entity - can't work with this item