Sync a field's list relationships

Replaces a custom field's list relationships with exactly the given set: relationships to the listed lists are created where missing, and every other relationship of the field, including an all-lists relid 0 relationship, is deleted. The new relationships are created first, in one transaction; the deletions are then applied separately, row by row, so a failure during the deletions leaves the already-created relationships and completed deletions in place and the field's relationships partially replaced. The response's fieldRels array holds only the newly created relationships; ids of deleted relationships are returned in meta.deletedFieldRelIds, and meta is omitted when nothing was deleted. lists must contain at least one real list id: entries of 0 are ignored, and an empty or all-zero lists fails with 422. To relate a field to every list, use POST /fieldRel/syncExcept with an empty lists array, or POST /fieldRels with relid 0. 404 if the field does not exist. List ids are not checked against existing lists. No user permission is checked beyond API access. POST only; other methods get 405.

Body Params
integer
required

ID of the custom field definition whose list relationships are replaced.

lists
array of integers
required

List ids. Entries of 0 are ignored.

lists*
Responses

Language
Credentials
Header
URL
LoadingLoading…
Response
Choose an example:
application/json