Unicat API Reference

Up - API Reference - Home


/api/p/<project gid>/records/definition/transfer_to

Requires JWT.

Works on both extension groups and base-definition groups.

This group is transferred to the target group. Afterwards, unused extended definition are cleaned up.

Note: Field data is dropped for fields that do not exist in the target extension group.

Cannot be used from a linked record; use the canonical.

Request

POST /api/p/<project gid>/records/definition/transfer_to
Authorization: Bearer <JWT>

{
    "record": "<record gid>",
    "target_definition": "<extended definition gid>"
}

record the record's gid
target_definition the target extended definition's gid

optional

language return data for this (project) language.
languages return data for these (project) languages.

If you request language and/or languages, you get the records' title and fields for the combined set. If you request neither, you'll get all available languages.

Success response

Authorization: <JWT>

{
    "success": true,
    "result": {
        "record": "<record gid>",
        "definition": "<target extended definition gid>"
    },
    "data": {
        "definitions": {
            "<target extended definition gid>": {
                "gid": "<target extended definition gid>",
                "is_extended": true,
                …
            }
        },
        "records": {
            "<record gid>": {
                "gid": "<record gid>",
                "definition": "<target extended definition gid>",
                …
            }
        }
    }
}

result

record the subject record (now on the target extended definition)
definition the target extended definition

Other records that had the same source extended definition are also reassigned; they are not included in the response.

data

definitions Definition info with name, classes, fields.
records The subject record with hierarchy, definition, field values.
See Deferred loading of extended definitions.

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 - linked record, unknown extended definition, or invalid target