Unicat API Reference

Up - API Reference - Home


/api/p/<project gid>/fields/save_as_new

Requires JWT

Save all changes to the field as a new, original field.

We used a copy to keep track of the changes; we now make those changes official.

Afterwards, the field is no longer a working copy.

Note: if there are no changes, nothing is saved either.

Request

POST /api/p/<project gid>/fields/save_as_new
Authorization: Bearer <JWT>

{
    "field": "<field gid>"
}

field the field to save as new

Success response

Authorization: <JWT>

{
    "success": true,
    "result": {
        "field": "<field gid>"
    },
    "data": {
        "fields": {
            "<field gid>": {}
        }
    }
}

result

field the newly saved field.

data

fields Field info with name, type, options.

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