Unicat API Reference

Up - API Reference - Home


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

Requires JWT

Copy a class.

All properties are copied, and the class is marked as new. Before use, you must commit it - until then you can keep modifying it.

Note: you cannot copy a new or modified class

The accompanying layout is copied too.

Request

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

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

class the class to copy

Success response

Authorization: <JWT>

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

result

class the copy of the class.

data

classes Class info with name, fields.
layouts Layout info with hierarchy, for the copied class.

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