Unicat API Reference

Up - API Reference - Home


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

Requires JWT

Revert all changes to a field.

We used a copy to keep track of the changes; we delete the copy and return the original.

Request

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

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

field the field to revert

Success response

Authorization: <JWT>

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

result

field the original field, no longer a working copy.

Note: if you revert a newly created field, it is removed and you'll get null for the field result - and no data either.

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