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 contains the given value, matched case-insensitively (substring match, suitable for type-ahead search).
appIdLongNoExternal application the custom data belongs to. Optional; when omitted, the application is resolved from the authenticated context. Custom data definitions belong to the application's owner tenant: creating, updating or deleting them requires being a system administrator of that owner tenant, while reading them is allowed for the owner and any tenant the application is visible to (public, or explicitly allowed for a private application). A request with neither an application context nor an explicit appId is rejected.
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

400 Bad Request

Invalid request. Missing external application context.

401 Unauthorized

Not authenticated — valid session required.

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. Custom data definitions belong to the application's owner tenant: creating, updating or deleting them requires being a system administrator of that owner tenant, while reading them is allowed for the owner and any tenant the application is visible to (public, or explicitly allowed for a private application). A request with neither an application context nor an explicit appId is rejected.

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
idLongNoCustom data definition instance ID.
nameStringNoHuman-readable name of the custom data definition.
boClassIdLongNoID of the business object class the custom data definition is attached to.
typeKeyStringNoKey of the business object class the custom data definition is attached to.
appIdLongNoOwning application.
fieldsListNoThe custom fields that make up this definition.

400 Bad Request

Invalid request. Possible causes: • Missing required field (name, boClassId, fields, or a field's displayName/fieldType) • boClassId does not reference an existing business object class • Unsupported fieldType • Duplicate displayName within the business object class • No storage slots remain for an attribute type • Invalid jsonSchema • Missing external application context

401 Unauthorized

Not authenticated — valid session required.

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. Custom data definitions belong to the application's owner tenant: creating, updating or deleting them requires being a system administrator of that owner tenant, while reading them is allowed for the owner and any tenant the application is visible to (public, or explicitly allowed for a private application). A request with neither an application context nor an explicit appId is rejected.

Responses

200 OK

Custom data definition retrieved successfully.

DTO: CustomDataDefinitionResponseDTO

{
  "id": 1001,
  "name": "example-value",
  "boClassId": 1001,
  "typeKey": "example-value",
  "appId": 1001,
  "fields": [
    {}
  ]
}
FieldTypeNullableDescription
idLongNoCustom data definition instance ID.
nameStringNoHuman-readable name of the custom data definition.
boClassIdLongNoID of the business object class the custom data definition is attached to.
typeKeyStringNoKey of the business object class the custom data definition is attached to.
appIdLongNoOwning application.
fieldsListNoThe custom fields that make up this definition.

400 Bad Request

Invalid request. Missing external application context.

401 Unauthorized

Not authenticated — valid session required.

404 Not Found

Custom data definition not found.

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. Custom data definitions belong to the application's owner tenant: creating, updating or deleting them requires being a system administrator of that owner tenant, while reading them is allowed for the owner and any tenant the application is visible to (public, or explicitly allowed for a private application). A request with neither an application context nor an explicit appId is rejected.

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
idLongNoCustom data definition instance ID.
nameStringNoHuman-readable name of the custom data definition.
boClassIdLongNoID of the business object class the custom data definition is attached to.
typeKeyStringNoKey of the business object class the custom data definition is attached to.
appIdLongNoOwning application.
fieldsListNoThe custom fields that make up this definition.

400 Bad Request

Invalid request. Missing required field (name).

401 Unauthorized

Not authenticated — valid session required.

404 Not Found

Custom data definition not found.

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. Custom data definitions belong to the application's owner tenant: creating, updating or deleting them requires being a system administrator of that owner tenant, while reading them is allowed for the owner and any tenant the application is visible to (public, or explicitly allowed for a private application). A request with neither an application context nor an explicit appId is rejected.

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 updated successfully.

DTO: CustomDataDefinitionResponseDTO

{
  "id": 1001,
  "name": "example-value",
  "boClassId": 1001,
  "typeKey": "example-value",
  "appId": 1001,
  "fields": [
    {}
  ]
}
FieldTypeNullableDescription
idLongNoCustom data definition instance ID.
nameStringNoHuman-readable name of the custom data definition.
boClassIdLongNoID of the business object class the custom data definition is attached to.
typeKeyStringNoKey of the business object class the custom data definition is attached to.
appIdLongNoOwning application.
fieldsListNoThe custom fields that make up this definition.

401 Unauthorized

Not authenticated — valid session required.

404 Not Found

Custom data definition not found.

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. Custom data definitions belong to the application's owner tenant: creating, updating or deleting them requires being a system administrator of that owner tenant, while reading them is allowed for the owner and any tenant the application is visible to (public, or explicitly allowed for a private application). A request with neither an application context nor an explicit appId is rejected.

Responses

200 OK

Custom data definition retired successfully.

DTO: CustomDataDefinitionDeleteResponseDTO

{
  "id": 1001,
  "active": true,
  "deletedAt": "2024-01-15T09:30:00Z"
}
FieldTypeNullableDescription
idLongNoThe ID of the deleted custom field definition.
activebooleanNoWhether the definition is still active.
deletedAtLocalDateTimeNoTimestamp when the definition was deleted, in ISO-8601 format.

401 Unauthorized

Not authenticated — valid session required.

404 Not Found

Custom data definition not found.

Example

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

Child Routes

PathMethodsSummaryagents.md
/v3/custom-data/definition/typeGEThttps://agents.1health.io/public/demo/api/v3/custom-data/definition/type/agents.md
/v3/custom-data/definition/{id}GET, PUT, PATCH, DELETEfield, statisticshttps://agents.1health.io/public/demo/api/v3/custom-data/definition/_id_/agents.md

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