Unicat API Reference

Up - API Reference - Home


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

Requires JWT

Commit a field.

We used a copy to keep track of the changes; now we need to apply those changes to the original, and remove the copy.

Afterwards, the field is no longer a working copy. All places where this field is used will now work with the newly committed field - this includes records whose field values must now adhere to the changed field, potentially changing data.

Note: record data can be changed if you commit a field!

Request

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

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

field the field to commit

Success response

Authorization: <JWT>

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

result

field the field is no longer a working copy.

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