Unicat API Reference

Up - API Reference - Home


/api/p/<project gid>/assets/move

Requires JWT.

Move an asset along with its subtree to a new parent.

Request

POST /api/p/<project gid>/assets/move
Authorization: Bearer <JWT>

{
    "asset": "<asset gid>",
    "parent": "<new parent asset gid>",
}

asset is the asset we are moving.
parent is the new parent for the moved asset and must exist.

Success response

Authorization: <JWT>

{
    "success": true,
    "result": {
        "parent": "<parent asset gid>",
        "asset": "<asset gid>"
    },
    "data": {
        "assets": {
            "<asset gid>": {
                "gid": "<asset gid>",
                
            },
            "<parent asset gid>": {
                "gid": "<parent asset gid>",
                
            }
        }
    }
}

result

asset the newly created asset.
parent its parent with updated childcount.

data

assets Asset info with hierarchy, type, name. Unordered. Includes the parent asset with updated childcount and info.

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 - asset or parent asset doesn't exist