Skip to content

Field Groups

List of valid attributes:

Attribute Description Specifics
account_id ID of the account the group belongs to -
discarded_at Date of removal Null or timestamp, cannot be set
entity_type Type of entity the group is being attched to Must be set, currently only user supported
name Name of the group -
fields
field_type Type of the field Must be set, allowed values are text, textarea, email, number, decimal, tel, date, city, country, singleselect, multiselect, checkbox, url
name Name of the field Must be set
position Position of the field inside the group Must be set, must be integer >= 0
hidden_for_user Whether the value of the field is visible to the user they belong to or not Required, can be true or false
immutable_for_user Whether the values of the field can be updated by the user they belong to or not Required, can be true or false
sensitive Whether field is sensitive or not Required, can be true or false
value_restrictions Additional restrictions for values of this field Must be set on type singleselect and multiselect, Must be blank in all other cases, When set it expects an object with the following keys allowed: in, Key in expects an array of strings

The following relationships can be included in requests:

Relationship Type
fields has many

Meta data: Permissions

Group Description
actions Contains permissions if current user can edit or delete the field group

Example request:

{
"data": {
"type": "field_group",
"attributes": {
"name": "Address",
"entity_type": "user",
"fields": [
{
"field_type": "text",
"name": "Street",
"position": 0,
"hidden_for_user": false,
"immutable_for_user": false,
"sensitive": false
}
]
}
}
}

Example response:

{
"data": {
"id": "77b7aa3e-dcdd-4734-a077-1cddd2117bb8",
"type": "field_group",
"attributes": {
...
}
}
}

This endpoint creates a field_group.

POST /api/v1/field_groups

Example request:

{
"data": {
"type": "field_group",
"attributes": {
"name": "Updated Address",
"entity_type": "user",
"fields": [
{
"id": "b2cf4a60-2802-48c2-9759-b3b99e8699bb",
"field_type": "text",
"name": "Street",
"position": 0
}
]
}
}
}

Example response:

{
"data": {
"id": "77b7aa3e-dcdd-4734-a077-1cddd2117bb8",
"type": "field_group",
"attributes": {
...
}
}
}

This endpoint updates a field_group and its fields. In order to remove a field from the group, pass parameter "_delete": true within the attributes of the field to remove.

PUT /api/v1/field_groups/:field_group_id

Parameter Description
field_group_id  ID of the group to be updated

Example response:

{
"data": {
"id": "34a895b6-4672-4c11-a9ed-8f7a82721f4e",
"type": "field_group",
"attributes": {
...
}
}
}

This endpoint returns a field_group.

GET /api/v1/field_groups/:field_group_id

Parameter Description
field_group_id The ID of the group to return

Example response:

{
"data": [
{
"id": "99ce3b35-06bf-425b-a512-080d8c2ddf51",
"type": "field_group",
"attributes": {
...
}
},
{
...
}
]
}

This endpoint returns all field_groups associated with an account.

GET /api/v1/field_groups

Example response:

{
"data": {
"id": "77b7aa3e-dcdd-4734-a077-1cddd2117bb8",
"type": "field_group",
"attributes": {
...
}
}
}

This endpoint deletes a field_group, associated fields as well as field_values.

DELETE /api/v1/field_groups/:field_group_id

Parameter Description
field_group_id ID of the group to be deleted

The following relationships can be included in requests:

Relationship Type
field_group belongs to

Example response:

{
"data": [
{
"id": "b2cf4a60-2802-48c2-9759-b3b99e8699bb",
"type": "field",
"attributes": {
...
}
},
{
...
}
]
}

This endpoint returns all fields associated with an account.

Use ?include=field_group to include the parent field group data in the response (e.g. to prefix the field name with its group name on the frontend).

GET /api/v1/fields

Parameter Description
include Relationships to include. Supported: field_group