Skip to content

Object Classes

This technical design describes implementation and API for Object Classes.

POST /api/object-classes/

Creates object class.

Permissions

Requires authentication and object_classes.create permission.

Request

  • Body parameters
KeyTypeNotes
namestring
descriptionstring
display_configurationJsonUI configuration
custom_componentsJsonCustom Components used in UI configuration.
  • Headers
Content-Type: application/json
Authorization: JWT access_token
  • Schema
json
POST /api/object-classes/

{
    "name": "class_name",
    "description": "Some class description",
    "display_configuration": {"key": "value"},
    "custom_components": [
      {"component_id": 1, "used_in": "object_class_create_forms" }, 
      {"component_id": 2, "used_in": "object_class_summary_forms" }
    ]
}

Validations

  • name
    • is string
    • is required
    • is unique
    • max length is 100
    • first sign of name must be a letter.
  • description
    • is string
    • is optional
    • max length is 500
  • display_configuration
    • is a Json
    • is optional
    • has not duplicated keys
  • custom_components
    • is a Json
    • is optional
    • component_id
      • is integer
      • is required
      • is a valid component id
    • used_in
      • is string
      • is required
      • is a valid form type

Restrictions

  • Up to 10000 Object Classes can be added, limit is configurable per build.

Response

KeyTypeNotes
idpkAutomatically generated by the backend.
namestringName of the object class
descriptionstringDescription of the object class
identifierObjectObject record identifier
display_configurationJsonObject class UI configuration
created_atdatetime
created_byuser
modified_atdatetime
modified_byuser
record_countintNumber of records for a given Object Class
object_modelsArrayList of Object Models ids in which a given class is used
_meta.permissionsObjectObject describing permissions.

Response identifier object

KeyTypeNotes
idpk
labelstring
aliasstring
typeenumField type
is_uniquebool
is_identifierbool
has_duplicatesbool
orderint
extrasJson
  • Successful status 201 Created
  • Response body:
json
{
    "id": 18,
    "name": "class_name",
    "description": "Some class description",
    "identifier": {
        "id": null,
        "label": "ALX ID",
        "alias": "id",
        "type": "int",
        "is_unique": false,
        "is_identifier": false,
        "has_duplicates": false,
        "order": null,
        "extras": {}
    },
    "display_configuration": {
        "key": "value"
    },
    "created_at": "2023-08-23T14:52:14.172073+02:00",
    "created_by": {
        "id": 2,
        "first_name": "ALX",
        "last_name": "Developer",
        "username": "alx.dev@autologyx.com",
        "company_name": "",
        "is_deleted": false,
        "account_type": "super_admin"
    },
    "modified_at": "2023-08-23T14:52:14.172098+02:00",
    "modified_by": {
        "id": 2,
        "first_name": "ALX",
        "last_name": "Developer",
        "username": "alx.dev@autologyx.com",
        "company_name": "",
        "is_deleted": false,
        "account_type": "super_admin"
    },
    "record_count": 0,
    "object_models": [],
    "_meta": {
        "permissions": {
            "list": true,
            "view": true,
            "create": true,
            "edit": true,
            "delete": true,
            "edit_owners": true,
            "edit_perm_sets": true,
            "object_records": {
                "create": true
            },
            "object_class_forms": {
                "list": true,
                "view": true,
                "edit": true,
                "create": true,
                "delete": true
            }
        }
    }
}

Errors

CauseResponse status codeResponse message
name missing400 Bad Request"name": ["This field is required."]
name is empty400 Bad Request"name": [ "This field may not be blank." ]
name is null400 Bad Request"name": [ "This field may not be null." ]
name not unique400 Bad Request"name": ["This field must be unique."]
name too long400 Bad Request"name": ["Ensure this field has no more than 100 characters."]
first sign not a letter400 Bad Request"name": ["First sign of name must be a letter."]
description too long400 Bad Request"description": ["Ensure this field has no more than 500 characters."]
description is null400 Bad Request"description": ["This field may not be null."]
key is duplicated400 Bad Request"display_configuration": ["JSON key "key" is duplicated."]
template_file is null400 Bad Request"template_file": [ "This field may not be null." ]
template_file not docx400 Bad Request"template_file": ["Invalid file type."]
custom_components.component missing400 Bad Request"custom_components": {"component": ["This field is required."]}
custom_components.component is empty400 Bad Request"custom_components": {"component": ["This field may not be blank."]}
custom_components.component is null400 Bad Request"custom_components": {"component": ["This field may not be null."]}
custom_components.component doesn't exists400 Bad Request"custom_components": {"component": ["Invalid pk "99900" - object does not exist."]}
Insufficient permissions403 Forbidden"detail": "You do not have permission to perform this action."

OPTIONS /api/object-classes/

Permissions

Requires authentication only.

Request

  • Headers
Request Method: OPTIONS
Content-Type: application/json
Location: /api/object-classes/
Authorization: JWT access_token

Response

  • Successful status 200 OK
  • Response body:
json
{
    "list": {
        "columns": [
            {
                "alias": "id",
                "type": "int",
                "predicates": [
                    "exact",
                    "gt",
                    "gte",
                    "lt",
                    "lte",
                    "range"
                ],
                "sort_ok": true
            },
            {
                "alias": "name",
                "type": "string",
                "predicates": [
                    "exact",
                    "iexact",
                    "contains",
                    "icontains",
                    "startswith",
                    "istartswith",
                    "endswith",
                    "iendswith"
                ],
                "sort_ok": true
            },
            {
                "alias": "description",
                "type": "string",
                "predicates": [],
                "sort_ok": false
            },
            {
                "alias": "created_at",
                "type": "datetime",
                "predicates": [
                    "exact",
                    "gt",
                    "gte",
                    "lt",
                    "lte",
                    "range"
                ],
                "sort_ok": true
            },
            {
                "alias": "created_by",
                "type": "user",
                "predicates": [
                    "exact",
                    "in"
                ],
                "sort_ok": false,
                "autocomplete": "/api/users/autocomplete/?text__icontains="
            },
            {
                "alias": "modified_at",
                "type": "datetime",
                "predicates": [
                    "exact",
                    "gt",
                    "gte",
                    "lt",
                    "lte",
                    "range"
                ],
                "sort_ok": true
            },
            {
                "alias": "modified_by",
                "type": "user",
                "predicates": [
                    "exact",
                    "in"
                ],
                "sort_ok": false,
                "autocomplete": "/api/users/autocomplete/?text__icontains="
            },
            {
                "alias": "owners",
                "type": "owners",
                "predicates": [
                    "exact",
                    "in",
                    "isnull"
                ],
                "sort_ok": false
            },
            {
                "alias": "record_count",
                "type": "int",
                "predicates": [],
                "sort_ok": false
            }
        ]
    },
    "details": {
        "schema": [
            {
                "alias": "name",
                "type": "string",
                "required": true,
                "validators": [
                    {
                        "type": "min_length",
                        "length": 1
                    },
                    {
                        "type": "max_length",
                        "length": 100
                    }
                ]
            },
            {
                "alias": "description",
                "type": "string",
                "required": false,
                "validators": [
                    {
                        "type": "max_length",
                        "length": 500
                    }
                ]
            }
        ]
    },
    "restrictions": {
        "limit_items": 10000
    }
}

GET /api/object-classes/

Returns list of Object Classes.

Permissions

Requires authentication and object_classes.list permission.

Request example

  • Headers
Request Method: GET
Content-Type: application/json
Location: /api/object-classes/
Authorization: JWT access_token

Response

KeyTypeNotes
limitint
offsetint
total_countintTotal number of results visible to the user (based on permissions).
filtered_countintNumber of results visible to the user (based on permissions) with filters applied.
nexturlNext page URL (null if there is no next page)
previousurlPrevious page URL (null if there is no previous page)
resultsArrayList of results. Described in the next table.

Response results array

KeyTypeNotes
idpkAutomatically generated by the backend.
namestringName of the object class
descriptionstringDescription of the object class
created_atdatetime
created_byuser
modified_atdatetime
modified_byuser
record_countintNumber of records for a given Object Class
has_system_fieldsbool
ownersObject
_meta.permissionsObject

Response owners object

KeyTypeNotes
total_numberint
firstuser
  • Successful status 200 OK
  • Response body schema
json
{
    "limit": 50,
    "offset": 0,
    "filtered_count": 2,
    "total_count": 2,
    "next": null,
    "previous": null,
    "results": [
        {
            "id": 17,
            "name": "123456",
            "description": "",
            "created_at": "2022-11-10T14:32:14.645313+01:00",
            "created_by": {
                "id": 2,
                "first_name": "ALX",
                "last_name": "Developer",
                "username": "alx.dev@autologyx.com",
                "company_name": "",
                "is_deleted": false,
                "account_type": "super_admin"
            },
            "modified_at": "2022-11-10T14:32:14.645340+01:00",
            "modified_by": {
                "id": 2,
                "first_name": "ALX",
                "last_name": "Developer",
                "username": "alx.dev@autologyx.com",
                "company_name": "",
                "is_deleted": false,
                "account_type": "super_admin"
            },
            "has_system_fields": false,
            "owners": {
                "total_number": 1,
                "first": {
                    "id": 2,
                    "first_name": "ALX",
                    "last_name": "Developer",
                    "username": "alx.dev@autologyx.com",
                    "company_name": "",
                    "is_deleted": false,
                    "account_type": "super_admin"
                }
            },
            "record_count": 0,
            "_meta": {
                "permissions": {
                    "list": true,
                    "view": true,
                    "create": true,
                    "edit": true,
                    "delete": true,
                    "edit_owners": true,
                    "edit_perm_sets": true
                }
            }
        },
        {
            "id": 18,
            "name": "class_name",
            "description": "Some class description",
            "created_at": "2023-08-23T14:52:14.172073+02:00",
            "created_by": {
                "id": 2,
                "first_name": "ALX",
                "last_name": "Developer",
                "username": "alx.dev@autologyx.com",
                "company_name": "",
                "is_deleted": false,
                "account_type": "super_admin"
            },
            "modified_at": "2023-08-23T14:52:14.172098+02:00",
            "modified_by": {
                "id": 2,
                "first_name": "ALX",
                "last_name": "Developer",
                "username": "alx.dev@autologyx.com",
                "company_name": "",
                "is_deleted": false,
                "account_type": "super_admin"
            },
            "has_system_fields": true,
            "owners": {
                "total_number": 1,
                "first": {
                    "id": 2,
                    "first_name": "ALX",
                    "last_name": "Developer",
                    "username": "alx.dev@autologyx.com",
                    "company_name": "",
                    "is_deleted": false,
                    "account_type": "super_admin"
                }
            },
            "record_count": 10,
            "_meta": {
                "permissions": {
                    "list": true,
                    "view": true,
                    "create": true,
                    "edit": true,
                    "delete": true,
                    "edit_owners": true,
                    "edit_perm_sets": true
                }
            }
        }
    ]
}

Sorting

ParameterExampleNotes
id/api/object-classes/?ordering=idAscending
id/api/object-classes/?ordering=-idDescending (-)
name/api/object-classes/?ordering=nameAscending
name/api/object-classes/?ordering=-nameDescending (-)
created_at/api/object-classes/?ordering=created_atAscending
created_at/api/object-classes/?ordering=-created_atDescending (-)
modified_at/api/object-classes/?ordering=modified_atAscending
modified_at/api/object-classes/?ordering=-modified_atDescending (-)

Filtering

Please check ALX API standards for predicates available per type.

ParameterType
idint
namestring
created_atdatetime
created_byuser
modified_atdatetime
modified_byuser
ownersuser

GET /api/object-classes/id

Returns single Object Class by id.

Permissions

Requires authentication and object_classes.view permission.

URL parameters

KeyTypeNotes
idid

Request example

  • Headers
Request Method: GET
Content-Type: application/json
Location: /api/object-classes/18/
Authorization: JWT access_token

Response

KeyTypeNotes
idpkAutomatically generated by the backend.
namestringName of the object class
descriptionstringDescription of the object class
identifierObjectObject record identifier
display_configurationJsonObject class UI configuration
created_atdatetime
created_byuser
modified_atdatetime
modified_byuser
record_countintNumber of records for a given Object Class
object_modelsArrayList of Object Models ids in which a given class is used
has_system_fieldsbool
_meta.permissionsObjectObject describing permissions.

Response identifier object

KeyTypeNotes
idpk
labelstring
aliasstring
typeenumField type
is_uniquebool
is_identifierbool
has_duplicatesbool
orderint
descriptionstring
extrasJson
  • Successful status 200 OK
  • Response body schema:
json
{
    "id": 18,
    "name": "class_name",
    "description": "Some class description",
    "identifier": {
        "id": null,
        "label": "ALX ID",
        "alias": "id",
        "type": "int",
        "is_unique": false,
        "is_identifier": false,
        "has_duplicates": false,
        "order": null,
        "description": "",
        "extras": {}
    },
    "display_configuration": {
        "key": "value"
    },
    "created_at": "2023-08-23T14:52:14.172073+02:00",
    "created_by": {
        "id": 2,
        "first_name": "ALX",
        "last_name": "Developer",
        "username": "alx.dev@autologyx.com",
        "company_name": "",
        "is_deleted": false,
        "account_type": "super_admin"
    },
    "modified_at": "2023-08-23T14:52:14.172098+02:00",
    "modified_by": {
        "id": 2,
        "first_name": "ALX",
        "last_name": "Developer",
        "username": "alx.dev@autologyx.com",
        "company_name": "",
        "is_deleted": false,
        "account_type": "super_admin"
    },
    "has_system_fields": false,
    "record_count": 0,
    "object_models": [],
    "_meta": {
        "permissions": {
            "list": true,
            "view": true,
            "create": true,
            "edit": true,
            "delete": true,
            "edit_owners": true,
            "edit_perm_sets": true,
            "object_records": {
                "create": true
            },
            "object_class_forms": {
                "list": true,
                "view": true,
                "edit": true,
                "create": true,
                "delete": true
            }
        }
    }
}

Errors

ErrorResponse codeMessage
Insufficient permissions403 Forbidden"detail": "You do not have permission to perform this action."
Sequence with "id" does not exist404 Not Found"detail": "Not found."

PATCH /api/object-classes/id/

Updates single Object Class.

Permissions

Requires authentication and sobject_classes.edit permission.

Allowed parameters

KeyTypeNotes
namestring
descriptionstring
display_configurationJsonUI configuration
custom_componentsJsonCustom Components used in UI configuration.

Any parameter not listed above are silently ignored if passed.

Request

  • Headers
Request Method: PATCH
Content-Type: application/json
Location: /api/object-classes/1/
Authorization: JWT access_token
  • Sample request body
json
{
    "name": "class_name",
    "description": "Some class description",
    "display_configuration": {"key": "value"},
    "custom_components": [
      {"component_id": 1, "used_in": "object_class_create_forms }, 
      {"component_id": 2, "used_in": "object_class_summary_forms }
    ]
}

Response

KeyTypeNotes
idpkAutomatically generated by the backend.
namestringName of the object class
descriptionstringDescription of the object class
identifierObjectObject record identifier
display_configurationJsonObject class UI configuration
created_atdatetime
created_byuser
modified_atdatetime
modified_byuser
record_countintNumber of records for a given Object Class
object_modelsArrayList of Object Models ids in which a given class is used
_meta.permissionsObjectObject describing permissions.

Response identifier object

KeyTypeNotes
idpk
labelstring
aliasstring
typeenumField type
is_uniquebool
is_identifierbool
has_duplicatesbool
orderint
extrasJson
  • Successful status 200 OK
  • Response body schema:
json
{
    "id": 1,
    "name": "class_name",
    "description": "Some class description",
    "identifier": {
        "id": null,
        "label": "ALX ID",
        "alias": "id",
        "type": "int",
        "is_unique": false,
        "is_identifier": false,
        "has_duplicates": false,
        "order": null,
        "extras": {}
    },
    "display_configuration": {
        "key": "value"
    },
    "created_at": "2023-08-23T14:52:14.172073+02:00",
    "created_by": {
        "id": 2,
        "first_name": "ALX",
        "last_name": "Developer",
        "username": "alx.dev@autologyx.com",
        "company_name": "",
        "is_deleted": false,
        "account_type": "super_admin"
    },
    "modified_at": "2023-08-23T14:52:14.172098+02:00",
    "modified_by": {
        "id": 2,
        "first_name": "ALX",
        "last_name": "Developer",
        "username": "alx.dev@autologyx.com",
        "company_name": "",
        "is_deleted": false,
        "account_type": "super_admin"
    },
    "record_count": 0,
    "object_models": [],
    "_meta": {
        "permissions": {
            "list": true,
            "view": true,
            "create": true,
            "edit": true,
            "delete": true,
            "edit_owners": true,
            "edit_perm_sets": true,
            "object_records": {
                "create": true
            },
            "object_class_forms": {
                "list": true,
                "view": true,
                "edit": true,
                "create": true,
                "delete": true
            }
        }
    }
}

Errors

CauseResponse status codeResponse message
name missing400 Bad Request"name": ["This field is required."]
name is empty400 Bad Request"name": [ "This field may not be blank." ]
name is null400 Bad Request"name": [ "This field may not be null." ]
name not unique400 Bad Request"name": ["This field must be unique."]
name too long400 Bad Request"name": ["Ensure this field has no more than 100 characters."]
first sign not a letter400 Bad Request"name": ["First sign of name must be a letter."]
description too long400 Bad Request"description": ["Ensure this field has no more than 500 characters."]
description is null400 Bad Request"description": ["This field may not be null."]
key is duplicated400 Bad Request"display_configuration": ["JSON key "key" is duplicated."]
template_file is null400 Bad Request"template_file": [ "This field may not be null." ]
template_file not docx400 Bad Request"template_file": ["Invalid file type."]
custom_components.component missing400 Bad Request"custom_components": {"component": ["This field is required."]}
custom_components.component is empty400 Bad Request"custom_components": {"component": ["This field may not be blank."]}
custom_components.component is null400 Bad Request"custom_components": {"component": ["This field may not be null."]}
custom_components.component doesn't exists400 Bad Request"custom_components": {"component": ["Invalid pk "99900" - object does not exist."]}
Insufficient permissions403 Forbidden"detail": "You do not have permission to perform this action."

DELETE /api/object-classes/object_class_id/

Remove a Object Class with checking if no used anywhere.

Permissions

Requires authentication and object_class.delete permission.

Request example

  • Headers
Request Method: DELETE
Location: /api/object-classes/1/
Authorization: JWT access_token

Response example

  • Status 204 No Content
  • Body

Errors

ErrorResponse codeMessage
Object class in use400 Forbidden"detail": "Class is in use by Sequences."
Insufficient permissions403 Forbidden"detail": "You do not have permission to perform this action."
Task template does not exist404 Forbidden"detail": "Not found"

GET /api/object-classes/autocomplete/

List of Object Classes based on query parameters for autocomplete widgets.

Permissions

Requires authentication and object_classes.list permission.

Request example

  • Headers
Request Method: GET
Location: /api/object-classes/autocomplete/
Authorization: JWT access_token

Response

KeyTypeNotes
limitint
offsetint
total_countintTotal number of forms visible to the user (based on permissions).
filtered_countintNumber of forms visible to the user (based on permissions) with filters applied.
nextURL / nullNext page URL (null if there is no next page)
previousURL / nullPrevious page URL (null if there is no previous page)
resultsArrayDescribed in the next table.

Response results array

KeyTypeNotes
valueintObject Class ID
textstrObject Class name

Response example

  • Status 200 OK
  • Body
json
{
  "limit": 100,
  "offset": 0,
  "filtered_count": 1,
  "total_count": 20,
  "next": null,
  "previous": null,
  "results": [
    {
      "value": 12,
      "tesst": "Some class name"
    }
  ]
}

Sorting

ParameterExampleNotes
name{build}/api/object-classes/?ordering=nameAscending
name{build}/api/object-classes/?ordering=-nameDescending (-)
text{build}/api/object-classes/?ordering=textAscending
text{build}/api/object-classes/?ordering=-textDescending (-)

Filtering

For the full description of standard predicates see ALX API standards - Developers guide.

ParameterPredicatesExampleValues
textstandard string{build}/api/object-classes/?text__icontains=template

Errors

ErrorResponse codeMessage
Wrong ordering value400 Bad Request"ordering": ["Select a valid choice. {value} is not one of the available choices."]

GET /api/object-classes/autocomplete/owned/

List of Object Classes owned by user based on query parameters for autocomplete widgets.

Permissions

Requires authentication and object_classes.list permission.

Request example

  • Headers
Request Method: GET
Location: /api/object-classes/autocomplete/owned/
Authorization: JWT access_token

Response

KeyTypeNotes
limitint
offsetint
total_countintTotal number of forms visible to the user (based on permissions).
filtered_countintNumber of forms visible to the user (based on permissions) with filters applied.
nextURL / nullNext page URL (null if there is no next page)
previousURL / nullPrevious page URL (null if there is no previous page)
resultsArrayDescribed in the next table.

Response results array

KeyTypeNotes
valueintObject Class ID
textstrObject Class name

Response example

  • Status 200 OK
  • Body
json
{
  "limit": 100,
  "offset": 0,
  "filtered_count": 1,
  "total_count": 20,
  "next": null,
  "previous": null,
  "results": [
    {
      "value": 12,
      "tesst": "Some class name"
    }
  ]
}

Sorting

ParameterExampleNotes
name{build}/api/object-classes/?ordering=nameAscending
name{build}/api/object-classes/?ordering=-nameDescending (-)
text{build}/api/object-classes/?ordering=textAscending
text{build}/api/object-classes/?ordering=-textDescending (-)

Filtering

For the full description of standard predicates see ALX API standards - Developers guide.

ParameterPredicatesExampleValues
textstandard string{build}/api/object-classes/?text__icontains=template

Errors

ErrorResponse codeMessage
Wrong ordering value400 Bad Request"ordering": ["Select a valid choice. {value} is not one of the available choices."]

GET /api/object-classes/object_class_id/usage/

Permissions

Requires authentication and object_class.view permission.

Request example

  • Headers
Request Method: GET
Location: /api/object-classes/1/usage/
Authorization: JWT access_token

Response

KeyTypeNotes
num_of_recordsint
sequencesarray
num_of_sequencesint
task_group_templatesarray
num_of_task_group_templatesint
task_templatesarray
num_of_task_templatesint
object_modelsarray
num_of_object_modelsint
num_of_upload_componentsint

Response sequences array

KeyTypeNotes
idintSequence id
namestrName of sequence

Response task_group_templates array

KeyTypeNotes
idintTask Group Template id
namestrName of Task Group Template

Response task_templates array

KeyTypeNotes
idintTask Template id
namestrName of Task Template

Response object_models array

KeyTypeNotes
idintObject Model id
namestrName of Object Model

Response example

  • Status 200 OK
  • Body
json
{
    "num_of_records": 0,
    "sequences": [
        {
            "id": 1,
            "name": "sequence1"
        },
        {
            "id": 7,
            "name": "sequence_test"
        }
    ],
    "num_of_sequences": 2,
    "task_group_templates": [],
    "num_of_task_group_templates": 0,
    "task_templates": [],
    "num_of_task_templates": 0,
    "object_models": [
        {
            "id": 17,
            "name": "some_name"
        }
    ],
    "num_of_object_models": 1,
    "num_of_upload_components": 1
}

Errors

ErrorResponse codeMessage
id is invalid404 Bad Request'detail': "Not found."
Unauthorized API call403 Bad Request'detail': "You do not have permission to perform this action."

POST /api/object-classes/object_class_id/fields/

Creates object class field.

Permissions

Requires authentication and object_classes.edit permission.

Request

  • Body general parameters
KeyTypeNotes
aliasstring
typeenum
labelstring
is_identifierbool
is_uniqueboolField value is unique in Object Class scope
is_systembool
orderint
descriptionstring
  • Additional body parameters for int type
KeyTypeNotes
default_valueint
min_valueint
max_valueint
  • Additional body parameters for float type
KeyTypeNotes
default_valuefloat
min_valuefloat
max_valuefloat
  • Additional body parameters for bool type
KeyTypeNotes
required_valuebool
  • Additional body parameters for string type
KeyTypeNotes
max_lengthint
  • Additional body parameters for enum type
KeyTypeNotes
optionsenum
default_valuestring
  • Additional body parameters for set type
KeyTypeNotes
optionsenum
min_valuesint
max_valuesint
  • Additional body parameters for document type
KeyTypeNotes
max_num_of_filesenum
  • Additional body parameters for user type
KeyTypeNotes
optionsenum
min_users_valuesint
max_users_valuesint
min_groups_valuesint
max_groups_valuesint
allow_syncbool
allow_members_selectionbool
    • Parameter options array
KeyTypeNotes
userslist
user_groupslist
  • Headers
Content-Type: application/json
Authorization: JWT access_token
  • Schema
json
POST /api/object-classes/1/fields/

{
    "alias": "some_field",
    "type": "int",
    "min_value": 4,
    "label": "field description",
    "is_identifier": false,
    "order": 3
}

Validations

  • General
  • alias
    • is string
    • is required
    • is not null
    • is not blank
    • is unique in the Object Class scope
    • max length is 50
    • first sign is not _
  • type
    • is one of: int, float, bool, string, enum, set, email, phone, date, time, datetime, url, json, document, user
    • is required
  • label
    • is string
    • is required
    • is not null
    • is not blank
    • is unique in the Object Class scope
    • max length is 100
  • is_identifier
    • is bool
  • is_unique
    • is bool
  • is_system
    • is bool
  • order
    • is int
    • is greater or equal 0
  • description
    • is string
    • is not null
    • max length is 500
  • int type
  • default_value
    • is int
    • is between min_value and max_value
  • max_value
    • is int
    • is greater or equal than min_value
  • min_value
    • is int
    • is less or equal than max_value
  • float type
  • default_value
    • is float
    • is between min_value and max_value
  • max_value
    • is float
    • is greater or equal than min_value
  • min_value
    • is float
    • is less or equal than max_value
  • bool type
  • required_value
    • is bool
  • string type
  • max_length
    • is int
    • is less or equal than 255 if is_identifier is true
    • is less or equal 5000
    • is greater than 1
  • enum type
  • options
    • is list
    • is not empty
    • is not null
    • list values are unique
    • number of items is less or equal than 100
  • default_value
  • is one of the options
  • set type
  • options
    • is list
    • is not empty
    • is not null
    • list values are unique
    • number of items is less or equal than 100
  • min_values
  • is int
  • is greater or equal than max_values
  • is greater or equal than numer of options
  • max_values
  • is int
  • is less or equal than min_values
  • is greater or equal than numer of options
  • document type
  • max_num_of_files
    • is required
    • is greater or equal than 1
    • is less or equal than 100
  • user type
  • options
    • is dict
    • is not empty
    • is not null
    • contains only users and user_groups keys
  • min_users_values
  • is int
  • is greater or equal than max_users_values
  • is greater or equal than numer of options
  • max_users_values
  • is int
  • is less or equal than min_users_values
  • is greater or equal than numer of options
  • min_groups_values
  • is int
  • is greater or equal than max_groups_values
  • is greater or equal than numer of options
  • max_groups_values
  • is int
  • is less or equal than min_groups_values
  • is greater or equal than numer of options
  • allow_sync
    • is bool
  • allow_members_selection
    • is bool

Restrictions

  • Up to 2000 Fields can be added per given Object Class, limit is configurable per build.

Response

  • General keys
KeyTypeNotes
idint
labelstr
typestr
aliasstr
is_uniquebool
is_identifierbool
is_systembool
has_duplicatesbool
extrasarray
orderint
descriptionstr
_metaarrayonly for user type fields

Response _meta array

KeyTypeNotes
is_min_users_fulfilledboolDetermine if the current User Type field configuration meets the minimum requirements
usersarrayUsers representation array
user_groupsarrayUser Groups representation array
  • Additional keys depends on field type and are described in Validators section

  • Successful status 201 Created

  • Response body:

json
{
    "id": 18,
    "label": "field description",
    "alias": "some_field",
    "type": "int",
    "is_unique": false,
    "is_identifier": false,
    "is_system": false,
    "has_duplicates": false,
    "order": 3,
    "description": "",
    "extras": {
        "default_value": null,
        "min_value": 4,
        "max_value": null
    },
    "default_value": null,
    "min_value": 4,
    "max_value": null
}

Errors

CauseResponse status codeResponse message
alias missing400 Bad Request"alias": ["This field is required."]
alias is empty400 Bad Request"alias": [ "This field may not be blank." ]
alias is null400 Bad Request"alias": [ "This field may not be null." ]
alias not unique400 Bad Request"alias": ["This field must be unique."]
alias too long400 Bad Request"alias": ["Ensure this field has no more than 50 characters."]
alias invalid name400 Bad Request"alias": ["Object Field of alias _ cannot be set."]
type missing400 Bad Request"type": ["This field is required."]
type invalid choice400 Bad Request"type": [""aaa" is not a valid choice."]
label missing400 Bad Request"label": ["This field is required."]
label is empty400 Bad Request"label": [ "This field may not be blank." ]
label is null400 Bad Request"label": [ "This field may not be null." ]
label not unique400 Bad Request"label": ["This field must be unique."]
label too long400 Bad Request"label": ["Ensure this field has no more than 100 characters."]
order invalid400 Bad Request"order": ["Ensure this value is greater than or equal to 0.'"]
description is null400 Bad Request"description": ["This field may not be null."]
description too long400 Bad Request"description": ["Ensure this field has no more than 500 characters."]
options is empty400 Bad Request"options": ["This list may not be empty."]
options is null400 Bad Request"options": ["This field may not be null."]
options is required400 Bad Request"options": ["This field is required."]
options is blank400 Bad Request"options": ["This list may not be blank."]
option too long400 Bad Request"options": ["Ensure this field has no more than 100 characters."]
options not unique400 Bad Request"options": ["Ensure options are unique."]
options required for user400 Bad Request"options": ["At least one users or user groups must be selected."]
options required for user invalid type400 Bad Request"options": ["Expected a dictionary of items but got type "type"."]
options for user null400 Bad Request"options": ["This field may not be null."]
options for user required400 Bad Request"options": ["This field is required."]
user_groups options for user greater than 10400 Bad Request"options": {"user_groups": ["Ensure this list has at most 10 items."]}
users insufficient permissions400 Bad Request"options": {"users": ["You do not have permission to select user "user_id" as a user-type field option."]}
user_groups insufficient permissions400 Bad Request"options": {"user_groups": ["You do not have permission to select user group "group_id" as a user-type field option."]}
user_groups options for user bool params required400 Bad Request"options": ["At least one of allow_sync or allow_members_selection must be set to true when group IDs are provided."]
user_groups options for user bool params values400 Bad Request"options": ["allow_sync and allow_members_selection parameters can only be set to true when group IDs are provided."]
default_value invalid400 Bad Request"default_value": ["The default value should be one of options."]
max_value invalid400 Bad Request"max_value": ["A valid integer is required."]
min_value invalid400 Bad Request"min_value": ["A valid integer is required."]
max_value < min_value400 Bad Request"detail": ["Max value cannot be smaller than min value."]
max_users_value invalid400 Bad Request"max_users_value": ["A valid integer is required."]
min_users_value invalid400 Bad Request"min_users_value": ["A valid integer is required."]
max_users_value < min_users_value400 Bad Request"detail": ["Users max value cannot be smaller than min value."]
max_users_value and min_users_value with conditions400 Bad Request"options": ["min_users_values and max_users_values can be specified only when user IDs are provided or group IDs are provided with allow_members_selection set to true."]
max_groups_value invalid400 Bad Request"max_groups_value": ["A valid integer is required."]
min_groups_value invalid400 Bad Request"min_groups_value": ["A valid integer is required."]
max_groups_value < min_groups_value400 Bad Request"detail": ["Groups max value cannot be smaller than min value."]
max_groups_value and min_groups_value with allow_sync400 Bad Request"options": ["min_groups_values and max_groups_values can be passed only when allow_sync is set to true."]
default_value < min_value400 Bad Request"detail": ["Default value cannot be smaller than min value."]
default_value > max_value400 Bad Request"detail": ["Default value cannot be bigger than max value."]
required_value invalid400 Bad Request"required_value": ["Only boolean or null values are allowed."]
max_num_of_files is required400 Bad Request"max_num_of_files": ["This field is required."]
max_num_of_files is null400 Bad Request"max_num_of_files": ["This field may not be null."]
max_num_of_files invalid type400 Bad Request"max_num_of_files": ["A valid integer is required."]
max_num_of_files invalid valuer400 Bad Request"max_num_of_files": ["Ensure this value is greater than or equal to 1."]
max_length is null400 Bad Request"max_length": ["This field may not be null."]
max_length invalid400 Bad Request"max_length": ["A valid integer is required."]
is_identifier forbidden type400 Bad Request"is_identifier": ["Object Field of type "type" cannot be set as identifier."]
allow_sync is set to null400 Bad Request"allow_sync": ["This field may not be null."]
allow_members_selection is set to null400 Bad Request"allow_members_selection": ["This field may not be null."]
Insufficient permissions403 Forbidden"detail": "You do not have permission to perform this action."

PATCH /api/object-classes/object_class_id/fields/id or alias/

Updates single Object Field identified by either id or alias.

Permissions

Requires authentication and object_classes.edit permission.

Allowed parameters

  • Body general parameters
KeyTypeNotes
labelstring
is_identifierbool
is_uniqueboolField value is unique in Object Class scope
is_systembool
orderint
descriptionstring
  • Additional body parameters for int type
KeyTypeNotes
default_valueint
min_valueint
max_valueint
  • Additional body parameters for float type
KeyTypeNotes
default_valuefloat
min_valuefloat
max_valuefloat
  • Additional body parameters for bool type
KeyTypeNotes
required_valuebool
  • Additional body parameters for string type
KeyTypeNotes
max_lengthint
  • Additional body parameters for enum type
KeyTypeNotes
optionsenum
default_valuestring
  • Additional body parameters for set type
KeyTypeNotes
optionsenum
min_valuesint
max_valuesint
  • Additional body parameters for document type
KeyTypeNotes
max_num_of_filesenum
  • Additional body parameters for user type
KeyTypeNotes
optionsenum
min_users_valuesint
max_users_valuesint
min_groups_valuesint
max_groups_valuesint
allow_syncbool
allow_members_selectionbool
    • Parameter options array
KeyTypeNotes
userslist
user_groupslist
  • Headers
Content-Type: application/json
Authorization: JWT access_token
  • Schema
json
PATCH /api/object-classes/1/fields/1/

{
    "min_value": 4,
    "label": "field description",
    "is_identifier": false,
    "order": 3
}

Validations

  • General
  • label
    • is string
    • is required
    • is not null
    • is not blank
    • is unique in the Object Class scope
    • max length is 100
  • is_identifier
    • is bool
  • is_unique
    • is bool
  • is_system
    • is bool
    • cannot be changed from true
    • if set to true, only name and description can be changed
  • order
    • is int
    • is greater or equal 0
  • description
    • is string
    • is not null
    • max length is 500
  • int type
  • default_value
    • is int
    • is between min_value and max_value
  • max_value
    • is int
    • is greater or equal than min_value
  • min_value
    • is int
    • is less or equal than max_value
  • float type
  • default_value
    • is float
    • is between min_value and max_value
  • max_value
    • is float
    • is greater or equal than min_value
  • min_value
    • is float
    • is less or equal than max_value
  • bool type
  • required_value
    • is bool
  • string type
  • max_length
    • is int
    • is less or equal than 255 if is_identifier is true
    • is less or equal 5000
    • is greater than 1
  • enum type
  • options
    • is list
    • is not empty
    • is not null
    • list values are unique
    • number of items is less or equal than 100
  • default_value
  • is one of the options
  • set type
  • options
    • is list
    • is not empty
    • is not null
    • list values are unique
    • number of items is less or equal than 100
  • min_values
  • is int
  • is greater or equal than max_values
  • is greater or equal than numer of options
  • max_values
  • is int
  • is less or equal than min_values
  • is greater or equal than numer of options
  • document type
  • max_num_of_files
    • is required
    • is greater or equal than 1
    • is less or equal than 100
  • user type
  • options
    • is dict
    • is not empty
    • is not null
    • contains only users and user_groups keys
  • min_users_values
  • is int
  • is greater or equal than max_users_values
  • is greater or equal than numer of options
  • max_users_values
  • is int
  • is less or equal than min_users_values
  • is greater or equal than numer of options
  • min_groups_values
  • is int
  • is greater or equal than max_groups_values
  • is greater or equal than numer of options
  • max_groups_values
  • is int
  • is less or equal than min_groups_values
  • is greater or equal than numer of options
  • allow_sync
    • is bool
  • allow_members_selection
    • is bool

Response

  • General keys
KeyTypeNotes
idint
labelstr
typestr
aliasstr
is_uniquebool
is_identifierbool
is_systembool
has_duplicatesbool
extrasarray
orderint
_metaarrayonly for user type fields

Response _meta array

KeyTypeNotes
is_min_users_fulfilledboolDetermine if the current User Type field configuration meets the minimum requirements
usersarrayUsers representation array
user_groupsarrayUser Groups representation array
  • Additional keys depends on field type and are described in Validators section

  • Successful status 200 Ok

  • Response body:

json
{
    "id": 1,
    "label": "field description",
    "alias": "some_field",
    "type": "int",
    "is_unique": false,
    "is_identifier": false,
    "is_system": false,
    "has_duplicates": false,
    "order": 3,
    "extras": {
        "default_value": null,
        "min_value": 4,
        "max_value": null
    },
    "default_value": null,
    "min_value": 4,
    "max_value": null
}

Errors

CauseResponse status codeResponse message
label missing400 Bad Request"label": ["This field is required."]
label is empty400 Bad Request"label": [ "This field may not be blank." ]
label is null400 Bad Request"label": [ "This field may not be null." ]
label not unique400 Bad Request"label": ["This field must be unique."]
label too long400 Bad Request"label": ["Ensure this field has no more than 100 characters."]
order invalid400 Bad Request"order": ["Ensure this value is greater than or equal to 0.'"]
options is empty400 Bad Request"options": ["This list may not be empty."]
options is null400 Bad Request"options": ["This field may not be null."]
options is required400 Bad Request"options": ["This field is required."]
options is blank400 Bad Request"options": ["This list may not be blank."]
option too long400 Bad Request"options": ["Ensure this field has no more than 100 characters."]
options not unique400 Bad Request"options": ["Ensure options are unique."]
options required for user400 Bad Request"options": ["At least one users or user groups must be selected."]
options required for user invalid type400 Bad Request"options": ["Expected a dictionary of items but got type "type"."]
options for user null400 Bad Request"options": ["This field may not be null."]
options for user required400 Bad Request"options": ["This field is required."]
users insufficient permissions400 Bad Request"options": {"users": ["You do not have permission to select user "user_id" as a user-type field option."]}
user_groups insufficient permissions400 Bad Request"options": {"user_groups": ["You do not have permission to select user group "group_id" as a user-type field option."]}
user_groups options for user greater than 10400 Bad Request"options": {"user_groups": ["Ensure this list has at most 10 items."]}
user_groups options for user bool params required400 Bad Request"options": ["At least one of allow_sync or allow_members_selection must be set to true when group IDs are provided."]
user_groups options for user bool params values400 Bad Request"options": ["allow_sync and allow_members_selection parameters can only be set to true when group IDs are provided."]
default_value invalid400 Bad Request"default_value": ["The default value should be one of options."]
max_value invalid400 Bad Request"max_value": ["A valid integer is required."]
min_value invalid400 Bad Request"min_value": ["A valid integer is required."]
max_value < min_value400 Bad Request"detail": ["Max value cannot be smaller than min value."]
max_users_value invalid400 Bad Request"max_users_value": ["A valid integer is required."]
min_users_value invalid400 Bad Request"min_users_value": ["A valid integer is required."]
max_users_value < min_users_value400 Bad Request"detail": ["Users max value cannot be smaller than min value."]
max_users_value and min_users_value with conditions400 Bad Request"options": ["min_users_values and max_users_values can be specified only when user IDs are provided or group IDs are provided with allow_members_selection set to true."]
max_groups_value invalid400 Bad Request"max_groups_value": ["A valid integer is required."]
min_groups_value invalid400 Bad Request"min_groups_value": ["A valid integer is required."]
max_groups_value < min_groups_value400 Bad Request"detail": ["Groups max value cannot be smaller than min value."]
max_groups_value and min_groups_value with allow_sync400 Bad Request"options": ["min_groups_values and max_groups_values can be passed only when allow_sync is set to true."]
default_value < min_value400 Bad Request"detail": ["Default value cannot be smaller than min value."]
default_value > max_value400 Bad Request"detail": ["Default value cannot be bigger than max value."]
required_value invalid400 Bad Request"required_value": ["Only boolean or null values are allowed."]
max_num_of_files is required400 Bad Request"max_num_of_files": ["This field is required."]
max_num_of_files is null400 Bad Request"max_num_of_files": ["This field may not be null."]
max_num_of_files invalid type400 Bad Request"max_num_of_files": ["A valid integer is required."]
max_num_of_files invalid valuer400 Bad Request"max_num_of_files": ["Ensure this value is greater than or equal to 1."]
max_length is null400 Bad Request"max_length": ["This field may not be null."]
max_length invalid400 Bad Request"max_length": ["A valid integer is required."]
is_identifier forbidden type400 Bad Request"is_identifier": ["Object Field of type "type" cannot be set as identifier."]
allow_sync is set to null400 Bad Request"allow_sync": ["This field may not be null."]
allow_members_selection is set to null400 Bad Request"allow_members_selection": ["This field may not be null."]
modifiying is_system flag set to true400 Bad Request"is_system": ["System object class field cannot be modified except for label, description or order."]
modifiying fields differend than: name, description, ordering when is_system flag set to true400 Bad Request"is_system": ["System object class field cannot be modified except for label, description or order."]
Insufficient permissions403 Forbidden"detail": "You do not have permission to perform this action."

DELETE /api/object-classes/object_class_id/fields/id or alias/

Deletes single Object Field identified by either id or alias.

Permissions

Requires authentication and object_class.edit permission.

Request example

  • Headers
Request Method: DELETE
Location: /api/object-classes/1/fields/1/
Authorization: JWT access_token

Response example

  • Status 204 No Content
  • Body

Errors

ErrorResponse codeMessage
Object Class Field in use400 Forbidden"detail": "Object Class Field is in use by Sequences."
Object Class Field is system field400 Forbidden"detail": "System object class fields cannot be deleted."
Insufficient permissions403 Forbidden"detail": "You do not have permission to perform this action."
Object Class does not exist404 Forbidden"detail": "Not found"
Object Field does not exist404 Forbidden"detail": "Not found"

OPTIONS /api/object-classes/id/fields/

Permissions

Requires authentication only.

Request

  • Headers
Request Method: OPTIONS
Content-Type: application/json
Location: /api/object-classes/1/fields/
Authorization: JWT access_token

Response

  • Successful status 200 OK
  • Response body:
json
{
    "list": {
        "columns": [
            {
                "alias": "id",
                "type": "int",
                "predicates": [
                    "exact",
                    "gt",
                    "gte",
                    "lt",
                    "lte",
                    "range",
                    "in"
                ],
                "sort_ok": true
            },
            {
                "alias": "label",
                "type": "string",
                "predicates": [
                    "icontains"
                ],
                "sort_ok": false,
                "search_key": "label__icontains"
            },
            {
                "alias": "type",
                "type": "enum",
                "predicates": [],
                "sort_ok": false,
                "values": [
                    {
                        "value": "int",
                        "text": "Integer"
                    },
                    {
                        "value": "float",
                        "text": "Decimal"
                    },
                    {
                        "value": "bool",
                        "text": "Checkbox"
                    },
                    {
                        "value": "string",
                        "text": "Text"
                    },
                    {
                        "value": "enum",
                        "text": "Single select"
                    },
                    {
                        "value": "set",
                        "text": "Multi select"
                    },
                    {
                        "value": "email",
                        "text": "Email"
                    },
                    {
                        "value": "phone",
                        "text": "Phone"
                    },
                    {
                        "value": "date",
                        "text": "Date"
                    },
                    {
                        "value": "time",
                        "text": "Time"
                    },
                    {
                        "value": "datetime",
                        "text": "Date/Time"
                    },
                    {
                        "value": "url",
                        "text": "URL"
                    },
                    {
                        "value": "json",
                        "text": "JSON"
                    },
                    {
                        "value": "document",
                        "text": "Document"
                    },
                    {
                        "value": "user",
                        "text": "User"
                    }
                ]
            },
            {
                "alias": "alias",
                "type": "string",
                "predicates": [
                    "in"
                ],
                "sort_ok": false
            },
            {
                "alias": "is_unique",
                "type": "bool",
                "predicates": [],
                "sort_ok": false
            }
        ]
    },
    "details": {
        "schema": [
            {
                "alias": "label",
                "type": "string",
                "required": true,
                "validators": [
                    {
                        "type": "max_length",
                        "length": 100
                    }
                ]
            },
            {
                "alias": "is_system",
                "type": "bool",
                "predicates": [],
                "sort_ok": false
            },
            {
                "alias": "alias",
                "type": "string",
                "required": true,
                "validators": [
                    {
                        "type": "min_length",
                        "length": 1
                    },
                    {
                        "type": "max_length",
                        "length": 50
                    }
                ]
            },
            {
                "alias": "description",
                "type": "string",
                "required": false,
                "validators": [
                    {
                        "type": "max_length",
                        "length": 500
                    },
                ],
            },
            {
                "alias": "type",
                "type": "enum",
                "required": true,
                "values": [
                    {
                        "value": "string",
                        "text": "Text",
                        "is_unique": true,
                        "is_identifier": true,
                        "options": [
                            {
                                "name": "max_length",
                                "type": "int",
                                "required": false,
                                "validators": [
                                    {
                                        "type": "min_value",
                                        "length": 1
                                    },
                                    {
                                        "type": "max_value",
                                        "length": 5000
                                    }
                                ]
                            }
                        ]
                    },
                    {
                        "value": "int",
                        "text": "Integer",
                        "is_unique": true,
                        "is_identifier": true,
                        "options": [
                            {
                                "name": "min_value",
                                "type": "int",
                                "required": false,
                                "validators": []
                            },
                            {
                                "name": "max_value",
                                "type": "int",
                                "required": false,
                                "validators": []
                            },
                            {
                                "name": "default_value",
                                "type": "int",
                                "required": false,
                                "validators": []
                            }
                        ]
                    },
                    {
                        "value": "float",
                        "text": "Decimal",
                        "is_unique": true,
                        "is_identifier": false,
                        "options": [
                            {
                                "name": "min_value",
                                "type": "float",
                                "required": false,
                                "validators": []
                            },
                            {
                                "name": "max_value",
                                "type": "float",
                                "required": false,
                                "validators": []
                            },
                            {
                                "name": "default_value",
                                "type": "float",
                                "required": false,
                                "validators": []
                            }
                        ]
                    },
                    {
                        "value": "bool",
                        "text": "Checkbox",
                        "is_unique": false,
                        "is_identifier": false,
                        "options": [
                            {
                                "name": "default_value",
                                "type": "bool",
                                "required": false,
                                "validators": []
                            }
                        ]
                    },
                    {
                        "value": "email",
                        "text": "Email",
                        "is_unique": true,
                        "is_identifier": true,
                        "options": []
                    },
                    {
                        "value": "phone",
                        "text": "Phone",
                        "is_unique": true,
                        "is_identifier": true,
                        "options": [
                            {
                                "name": "max_length",
                                "type": "int",
                                "required": false,
                                "validators": [
                                    {
                                        "type": "max_length",
                                        "length": 20
                                    }
                                ]
                            }
                        ]
                    },
                    {
                        "value": "date",
                        "text": "Date",
                        "is_unique": false,
                        "is_identifier": true,
                        "options": []
                    },
                    {
                        "value": "datetime",
                        "text": "Date/Time",
                        "is_unique": false,
                        "is_identifier": true,
                        "options": []
                    },
                    {
                        "value": "time",
                        "text": "Time",
                        "is_unique": false,
                        "is_identifier": false,
                        "options": []
                    },
                    {
                        "value": "url",
                        "text": "URL",
                        "is_unique": false,
                        "is_identifier": true,
                        "options": []
                    },
                    {
                        "value": "json",
                        "text": "JSON",
                        "is_unique": false,
                        "is_identifier": false,
                        "options": []
                    },
                    {
                        "value": "enum",
                        "text": "Single select",
                        "is_unique": false,
                        "is_identifier": false,
                        "options": [
                            {
                                "name": "default_value",
                                "type": "string",
                                "required": false,
                                "validators": []
                            },
                            {
                                "name": "options",
                                "type": "enum",
                                "required": true,
                                "validators": [
                                    {
                                        "type": "min_option_length",
                                        "length": 1
                                    },
                                    {
                                        "type": "max_option_length",
                                        "length": 100
                                    },
                                    {
                                        "type": "max_options",
                                        "length": 200
                                    }
                                ]
                            }
                        ]
                    },
                    {
                        "value": "set",
                        "text": "Multi select",
                        "is_unique": false,
                        "is_identifier": false,
                        "options": [
                            {
                                "name": "options",
                                "type": "enum",
                                "required": true,
                                "validators": [
                                    {
                                        "type": "min_option_length",
                                        "length": 1
                                    },
                                    {
                                        "type": "max_option_length",
                                        "length": 100
                                    },
                                    {
                                        "type": "max_options",
                                        "length": 100
                                    }
                                ]
                            },
                            {
                                "name": "min_values",
                                "type": "int",
                                "required": false,
                                "validators": []
                            },
                            {
                                "name": "max_values",
                                "type": "int",
                                "required": false,
                                "validators": []
                            }
                        ]
                    },
                    {
                        "value": "document",
                        "text": "Document",
                        "is_unique": false,
                        "is_identifier": false,
                        "options": [
                            {
                                "name": "max_num_of_files",
                                "type": "int",
                                "required": true,
                                "validators": [
                                    {
                                        "type": "min_value",
                                        "length": 1
                                    },
                                    {
                                        "type": "max_value",
                                        "length": 100
                                    }
                                ]
                            }
                        ]
                    },
                    {
                        "value": "user",
                        "text": "User",
                        "is_unique": false,
                        "is_identifier": false,
                        "options": {
                            "users": [
                                {
                                    "name": "options",
                                    "type": "user",
                                    "required": false,
                                    "validators": [
                                        {
                                            "type": "min_options",
                                            "length": 1
                                        },
                                        {
                                            "type": "max_options",
                                            "length": 100
                                        }
                                    ]
                                },
                                {
                                    "name": "min_users_values",
                                    "type": "int",
                                    "required": false,
                                    "validators": []
                                },
                                {
                                    "name": "max_users_values",
                                    "type": "int",
                                    "required": false,
                                    "validators": []
                                }
                            ],
                            "user_groups": [
                                {
                                    "name": "options",
                                    "type": "user",
                                    "required": false,
                                    "validators": [
                                        {
                                            "type": "min_options",
                                            "length": 1
                                        },
                                        {
                                            "type": "max_options",
                                            "length": 10
                                        }
                                    ]
                                },
                                {
                                    "name": "min_groups_values",
                                    "type": "int",
                                    "required": false,
                                    "validators": []
                                },
                                {
                                    "name": "max_groups_values",
                                    "type": "int",
                                    "required": false,
                                    "validators": []
                                },
                                {
                                    "name": "allow_sync",
                                    "type": "bool",
                                    "required": false,
                                    "validators": []
                                },
                                {
                                    "name": "allow_members_selection",
                                    "type": "bool",
                                    "required": false,
                                    "validators": []
                                }
                            ]
                        }
                    }
                ]
            }
        ]
    },
    "restrictions": {
        "limit_items": 2000
    }
}

GET /api/object-classes/object_class_id/fields/id or alias/

Returns single Object field identified by either id or alias.

Permissions

Requires authentication and object_classes.view permission.

URL parameters

KeyTypeNotes
object_class_idid
idid
aliasstrField's alias

Request example

  • Headers
Request Method: GET
Content-Type: application/json
Location: /api/object-classes/1/fields/1/
Authorization: JWT access_token

Response

  • General keys
KeyTypeNotes
idint
labelstr
typestr
aliasstr
is_uniquebool
is_identifierbool
is_systembool
has_duplicatesbool
extrasarray
orderint
descriptionstr
_metaarray
  • Additional keys depends on field type and are described in Validators section

  • Successful status 200 OK

  • Response body:

    • Response body for int field type
json
{
    "id": 18,
    "label": "field description",
    "alias": "some_field",
    "type": "int",
    "is_unique": false,
    "is_identifier": false,
    "is_system": false,
    "has_duplicates": false,
    "order": 3,
    "description": "int field description",
    "extras": {
        "default_value": null,
        "min_value": 4,
        "max_value": null
    },
    "default_value": null,
    "min_value": 4,
    "max_value": null
}
    • Response body for user field type
json
{
  "_meta": {
    "is_min_users_fulfilled": true, 
    "user_groups": [
      {
        "id": 138,
        "name": "UsersGroup 0",
        "num_of_members": 1
      }
    ],
    "users": []
  },
  "alias": "slug_name_0",
  "allow_members_selection": true,
  "allow_sync": true,
  "extras": {
    "allow_members_selection": true,
    "allow_sync": true,
    "max_groups_values": 1,
    "max_users_values": 1,
    "min_groups_values": 1,
    "min_users_values": 1,
    "options": {
      "user_groups": [
        138
      ],
      "users": []
    }
  },
  "has_duplicates": false,
  "id": 8,
  "is_identifier": false,
  "is_unique": false,
  "label": "Name 0",
  "max_groups_values": 1,
  "max_users_values": 1,
  "min_groups_values": 1,
  "min_users_values": 1,
  "options": {
    "user_groups": [
      138
    ],
    "users": []
  },
  "order": 0,
  "description": "user field description",
  "type": "user"
}

Errors

ErrorResponse codeMessage
Insufficient permissions403 Forbidden"detail": "You do not have permission to perform this action."
Object Field with "id" does not exist404 Not Found"detail": "Not found."
Object Class with "id" does not exist404 Not Found"detail": "Not found."

GET /api/object-classes/object_class_id/fields/

Endpoint retrieving the list of fields assigned to given Object Class.

Permissions

Requires authentication and object_class.view permission.

Request example

  • Headers
Request Method: GET
Location: /api/object-classes/1/fields/
Authorization: JWT access_token

Response

KeyTypeNotes
idint
labelstr
typestr
aliasstr
is_uniquebool
is_identifierbool
is_systembool
extrasObject
orderint
sort_okbool

Response extras array

Contains additional configuration options of a Field.

Response example

  • Status 200 OK
  • Body
json
{ 
 "limit": 100, 
   "offset": 0, 
   "filtered_count": 2, 
   "total_count": 2, 
   "next": null, 
   "previous": null, 
   "results": [ 
  { 
           "id": 1,            
           "label": "First Name", 
           "type": "string", 
           "alias": "firstname", 
           "is_required": true, 
           "is_unique": false, 
           "is_identifier": false, 
           "is_system": false, 
           "extras": { 
             "max_length": null 
           }, 
           "order": 0,
           "sort_ok": true
       }, 
       { 
           "id": 2, 
           "label": "Has a dog", 
           "type": "bool", 
           "alias": "has_a_dog", 
           "is_required": false, 
           "is_unique": false, 
           "is_identifier": false, 
           "extras": { 
              "default_value": null 
            }, 
           "order": 1,
           "sort_ok": false
       }, 
   ] 
}

Sorting

ParameterExampleNotes
id{build}/api/object-classes/object_class_id/fields/?ordering=idAscending
id{build}/api/object-classes/object_class_id/fields/?ordering=-idDescending (-)

Filtering

Please check ALX API standards for predicates available per type.

ParameterTypeExample
idint + enum{build}/api/object-classes/object_class_id/fields/?id__in=1,2
alias__inenum{build}/api/object-classes/object_class_id/fields/?alias__in=email,last_name
label__icontainsstring{build}/api/object-classes/object_class_id/fields/?label__icontains=name

Errors

ErrorResponse codeMessage
object_class_id is invalid404 Bad Request'detail': "Not found."
Unauthorized API call403 Bad Request'detail': "You do not have permission to perform this action."

GET /api/object-classes/{object_class_id}/fields/autocomplete/

Returns list of Object Classes Fields.

Permissions

Requires authentication and object_classes.view permission.

Response contains only the fields for the associated object class.

Request example

  • Headers
Content-Type: application/json
Authorization: JWT access_token

Response

KeyTypeNotes
limitint
offsetint
total_countintTotal number of results visible to the user (based on permissions).
filtered_countintNumber of results visible to the user (based on permissions) with filters applied.
nexturlNext page URL (null if there is no next page)
previousurlPrevious page URL (null if there is no previous page)
resultsArrayList of results. Described in the next table.

Response results array

KeyTypeNotes
valuestrField alias constructed from prefix and slug namefield_<slug_name>
valuesArrayList of options to choice for choice type fields.
textstrField name.
predicatesArrayList of predicates for given field type.

Response results.values array

KeyTypeNotes
valuestrOption value.
textstrOption representation text.
  • Successful status 200 OK
  • Response body schema
json
{
  "limit": <int>,
  "offset": <int>,
  "filtered_count": <int>,
  "total_count": <int>,
  "next": <str>,
  "previous": <str>,
  "results": [
    {
      "id": <pk>,
      "value": <str>,
      "values": [
        {
          "value": <str>,
          "text": <str>
        },
      ],
      "text": <str>,
      "predicates": <Array>
    }
  ]
}

Sorting

ParameterExampleNotes
value/api/object-classes/{object_class_id}/fields/autocomplete/?ordering=valueAscending
value/api/object-classes/{object_class_id}/fields/autocomplete/?ordering=-valueDescending (-)
text/api/object-classes/{object_class_id}/fields/autocomplete/?ordering=textAscending
text/api/object-classes/{object_class_id}/fields/autocomplete/?ordering=-textDescending (-)

Filtering

Please check ALX API standards for predicates available per type.

ParameterTypeExampleNotes
textstr/api/object-classes/{object_class_id}/fields/autocomplete/?text__contains=text
for_filteringbool/api/object-classes/{object_class_id}/fields/autocomplete/?for_filtering=1Filter by types which supports filtering for given field type. Set 0 or skip parameter to disable filtering.

Field types with filtering support

text
integer
decimal
date
date/time
email
phone
set
enum
url
user

Errors

ErrorResponse codeMessage
Requesting user is not authenticated401 Unauthorized"detail": "Authentication credentials were not provided."
Requesting user is authorized but without view perm for tasks resource403 Forbidden"detail": "You do not have permission to perform this action."
Object Class with "{id}" does not exist404 Not Found"detail": "Not found."

POST /api/object-classes/object_class_id/fields/validate/

Validates object class fields.

Permissions

Requires authentication and object_classes.view permission.

URL parameters

KeyNotes
object_class_idObject Class ID

Request Schema

  • Headers
Request Method: POST
Location: /api/object-classes/{object_class_id}/fields/validate/
Authorization: JWT access_token
  • Body
json
[<int>]

Request body must contain a list of Object Class Field ids.

json
[<field_id1>, <field_id2>]

Request example

json
[2734, 7231]

Validations

Validation logic for individual types.

  • user type
Field ConfigurationCounting LogicNo min_users_valuesmin_users_values defined
Individual usersIndividual users defined in the Class fieldalways fulfilledTo be fulfilled must have at least the defined number of unique users available
Individual users and user groups with allow_members_selectionUnique users from the ones defined in the Class field - including both individual users and group membersalways fulfilledTo be fulfilled must have at least the defined number of unique users available
Individual users and user groups with allow_syncIndividual users defined in the Class fieldalways fulfilledTo be fulfilled must have at least the defined number of unique users available
Individual users and user groups with allow_sync and allow_members_selectionUnique users from the ones defined in the Class field - including both individual users and group membersalways fulfilledTo be fulfilled must have at least the defined number of unique users available
User groups with allow_members_selectionUnique users from the group members list of the groups defined in the Class fieldalways fulfilledTo be fulfilled must have at least the defined number of unique users available
User groups with allow_members_selection and allow_syncUnique users from the group members list of the groups defined in the Class fieldalways fulfilledTo be fulfilled must have at least the defined number of unique users available
User groups with allow_syncn/aalways fulfilledalways fulfilled

Restrictions

  • Up to 2000 Fields can be sent.

Response

Some Fields Invalid.

KeyTypeNotes
errorObjectfield validation error message
  • Successful status 200 Ok
  • Response body:
json
{
  "error": [ "The field "<field_name>" does not have enough valid options available." ]
}

All Fields valid.

  • Successful status 204 No Content

Errors

CauseResponse status codeResponse message
object_class_id is invalid404 Bad Request'detail': "Not found."
Insufficient permissions403 Forbidden"detail": "You do not have permission to perform this action."

GET /api/object-classes/object_class_id/fields/id or alias/usage/

Returns usage data of an Object field identified by either id or alias.

Permissions

Requires authentication and object_class.view permission.

Request example

  • Headers
Request Method: GET
Location: /api/object-classes/1/fields/2/usage/
Authorization: JWT access_token

Response

KeyTypeNotes
num_of_message_templatesint
message_templatesarray
num_of_message_templates_with_fieldint
num_of_recordsint
num_of_records_with_valuesint
task_template_formsarray
num_of_task_template_formsint
document_templatesarray
sequencesarray
num_of_sequencesint
num_of_upload_componentsint

Response message_templates array

KeyTypeNotes
idintMessage template id
namestrName of message template

Response task_template_forms array

KeyTypeNotes
idintTask Template id
namestrName of Task Template

Response document_templates array

KeyTypeNotes
idintDocument Template id
namestrName of Document Template
object_class_idintID of related Object Class
object_class_namestrName of related Object Class

Response sequences array

KeyTypeNotes
idintSequence id
namestrName of Sequence

Response example

  • Status 200 OK
  • Body
json
{
    "num_of_message_templates": 55,
    "message_templates": [],
    "num_of_message_templates_with_field": 0,
    "num_of_records": 176,
    "num_of_records_with_values": 21,
    "task_template_forms": [
        {
            "id": 1,
            "name": "Template 1"
        }
    ],
    "num_of_task_template_forms": 1,
    "document_templates": [
        {
            "id": 1,
            "name": "Document Template 1",
            "object_class_id": 1,
            "object_class_name": "Object Class 1",
        }
    ],
    "sequences": [
        {
            "id": 1,
            "name": "Sequence 1"
        }
    ],
    "num_of_sequences": 1,
    "num_of_upload_components": 1,
}

Errors

ErrorResponse codeMessage
id is invalid404 Bad Request'detail': "Not found."
Unauthorized API call403 Bad Request'detail': "You do not have permission to perform this action."