Unicat API Reference

Up - API Reference - Home


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

Requires JWT

Revert all changes to a class.

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.

Request

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

{
    "class": "<class gid>"
}

class the class to revert

Success response

Authorization: <JWT>

{
    "success": true,
    "result": {
        "class": "<class gid>"
    },
    "data": {
        "classes": {
            "<class gid>": {
                "gid": "<class gid>",
                
            }
        }
    }
}

result

class the original class, no longer a working copy.

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

data

classes Class info with name, 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