Unicat API Reference

Up - API Reference - Home


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

Requires JWT

Copy a definition.

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

Note: you cannot copy a new, modified, or extended definition

The accompanying layout is copied too.

Request

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

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

definition the definition to copy

Success response

Authorization: <JWT>

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

result

definition the copy of the definition.

data

definitions Definition info with name, classes, fields.
layouts Layout info with hierarchy, for the copied definition.

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