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
| Endpoint | Method | Description |
|---|---|---|
| /v3/custom-data/definition/{id}/field | POST | Add 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
| Parameter | Type | Required | Description |
|---|---|---|---|
| id | Long | Yes | The ID of the custom data definition to add the field to. |
Query Parameters
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
| appId | Long | No | External 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"
}
| Field | Type | Required | Constraints | Description |
|---|---|---|---|---|
| displayName | string | Yes | Must be unique within the business object class for the caller's application. | Display name of the custom field. |
| fieldType | string | Yes | Matched case-insensitively. Accepted values: INTEGER, INT, DECIMAL, TEXT, DATE, TIMESTAMP, JSON, JSONB. | The attribute type of the custom field. |
| jsonSchema | string | No | Only 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"
}
| Field | Type | Nullable | Description |
|---|---|---|---|
| id | Long | No | Custom field instance ID. |
| name | String | No | Sanitized bo-core name of the custom field, derived from the display name with special characters removed. |
| displayName | String | No | Display name of the custom field. |
| fieldKey | String | No | System-generated camelCase key derived from the field's name, used for programmatic lookup and search. |
| fieldType | String | No | The attribute type of the custom field. |
| jsonSchema | String | Yes | JSON 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"}'
Navigation
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