Unicat API Reference

Up - API Reference - Home


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

Requires JWT.

Update an asset's fields.

We can change the name, title, description, or transforms for the asset.

If we update the name, paths and pathnames are updated automatically for the subtree as well.

You can't update the root.

Request

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

{
    "asset": "<asset gid>",
    "name": "modified name",
    "title": {"en": "Modified Title"},
    "description": {"en": "Modified Description"},
    "transforms": {},
}

asset the asset's gid.

optional

These are all optional, but at least one must be provided.

name the name of the asset
title a localized title for the asset, only the specified languages are updated
description a localized description for the asset, only the specified languages are updated
transforms a specialized field, don't update this unless you know exactly what you're doing

Success response

Authorization: <JWT>

{
    "success": true,
    "result": {
        "asset": "<asset gid>"
    },
    "data": {
        "assets": {
            "<asset gid>": {
                "gid": "<asset gid>",
                ,
                "name": "modified name",
                "title": {"en": "Modified Title", "nl": "Titel"},
                "description": {"en": "Modified Description", "nl": "Omschrijving"},
                
            }
        }
    }
}

result

asset the updated asset.

data

assets Asset info with hierarchy, type, name. Unordered.

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 doesn't exist or is root