documentation

Patient Vault v3 API

Custom Fields / Definition / Field

/v3/custom-data/definition/{id}/field endpoint reference.

URL: https://demo.1health.io/api/v3/custom-data/definition/{id}/field

No description available in the API specification.

Endpoints

EndpointMethodDescription
/v3/custom-data/definition/{id}/fieldPOSTAdd a custom field to a definition

POST/v3/custom-data/definition/{id}/field

Add a custom field to a definition

Overview

Adds a single custom field to an existing custom data definition. The caller provides a business displayName and fieldType; the platform automatically allocates the next available storage slot for the field's attribute type.

Authorization

Bearer JWT required. See the authentication guide.

Path Parameters

ParameterTypeRequiredDescription
idLongYesThe ID of the custom data definition to add the field to.

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: CustomDataFieldDefinitionRequestDTO

{
  "displayName": "example-value",
  "fieldType": "example-value",
  "jsonSchema": "example-value"
}
FieldTypeRequiredConstraintsDescription
displayNamestringYesMust be unique within the business object class for the caller's application.Display name of the custom field.
fieldTypestringYesMatched case-insensitively. Accepted values: INTEGER, INT, DECIMAL, TEXT, DATE, TIMESTAMP, JSON, JSONB.The attribute type of the custom field.
jsonSchemastringNoOnly applicable when fieldType is JSON; ignored for other types. Must be well-formed JSON when provided.JSON schema used to validate values of this field.

Responses

201 Created

Custom field added successfully.

DTO: CustomDataFieldDefinitionViewDTO

{
  "id": 1001,
  "name": "example-value",
  "displayName": "example-value",
  "fieldKey": "example-value",
  "fieldType": "example-value",
  "jsonSchema": "example-value"
}
FieldTypeNullableDescription
idLongNoCustom field instance ID.
nameStringNoSanitized bo-core name of the custom field, derived from the display name with special characters removed.
displayNameStringNoDisplay name of the custom field.
fieldKeyStringNoSystem-generated camelCase key derived from the field's name, used for programmatic lookup and search.
fieldTypeStringNoThe attribute type of the custom field.
jsonSchemaStringYesJSON schema used to validate values of this field, when applicable.

400 Bad Request

Invalid request.

  • Missing required displayName or fieldType
  • Unsupported fieldType
  • Duplicate displayName within the definition
  • No storage slots remain for the attribute type
  • Invalid jsonSchema
  • Missing external application context

401 Unauthorized

Not authenticated — valid session required.

404 Not Found

Custom data definition not found.

Example

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

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