POST
/
custom
/
attributes
/
users
curl --request POST \
--url 'https://YOURSITE.konstant.ly/openapi/v1/custom/attributes/users' \
--header 'X-API-KEY: 1qaz2wsx3edc4rfv1qaz2wsx3edc4rfv' \
--header 'Content-Type: application/json' \
--data '[
{
    "name": "Division",
    "type": 3,
    "apiId": "division",
    "position": 1,
    "isRequired": true,
    "isVisible": true,
    "isEditable": true,
    "extraData": [
{
    "position": 1,
    "value": "Sales"
},
{
    "position": 2,
    "value": "Marketing"
}
    ]
},
{
    "name": "Start Date",
    "type": 2,
    "apiId": "start_date",
    "position": 2,
    "isRequired": true,
    "isVisible": true,
    "isEditable": true
}
]'
[
{
    "id": 1,
    "name": "Division",
    "type": 3,
    "apiId": "division",
    "position": 1,
    "isRequired": true,
    "isEditable": true,
    "extraData": [
{
    "id": 1,
    "position": 1,
    "value": "Sales"
},
{
    "id": 2,
    "position": 2,
    "value": "Marketing"
}
    ]
},
{
    "id": 2,
    "name": "Start Date",
    "type": 2,
    "apiId": "start_date",
    "position": 2,
    "isRequired": true,
    "isEditable": true,
    "extraData": null
}
]

Request Headers

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

Request Body

The request body should contain an array of attribute configuration objects. Each attribute object has these properties:
id
integer
ID of an existing attribute if updating (omit for new attributes)
name
string
required
Display name of the attribute
type
integer
required
Type of attribute:
  • 1: text
  • 2: date
  • 3: single choice
  • 4: multiple choice
  • 5: user choice
  • 6: yes/no
  • 7: external link
  • 8: number
apiId
string
API identifier for the attribute. Generated automatically if not provided.
position
integer
required
Display order position of the attribute
isRequired
boolean
required
Whether this attribute is mandatory
isVisible
boolean
required
Whether this attribute is visible in the interface
isEditable
boolean
required
Whether this attribute can be modified
extraData
array
Required for choice-type attributes (types 3 and 4). Array of options, each containing:

Response

Returns an array of the updated attribute configurations with IDs assigned.

Error Responses

400
object
Validation error response

Usage Notes

  1. Type-specific requirements:
  • Text (type 1): Limited to 255 characters
  • Date (type 2): Must be valid ISO format dates
  • Single/Multiple Choice (types 3, 4): Must include extraData options
  • Number (type 8): Must be valid numeric values
  1. Updating existing attributes:
  • Include the ID to update rather than create new
  • Cannot change type of existing attributes
  • Can modify options for choice attributes
  • Position numbers should be unique
  1. Validation:
  • All required fields must be provided
  • Type must be valid (1-8)
  • Position must be a positive integer
  • Choice types require at least one option
  • apiId must be unique if provided
curl --request POST \
--url 'https://YOURSITE.konstant.ly/openapi/v1/custom/attributes/users' \
--header 'X-API-KEY: 1qaz2wsx3edc4rfv1qaz2wsx3edc4rfv' \
--header 'Content-Type: application/json' \
--data '[
{
    "name": "Division",
    "type": 3,
    "apiId": "division",
    "position": 1,
    "isRequired": true,
    "isVisible": true,
    "isEditable": true,
    "extraData": [
{
    "position": 1,
    "value": "Sales"
},
{
    "position": 2,
    "value": "Marketing"
}
    ]
},
{
    "name": "Start Date",
    "type": 2,
    "apiId": "start_date",
    "position": 2,
    "isRequired": true,
    "isVisible": true,
    "isEditable": true
}
]'
[
{
    "id": 1,
    "name": "Division",
    "type": 3,
    "apiId": "division",
    "position": 1,
    "isRequired": true,
    "isEditable": true,
    "extraData": [
{
    "id": 1,
    "position": 1,
    "value": "Sales"
},
{
    "id": 2,
    "position": 2,
    "value": "Marketing"
}
    ]
},
{
    "id": 2,
    "name": "Start Date",
    "type": 2,
    "apiId": "start_date",
    "position": 2,
    "isRequired": true,
    "isEditable": true,
    "extraData": null
}
]