Unicat API Reference

Up - API Reference - Home


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

Requires JWT

Copy a field.

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

Note: you cannot copy a new or modified field

Request

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

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

field the field to copy

Success response

Authorization: <JWT>

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

result

field the copy of the 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