POST
/
custom
/
attributes
/
groups
curl --request POST \
--url 'https://YOURSITE.konstant.ly/openapi/v1/custom/attributes/groups' \
--header 'X-API-KEY: 1qaz2wsx3edc4rfv1qaz2wsx3edc4rfv' \
--header 'Content-Type: application/json' \
--data '[
{
    "name": "Region",
    "type": 3,
    "apiId": "region",
    "position": 1,
    "isRequired": true,
    "isVisible": true,
    "extraData": [
{
    "position": 1,
    "value": "North America"
},
{
    "position": 2,
    "value": "Europe"
},
{
    "position": 3,
    "value": "Asia Pacific"
}
    ]
},
{
    "name": "Active Status",
    "type": 6,
    "apiId": "is_active",
    "position": 2,
    "isRequired": false,
    "isVisible": true
}
]'
[
{
    "id": 1,
    "name": "Region",
    "type": 3,
    "apiId": "region",
    "position": 1,
    "isRequired": true,
    "extraData": [
{
    "id": 1,
    "position": 1,
    "value": "North America"
},
{
    "id": 2,
    "position": 2,
    "value": "Europe"
},
{
    "id": 3,
    "position": 3,
    "value": "Asia Pacific"
}
    ]
},
{
    "id": 2,
    "name": "Active Status",
    "type": 6,
    "apiId": "is_active",
    "position": 2,
    "isRequired": false,
    "extraData": null
}
]
Update or create custom attributes for groups. This endpoint allows you to modify existing attributes or add new ones.

Request Headers

X-API-KEY
string
required
API Key. Go to your Konstantly site > Settings > API and copy the value from there.

Request Body

Array of attribute objects, each containing:
name
string
required
Attribute name
type
integer
required
Attribute type:
  • 1: text
  • 2: date
  • 3: single choice
  • 4: multiple choice
  • 5: user choice
  • 6: yes/no
  • 7: external link
  • 8: number
apiId
string
Attribute API identifier (generated if not provided)
position
integer
required
Display position order
isRequired
boolean
required
Whether attribute is mandatory
isVisible
boolean
required
Whether attribute is visible in the interface
extraData
array
For choice-type attributes (types 3 and 4):

Important Notes

  1. Attribute Types:
  • Text fields (type 1) are limited to 255 characters
  • Date fields (type 2) expect ISO format dates
  • Choice fields (types 3 and 4) require extraData with options
  • Yes/No fields (type 6) are stored as booleans
  1. Updating Existing Attributes:
  • Match existing apiId to update rather than create
  • Cannot change type of existing attributes
  • Can modify options for choice-type fields

Response

Array of updated attribute objects with the same structure as the GET endpoint response.

Error Responses

400
object
Validation error response
curl --request POST \
--url 'https://YOURSITE.konstant.ly/openapi/v1/custom/attributes/groups' \
--header 'X-API-KEY: 1qaz2wsx3edc4rfv1qaz2wsx3edc4rfv' \
--header 'Content-Type: application/json' \
--data '[
{
    "name": "Region",
    "type": 3,
    "apiId": "region",
    "position": 1,
    "isRequired": true,
    "isVisible": true,
    "extraData": [
{
    "position": 1,
    "value": "North America"
},
{
    "position": 2,
    "value": "Europe"
},
{
    "position": 3,
    "value": "Asia Pacific"
}
    ]
},
{
    "name": "Active Status",
    "type": 6,
    "apiId": "is_active",
    "position": 2,
    "isRequired": false,
    "isVisible": true
}
]'
[
{
    "id": 1,
    "name": "Region",
    "type": 3,
    "apiId": "region",
    "position": 1,
    "isRequired": true,
    "extraData": [
{
    "id": 1,
    "position": 1,
    "value": "North America"
},
{
    "id": 2,
    "position": 2,
    "value": "Europe"
},
{
    "id": 3,
    "position": 3,
    "value": "Asia Pacific"
}
    ]
},
{
    "id": 2,
    "name": "Active Status",
    "type": 6,
    "apiId": "is_active",
    "position": 2,
    "isRequired": false,
    "extraData": null
}
]