Computed Fields API
Programmatic access to Computed Fields uses the Field endpoints on the Qualytics REST API. The requests below cover creation, update, deletion, and read. Requests share the same base URL and Bearer token authentication as the rest of the platform API.
- Base URL. Your deployment's platform host (for example,
https://<your-tenant>.qualytics.io/api). - Auth. Bearer token in the
Authorizationheader. See Access Tokens to create one.
Complete API Reference
The endpoints below are illustrative. For the full request and response schemas, live examples, and every field that each endpoint accepts, see the interactive API reference at demo.qualytics.io/api/docs.
Permissions
- Create, edit, delete: the Editor team permission on the parent datastore, or the Author team permission when the caller is (or will be) the owner of the Computed Field (Hybrid Gate).
- Reassign ownership (setting
owner_idto a different user on Update): always requires the Editor team permission. - View, list: the Reporter team permission or above.
Payload Shape
A Computed Field is a specialization of the generic Field payload. Common fields:
| Property | Type | Required | Default | Description |
|---|---|---|---|---|
container_id |
integer | Yes (Create) | - | The container the Computed Field belongs to. Set at creation; cannot be changed on Update. |
name |
string | Yes | - | Max 255 characters. Must be unique inside the container. |
transformation_type |
enum | Yes | - | One of cast, cleaned_entity_name, convert_formatted_numeric, custom_expression. |
transformation_config |
object | Yes | - | Type-specific configuration. Shape depends on transformation_type (source field, target type, term settings, or SQL expression). See the interactive reference for the full schema per type. |
description |
string | No | null |
Max 255 characters. |
additional_metadata |
object | No | null |
Freeform key-value pairs. |
Create
Endpoint: POST /fields
Permission: Editor team permission on the parent datastore, or Author when owner_id is omitted or set to the caller's own user id.
Create a Cast field
curl -X POST "https://<your-tenant>.qualytics.io/api/fields" \
-H "Authorization: Bearer $QUALYTICS_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"container_id": 34,
"name": "order_total_numeric",
"transformation_type": "cast",
"transformation_config": {
"source_field": "order_total",
"target_type": "decimal(10,2)"
},
"description": "Numeric version of order_total for aggregation checks."
}'
Create a Custom Expression field
curl -X POST "https://<your-tenant>.qualytics.io/api/fields" \
-H "Authorization: Bearer $QUALYTICS_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"container_id": 34,
"name": "full_name",
"transformation_type": "custom_expression",
"transformation_config": {
"expression": "concat_ws('\'' '\'', first_name, last_name)"
},
"description": "First and last name concatenated with a space."
}'
Returns the created Field object with its assigned id. The Computed Field's first values populate on the next profile of the container.
Update
Endpoint: PUT /fields/{id}
Permission: Editor team permission on the parent datastore, or Author when the caller is the current owner. Reassigning ownership always requires Editor.
Update a Custom Expression
curl -X PUT "https://<your-tenant>.qualytics.io/api/fields/128" \
-H "Authorization: Bearer $QUALYTICS_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"name": "full_name",
"transformation_type": "custom_expression",
"transformation_config": {
"expression": "concat_ws('\'' '\'', first_name, middle_name, last_name)"
},
"description": "First, middle, and last name concatenated with a space."
}'
The container_id cannot be changed. Saving an edit re-registers the transformation on the container; the next profile computes values against the new definition.
Delete
Endpoint: DELETE /fields/{id}
Permission: Editor team permission on the parent datastore, or Author when the caller is the current owner.
Delete a Computed Field
Returns 204 No Content on success. The Computed Field definition, the derived output, and any quality checks that reference it are removed. Source fields are not affected.
Read
Endpoint: GET /fields/{id} for a single field, GET /fields?container_id={id} to list every field (including Computed Fields) inside a container.
Permission: Reporter team permission on the parent datastore or above.
Error Responses
| Status | Meaning |
|---|---|
400 Bad Request |
Payload validation failed: missing required field, unknown transformation_type, or transformation_config invalid for the selected type. |
403 Forbidden |
Caller lacks the required team permission for the operation. |
404 Not Found |
Container or field does not exist, or is not visible to the caller. |
409 Conflict |
A field with the same name already exists in the container. |
422 Unprocessable Entity |
Payload does not match the schema: wrong field types, or a required top-level field is missing. |