documentation

Patient Vault v3 API

Custom Fields / Definition

/v3/custom-data/definition endpoint reference.

URL: https://demo.1health.io/api/v3/custom-data/definition

APIs for defining custom fields on a business object class. Supports creating, replacing, partially updating, and retiring definitions. The tenant and application are resolved from the authenticated context; storage slots are allocated automatically.

Endpoints

EndpointMethodDescription
/v3/custom-data/definitionGETList all custom data definitions for an application
/v3/custom-data/definitionPOSTCreate a custom data definition
/v3/custom-data/definition/{id}GETRetrieve a custom data definition by ID
/v3/custom-data/definition/{id}PUTReplace a custom data definition
/v3/custom-data/definition/{id}PATCHPartially update a custom data definition
/v3/custom-data/definition/{id}DELETERetire a custom data definition

GET/v3/custom-data/definition

List all custom data definitions for an application

Overview

Returns all custom data definitions defined for the resolved application, across every business object class, within the authenticated tenant and application context.

Authorization

Bearer JWT required. See the authentication guide.

Query Parameters

ParameterTypeRequiredDefaultDescription
includeFieldsbooleanNofalseWhen true, each definition is returned together with its fields; when false only the definition metadata is returned. Defaults to false.
nameStringNoOptional filter that restricts the result to definitions whose name matches the given value case-insensitively (exact match, not a substring).
appIdLongNoExternal application the custom data belongs to. Optional; when omitted, the application is resolved from the authenticated context.
pageintNo0Zero-based page number.
sizeintNo50Page size.

Responses

200 OK

Custom data definitions retrieved successfully.

DTO: Page

{
  "data": [
    {}
  ],
  "pageNumber": 1,
  "pageSize": 1,
  "offset": 1001,
  "emptyPage": true,
  "firstPage": true,
  "lastPage": true,
  "numberOfElements": 1001,
  "totalElements": 1001,
  "totalPages": 1
}
FieldTypeNullableDescription
dataListNo
pageNumberintNo
pageSizeintNo
offsetlongNo
emptyPagebooleanNo
firstPagebooleanNo
lastPagebooleanNo
numberOfElementslongNo
totalElementslongNo
totalPagesintNo

Example

curl -X GET "https://demo.1health.io/api/v3/custom-data/definition" \
  -H "Authorization: Bearer $TOKEN"

POST/v3/custom-data/definition

Create a custom data definition

Overview

Defines a custom data definition on a business object class together with its fields. The caller provides a definition name, the target boClassId, and the list of fields (each a business displayName and fieldType); the platform automatically allocates the next available storage slot for each field.

Authorization

Bearer JWT required. See the authentication guide.

Query Parameters

ParameterTypeRequiredDefaultDescription
appIdLongNoExternal application the custom data belongs to. Optional; when omitted, the application is resolved from the authenticated context.

Request Body

Content-Type: application/json · DTO: CustomDataDefinitionRequestDTO

{
  "name": "example-value",
  "boClassId": "example-value",
  "fields": "example-value"
}
FieldTypeRequiredConstraintsDescription
namestringYesHuman-readable name of the custom data definition.
boClassIdintegerYesID of the business object class the custom data definition is attached to.
fieldsarrayYesThe custom fields that make up this definition.

Responses

201 Created

Custom field definition created successfully.

DTO: CustomDataDefinitionResponseDTO

{
  "id": 1001,
  "name": "example-value",
  "boClassId": 1001,
  "typeKey": "example-value",
  "appId": 1001,
  "fields": [
    {}
  ]
}
FieldTypeNullableDescription
idLongYesCustom data definition instance ID.
nameStringYesHuman-readable name of the custom data definition.
boClassIdLongYesID of the business object class the custom data definition is attached to.
typeKeyStringYesKey of the business object class the custom data definition is attached to.
appIdLongYesOwning application.
fieldsListYesThe custom fields that make up this definition.

Example

curl -X POST "https://demo.1health.io/api/v3/custom-data/definition" \
  -H "Authorization: Bearer $TOKEN" \
  -H "Content-Type: application/json" -d '{"name": "example-value", "boClassId": "example-value", "fields": "example-value"}'

GET/v3/custom-data/definition/{id}

Retrieve a custom data definition by ID

Overview

Returns a single custom data definition with its fields by its ID, within the authenticated tenant and application context.

Authorization

Bearer JWT required. See the authentication guide.

Path Parameters

ParameterTypeRequiredDescription
idLongYesThe ID of the custom data definition to retrieve.

Query Parameters

ParameterTypeRequiredDefaultDescription
appIdLongNoExternal application the custom data belongs to. Optional; when omitted, the application is resolved from the authenticated context.

Responses

200 OK

Custom data definition retrieved successfully.

DTO: CustomDataDefinitionResponseDTO

{
  "id": 1001,
  "name": "example-value",
  "boClassId": 1001,
  "typeKey": "example-value",
  "appId": 1001,
  "fields": [
    {}
  ]
}
FieldTypeNullableDescription
idLongYesCustom data definition instance ID.
nameStringYesHuman-readable name of the custom data definition.
boClassIdLongYesID of the business object class the custom data definition is attached to.
typeKeyStringYesKey of the business object class the custom data definition is attached to.
appIdLongYesOwning application.
fieldsListYesThe custom fields that make up this definition.

Example

curl -X GET "https://demo.1health.io/api/v3/custom-data/definition/1001" \
  -H "Authorization: Bearer $TOKEN"

PUT/v3/custom-data/definition/{id}

Replace a custom data definition

Overview

Replaces the mutable properties of an existing custom data definition. Only the definition name may be changed; its fields are managed separately.

Authorization

Bearer JWT required. See the authentication guide.

Path Parameters

ParameterTypeRequiredDescription
idLongYesThe ID of the custom data definition to replace.

Query Parameters

ParameterTypeRequiredDefaultDescription
appIdLongNoExternal application the custom data belongs to. Optional; when omitted, the application is resolved from the authenticated context.

Request Body

Content-Type: application/json · DTO: CustomDataDefinitionUpdateRequestDTO

{
  "name": "example-value"
}
FieldTypeRequiredConstraintsDescription
namestringYesNew human-readable name of the custom data definition. Required for a full replace (PUT); optional for a partial update (PATCH), where an omitted value leaves the name unchanged.

Responses

200 OK

Custom data definition replaced successfully.

DTO: CustomDataDefinitionResponseDTO

{
  "id": 1001,
  "name": "example-value",
  "boClassId": 1001,
  "typeKey": "example-value",
  "appId": 1001,
  "fields": [
    {}
  ]
}
FieldTypeNullableDescription
idLongYesCustom data definition instance ID.
nameStringYesHuman-readable name of the custom data definition.
boClassIdLongYesID of the business object class the custom data definition is attached to.
typeKeyStringYesKey of the business object class the custom data definition is attached to.
appIdLongYesOwning application.
fieldsListYesThe custom fields that make up this definition.

Example

curl -X PUT "https://demo.1health.io/api/v3/custom-data/definition/1001" \
  -H "Authorization: Bearer $TOKEN" \
  -H "Content-Type: application/json" -d '{"name": "example-value"}'

PATCH/v3/custom-data/definition/{id}

Partially update a custom data definition

Overview

Updates only the mutable properties provided in the request body. Properties not included are left unchanged.

Authorization

Bearer JWT required. See the authentication guide.

Path Parameters

ParameterTypeRequiredDescription
idLongYesThe ID of the custom data definition to partially update.

Query Parameters

ParameterTypeRequiredDefaultDescription
appIdLongNoExternal application the custom data belongs to. Optional; when omitted, the application is resolved from the authenticated context.

Request Body

Content-Type: application/json · DTO: CustomDataDefinitionUpdateRequestDTO

{
  "name": "example-value"
}
FieldTypeRequiredConstraintsDescription
namestringNoNew human-readable name of the custom data definition. Required for a full replace (PUT); optional for a partial update (PATCH), where an omitted value leaves the name unchanged.

Responses

200 OK

Custom data definition updated successfully.

DTO: CustomDataDefinitionResponseDTO

{
  "id": 1001,
  "name": "example-value",
  "boClassId": 1001,
  "typeKey": "example-value",
  "appId": 1001,
  "fields": [
    {}
  ]
}
FieldTypeNullableDescription
idLongYesCustom data definition instance ID.
nameStringYesHuman-readable name of the custom data definition.
boClassIdLongYesID of the business object class the custom data definition is attached to.
typeKeyStringYesKey of the business object class the custom data definition is attached to.
appIdLongYesOwning application.
fieldsListYesThe custom fields that make up this definition.

Example

curl -X PATCH "https://demo.1health.io/api/v3/custom-data/definition/1001" \
  -H "Authorization: Bearer $TOKEN" \
  -H "Content-Type: application/json" -d '{"name": "example-value"}'

DELETE/v3/custom-data/definition/{id}

Retire a custom data definition

Overview

Soft-deletes a custom data definition together with all of its fields. The definition and its fields are hidden from default queries but preserved for audit.

Authorization

Bearer JWT required. See the authentication guide.

Path Parameters

ParameterTypeRequiredDescription
idLongYesThe ID of the custom data definition to retire.

Query Parameters

ParameterTypeRequiredDefaultDescription
appIdLongNoExternal application the custom data belongs to. Optional; when omitted, the application is resolved from the authenticated context.

Responses

200 OK

Custom data definition retired successfully.

DTO: CustomDataDefinitionDeleteResponseDTO

{
  "id": 1001,
  "active": true,
  "deletedAt": "example-value"
}
FieldTypeNullableDescription
idLongNoThe ID of the deleted custom field definition.
activebooleanNoWhether the definition is still active.
deletedAtstringNoTimestamp when the definition was deleted, in ISO-8601 format.

Example

curl -X DELETE "https://demo.1health.io/api/v3/custom-data/definition/1001" \
  -H "Authorization: Bearer $TOKEN"

Child Routes

Parent: https://agents.1health.io/public/demo/api/v3/custom-data/agents.md · Site guide: https://agents.1health.io/public/demo/api/agents.md