Skip to main content
Unlisted page
This page is unlisted. Search engines will not index it, and only users having a direct link can access it.

Custom Properties API

This document describes the Custom Properties endpoints for Data Models in the DataService API v2.

Base URL

/api/v2/DataModels

Endpoints

1. Get Custom Properties Collection

Retrieves a filtered collection of custom properties.

Endpoint: GET /api/v2/DataModels/CustomProperties

Query Parameters:

ParameterTypeRequiredDescription
ModelIdGuidNoFilter by specific data model identifier
PagingFilter.OffsetintNoNumber of records to skip
PagingFilter.LimitintNoMaximum number of records to return

Response Statuses:

Status CodeDescription
200 OKSuccessfully retrieved collection
401 UnauthorizedMissing or invalid authentication

Response Body:

{
"items": [
{
"id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"modelId": "8b5f7c12-1234-4abc-9def-456789012345",
"organizationId": "ASOLEU",
"code": "CustomerRating",
"name": "Customer Rating",
"description": "Rating assigned to customer",
"isCollection": false,
"isLocalized": false,
"fieldType": 4,
"referencedEntityTypeIds": null,
"fieldValidations": []
}
],
"totalCount": 1
}

Example Request:

GET /api/v2/DataModels/CustomProperties?ModelId=8b5f7c12-1234-4abc-9def-456789012345&PagingFilter.Offset=0&PagingFilter.Limit=10

2. Get Custom Property by ID

Retrieves a specific custom property by its unique identifier.

Endpoint: GET /api/v2/DataModels/CustomProperties/{id}

Path Parameters:

ParameterTypeRequiredDescription
idGuidYesThe custom property identifier

Response Statuses:

Status CodeDescription
200 OKSuccessfully retrieved the custom property
404 Not FoundCustom property with the specified ID does not exist

Response Body:

{
"id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"modelId": "8b5f7c12-1234-4abc-9def-456789012345",
"organizationId": "ASOLEU",
"code": "CustomerRating",
"name": "Customer Rating",
"description": "Rating assigned to customer",
"isCollection": false,
"isLocalized": false,
"fieldType": 4,
"referencedEntityTypeIds": null,
"fieldValidations": [
{
"validation": "Range",
"minimum": 1,
"minimumIsExclusive": false,
"maximum": 5,
"maximumIsExclusive": false
}
]
}

Example Request:

GET /api/v2/DataModels/CustomProperties/3fa85f64-5717-4562-b3fc-2c963f66afa6

3. Get Custom Property by Code

Retrieves a custom property by its code (name) within the organization context.

Endpoint: GET /api/v2/DataModels/CustomProperties/ByCode/{code}

Path Parameters:

ParameterTypeRequiredDescription
codestringYesThe custom property code

Response Statuses:

Status CodeDescription
200 OKSuccessfully retrieved the custom property
401 UnauthorizedMissing or invalid authentication
404 Not FoundCustom property with the specified code does not exist

Response Body:

Same as Get Custom Property by ID.

Example Request:

GET /api/v2/DataModels/CustomProperties/ByCode/CustomerRating

4. Create Custom Property

Creates a new custom property for a specific data model.

Endpoint: POST /api/v2/DataModels/{modelId}/CustomProperties

Path Parameters:

ParameterTypeRequiredDescription
modelIdGuidYesThe data model identifier

Request Body:

FieldTypeRequiredDescription
organizationIdstringNoOrganization identifier (uses current context if not provided)
codestringYesUnique code for the custom property
nameLocalizedValue<string>YesLocalized display name
descriptionLocalizedValue<string>NoLocalized description
isCollectionboolYesWhether the property holds multiple values
isLocalizedboolYesWhether the property value is localized
fieldTypeDataModelFieldTypeYesThe data type of the field
referencedEntityTypeIdsGuid[]NoReferenced entity type IDs (for LookupEntity/NestedEntity types)
fieldValidationsDataModelFieldDefinitionValidation[]NoValidation rules for the field

Response Statuses:

Status CodeDescription
201 CreatedCustom property successfully created
409 ConflictCustom property with the same code already exists

Response Body:

Returns the created DataModelCustomPropertyDefinition object with the Location header pointing to the new resource.

Example Request:

POST /api/v2/DataModels/8b5f7c12-1234-4abc-9def-456789012345/CustomProperties
Content-Type: application/json

{
"code": "CustomerRating",
"name": {
"values": [
{ "culture": "en-US", "value": "Customer Rating" },
{ "culture": "cs-CZ", "value": "Hodnocení zákazníka" }
]
},
"description": {
"values": [
{ "culture": "en-US", "value": "Rating assigned to customer (1-5)" }
]
},
"isCollection": false,
"isLocalized": false,
"fieldType": 4,
"fieldValidations": [
{
"validation": "Range",
"minimum": 1,
"minimumIsExclusive": false,
"maximum": 5,
"maximumIsExclusive": false
}
]
}

Example Response:

HTTP/1.1 201 Created
Location: /api/v2/DataModels/CustomProperties/3fa85f64-5717-4562-b3fc-2c963f66afa6

{
"id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"modelId": "8b5f7c12-1234-4abc-9def-456789012345",
"organizationId": "ASOLEU",
"code": "CustomerRating",
"name": "Customer Rating",
"description": "Rating assigned to customer (1-5)",
"isCollection": false,
"isLocalized": false,
"fieldType": 4,
"referencedEntityTypeIds": null,
"fieldValidations": [
{
"validation": "Range",
"minimum": 1,
"minimumIsExclusive": false,
"maximum": 5,
"maximumIsExclusive": false
}
]
}

5. Update Custom Property

Updates an existing custom property.

Endpoint: PUT /api/v2/DataModels/CustomProperties/{id}

Path Parameters:

ParameterTypeRequiredDescription
idGuidYesThe custom property identifier

Query Parameters:

ParameterTypeRequiredDefaultDescription
allowBreakingChangesboolNofalseAllow changes to FieldType, IsCollection, IsLocalized, or Validations

Request Body:

FieldTypeRequiredDescription
nameLocalizedValue<string>YesLocalized display name
descriptionLocalizedValue<string>NoLocalized description
isCollectionboolYesWhether the property holds multiple values
isLocalizedboolYesWhether the property value is localized
fieldTypeDataModelFieldTypeYesThe data type of the field
referencedEntityTypeIdsGuid[]NoReferenced entity type IDs
fieldValidationsDataModelFieldDefinitionValidation[]NoValidation rules for the field

Response Statuses:

Status CodeDescription
200 OKCustom property successfully updated
400 Bad RequestBreaking change attempted without allowBreakingChanges=true
404 Not FoundCustom property with the specified ID does not exist

Breaking Changes:

The following changes are considered breaking and require allowBreakingChanges=true:

  • Changing fieldType
  • Changing isCollection
  • Changing isLocalized
  • Changing fieldValidations

Example Request (Non-breaking change):

PUT /api/v2/DataModels/CustomProperties/3fa85f64-5717-4562-b3fc-2c963f66afa6
Content-Type: application/json

{
"name": {
"values": [
{ "culture": "en-US", "value": "Updated Customer Rating" }
]
},
"description": {
"values": [
{ "culture": "en-US", "value": "Updated description" }
]
},
"isCollection": false,
"isLocalized": false,
"fieldType": 4,
"fieldValidations": []
}

Example Request (Breaking change):

PUT /api/v2/DataModels/CustomProperties/3fa85f64-5717-4562-b3fc-2c963f66afa6?allowBreakingChanges=true
Content-Type: application/json

{
"name": {
"values": [
{ "culture": "en-US", "value": "Customer Rating" }
]
},
"isCollection": false,
"isLocalized": false,
"fieldType": 5,
"fieldValidations": []
}