Data Types
Tags: collections, data
Custom data type management
In the product: Forms
Resources
Request and response models used by the endpoints on this page.
DataTypeMemberRoleAccessResponse
| Field | Type | Required | Description |
|---|---|---|---|
accessMode | Integer | ✓ | |
memberRoleId | Integer | ✓ | |
memberRoleName | String | ✓ |
Example:
{
"memberRoleId": 0 // Integer,
"memberRoleName": "string" // String,
"accessMode": 0 // Integer
}
DataTypeResponse
| Field | Type | Required | Description |
|---|---|---|---|
accessMode | Integer | ||
archived | Boolean | Default: False | |
categories | Array | ✓ | |
createRules | Array | ✓ | |
createdAt | DateTime | ✓ | |
description | String | ✓ | |
fields | Array | ✓ | |
id | Integer | ✓ | |
isCollection | Boolean | ✓ | |
memberRoleAccess | Array | ||
name | String | ✓ | |
ownerId | Integer | ||
pinned | Boolean | ||
prompt | String | ✓ | |
recordCount | Integer | ||
recordScope | String | ✓ | |
sensitivity | String | ✓ | |
slug | String | ✓ | |
updateRules | Array | ✓ | |
updatedAt | DateTime | ✓ | |
uuid | String | ✓ |
Example:
{
"id": 0 // Integer,
"name": "string" // String,
"uuid": "string" // String,
"slug": "string" // String,
"accessMode": 0 // Integer, optional,
"description": "string" // String,
"prompt": "string" // String,
"isCollection": false // Boolean,
"pinned": false // Boolean, optional,
"archived": false // Boolean, optional, default: False,
"ownerId": 0 // Integer, optional,
"recordScope": "string" // String,
"sensitivity": "string" // String,
"categories": "string" // Array<String>,
"createdAt": "2024-01-01T00:00:00Z" // DateTime,
"updatedAt": "2024-01-01T00:00:00Z" // DateTime,
"createRules": [] // Array<EventRuleResponse>,
"updateRules": [] // Array<EventRuleResponse>,
"fields": [] // Array<SchemaField>,
"memberRoleAccess": [] // Array<DataTypeMemberRoleAccessResponse>, optional, default: PydanticUndefined,
"recordCount": 0 // Integer, optional
}
EventRuleResponse
| Field | Type | Required | Description |
|---|---|---|---|
actionParams | Dict[str, Any] | ✓ | |
actionType | <enum EventRuleActionType | ✓ | |
active | Boolean | ✓ | |
appConnectionId | Integer | ||
calendarEventTypeId | Integer | ✓ | |
calendarId | Integer | ✓ | |
celBlockedAt | DateTime | ||
conditions | String | ✓ | |
createdAt | DateTime | ✓ | |
dataTypeId | Integer | ✓ | |
dataTypeName | String | ||
delay | Integer | ✓ | |
error | String | ✓ | |
errorMessage | String | ✓ | |
eventType | <enum EventRuleEventType | ✓ | |
failedAt | DateTime | ✓ | |
id | Integer | ✓ | |
journeyId | Integer | ||
journeyStepId | Integer | ✓ | |
name | String | ✓ | |
objectType | <enum EventRuleObjectType | ✓ | |
order | Integer | ✓ | |
routineId | Integer | ✓ | |
taskId | Integer | ✓ | |
taskName | String | ||
taskWorkflowId | Integer | ||
triggerParams | Dict[str, Any] | ✓ | |
updatedAt | DateTime | ✓ | |
uuid | String | ✓ | |
workflowRevisionId | Integer | ✓ |
Example:
{
"id": 0 // Integer,
"uuid": "string" // String,
"objectType": null // <enum EventRuleObjectType,
"name": "string" // String,
"eventType": null // <enum EventRuleEventType,
"conditions": "string" // String,
"actionType": null // <enum EventRuleActionType,
"actionParams": {} // Dict[str, Any],
"triggerParams": {} // Dict[str, Any],
"active": false // Boolean,
"createdAt": "2024-01-01T00:00:00Z" // DateTime,
"updatedAt": "2024-01-01T00:00:00Z" // DateTime,
"taskId": 0 // Integer,
"taskName": "string" // String, optional,
"taskWorkflowId": 0 // Integer, optional,
"dataTypeId": 0 // Integer,
"dataTypeName": "string" // String, optional,
"routineId": 0 // Integer,
"workflowRevisionId": 0 // Integer,
"calendarId": 0 // Integer,
"calendarEventTypeId": 0 // Integer,
"journeyStepId": 0 // Integer,
"journeyId": 0 // Integer, optional,
"appConnectionId": 0 // Integer, optional,
"error": "string" // String,
"errorMessage": "string" // String,
"failedAt": "2024-01-01T00:00:00Z" // DateTime,
"celBlockedAt": "2024-01-01T00:00:00Z" // DateTime, optional,
"delay": 0 // Integer,
"order": 0 // Integer
}
SchemaField
| Field | Type | Required | Description |
|---|---|---|---|
adminOnly | Boolean | Whether only admins can see this field (default: False) | |
categories | Array<Literal[personal, identifier, phi, credential]> | Regulatory or content categories for audit and policy | |
celFunction | String | CEL expression that computes this field's value. CONSTRAINT: Can ONLY reference regular fields (TEXT, NUMBER, DATE, etc.). Cannot reference other FUNCTION fields. Syntax: record.data.<field_slug>. Example: 'record.data.score1 + record.data.score2' | |
defaultValue | Any | Default value for the field | |
description | String | Optional field description | |
fieldType | Union[Literal[enum, email, phone, text, longtext, number, integer, boolean, date, datetime, time_of_day, us_zip_code, array, object, function], DataFieldType] | Field type (text, email, enum, etc.) (default: text) | |
name | String | ✓ | Display name for the field |
options | Array | Options for enum fields as {label, value} objects. | |
order | Integer | Deprecated: Display order is now determined by array position | |
referencedTypeId | Integer | Referenced DataType ID for reference fields | |
required | Boolean | Whether field is required (default: False) | |
sensitivity | Literal[public, internal, confidential, restricted, secret] | Disclosure severity for audit and access policy (default: confidential) | |
shouldIndex | Boolean | Whether to index this field (default: False) | |
slug | String | ✓ | Unique field identifier |
validateCel | String | CEL expression for cross-field validation. Context: 'value' (current field value), 'record.data.<field_slug>' (other fields). Returns: true if valid, or a string error message if invalid. CONSTRAINT: Can only reference non-FUNCTION fields. Example: 'value >= record.data.min_score' or 'value < record.data.min_score ? "Must be >= " + string(record.data.min_score) : true' |
Example:
{
"slug": "string" // String, Unique field identifier,
"name": "string" // String, Display name for the field,
"description": "string" // String, optional, Optional field description,
"fieldType": 0 // Union[Literal[enum, email, phone, text, longtext, number, integer, boolean, date, datetime, time_of_day, us_zip_code, array, object, function], DataFieldType], optional, default: text, Field type (text, email, enum, etc.),
"required": false // Boolean, optional, default: False, Whether field is required,
"order": 0 // Integer, optional, Deprecated: Display order is now determined by array position,
"options": [] // Array<EnumOption>, optional, Options for enum fields as {label, value} objects.,
"referencedTypeId": 0 // Integer, optional, Referenced DataType ID for reference fields,
"shouldIndex": false // Boolean, optional, default: False, Whether to index this field,
"adminOnly": false // Boolean, optional, default: False, Whether only admins can see this field,
"defaultValue": null // Any, optional, Default value for the field,
"celFunction": "string" // String, optional, CEL expression that computes this field's value. CONSTRAINT: Can ONLY reference regular fields (TEXT, NUMBER, DATE, etc.). Cannot reference other FUNCTION fields. Syntax: record.data.<field_slug>. Example: 'record.data.score1 + record.data.score2',
"validateCel": "string" // String, optional, CEL expression for cross-field validation. Context: 'value' (current field value), 'record.data.<field_slug>' (other fields). Returns: true if valid, or a string error message if invalid. CONSTRAINT: Can only reference non-FUNCTION fields. Example: 'value >= record.data.min_score' or 'value < record.data.min_score ? "Must be >= " + string(record.data.min_score) : true',
"sensitivity": null // Literal[public, internal, confidential, restricted, secret], optional, default: confidential, Disclosure severity for audit and access policy,
"categories": [] // Array<Literal[personal, identifier, phi, credential]>, optional, default: PydanticUndefined, Regulatory or content categories for audit and policy
}
Endpoints
GET /api/v2/w/{workspace_uuid}/data-types- ListPOST /api/v2/w/{workspace_uuid}/data-types- CreateGET /api/v2/w/{workspace_uuid}/data-types/slug/{slug}- SlugPOST /api/v2/w/{workspace_uuid}/data-types/validate-slug- Validate SlugDELETE /api/v2/w/{workspace_uuid}/data-types/{data_type_id}- Delete Data Type IdGET /api/v2/w/{workspace_uuid}/data-types/{data_type_id}- Get Data Type IdPUT /api/v2/w/{workspace_uuid}/data-types/{data_type_id}- Update Data Type Id
List
GET /api/v2/w/{workspace_uuid}/data-types
Description:
List all data types in the workspace.
Retrieves all custom data type definitions created in the workspace, including their field schemas, record counts, and configuration. Data types define structured data models that can be used to store and organize workspace information.
Query Parameters:
archived: Filter by archived status (boolean, default: false)
Response: Returns an array of DataTypeResponse objects, each containing the data type's ID, name, slug, description, fields (with types and validation rules), and record count.
Permissions: Requires authenticated member session. All workspace members can list data types.
Error Responses:
401 Unauthorized: Missing or invalid authentication
Related Endpoints:
POST /data-types- Create a new data typeGET /data-types/{data_type_id}- Get a specific data typeGET /data-types/{data_type_id}/records- List records for a data type
Authorization: Requires datatypes:read scope
Parameters:
archived(Boolean)sortBy(DataTypeSortField)sortOrder(SortOrder)
Response: List of DataTypeResponse
Create
POST /api/v2/w/{workspace_uuid}/data-types
Description:
Create a new custom data type.
Defines a new structured data model in the workspace with custom fields and validation rules. Data types can represent any entity (customers, products, tickets, etc.) and are used by assistants to store and retrieve structured information.
Request Body:
name: Display name for the data typeslug: URL-friendly identifier (auto-generated if not provided)description: Optional description of the data type's purposefields: Array of field definitions with name, type, validation, and indexing options
Response: Returns the created DataTypeResponse object with all field definitions and configuration.
Permissions: Requires appropriate admin scope to create data types.
Error Responses:
400 Bad Request: Invalid request parameters or duplicate slug401 Unauthorized: Missing or invalid authentication403 Forbidden: User lacks appropriate admin scope500 Internal Server Error: Database error during creation
Related Endpoints:
GET /data-types- List all data typesPUT /data-types/{data_type_id}- Update data type definitionPOST /data-types/{data_type_id}/records- Create records of this type
Authorization: Requires datatypes:write scope
Parameters:
data_type(CreateDataTypeRequest)
Response: See DataTypeResponse
Slug
GET /api/v2/w/{workspace_uuid}/data-types/slug/{slug}
Description:
Get a data type by its slug identifier.
Retrieves complete data type details using its URL-friendly slug identifier. Returns the full schema including all field definitions, types, and validation rules.
Path Parameters:
slug: URL-friendly slug identifier for the data type
Response: Returns a DataTypeResponse object with complete field schema and configuration.
Permissions: Requires authenticated member session.
Error Responses:
401 Unauthorized: Missing or invalid authentication404 Not Found: Data type with specified slug not found
Related Endpoints:
GET /data-types/{data_type_id}- Get data type by numeric IDGET /data-types- List all data typesGET /data-types/{data_type_id}/records- Get records for this data type
Authorization: Requires datatypes:read scope
Parameters:
slug(String)
Response: See DataTypeResponse
Validate Slug
POST /api/v2/w/{workspace_uuid}/data-types/validate-slug
Description:
Validate if a data type slug is available.
Checks if the given slug conflicts with existing data types and suggests a unique alternative if needed.
Request Body:
slug: The slug to validateexcludeId: Optional data type ID to exclude (for updates)
Response:
available: Whether the slug is availablesuggestedSlug: A suggested unique slug if the original is taken
Permissions: Requires valid workspace membership.
Authorization: Requires datatypes:write scope
Parameters:
request- See ValidateSlugRequest
Response: See ValidateSlugResponse
Delete Data Type Id
DELETE /api/v2/w/{workspace_uuid}/data-types/{data_type_id}
Description:
Permanently delete a data type and all its records.
Removes a data type definition along with all associated records and field indexes. This operation is irreversible and will delete all data stored in records of this type. Field indexes are removed via background tasks.
Path Parameters:
id: Data type ID to delete
Response: Returns a status object with "deleted" confirmation.
Permissions: Requires appropriate admin scope to delete data types.
Error Responses:
401 Unauthorized: Missing or invalid authentication403 Forbidden: User lacks appropriate admin scope404 Not Found: Data type not found500 Internal Server Error: Database error during deletion
Related Endpoints:
GET /data-types- List remaining data typesPOST /data-types/{data_type_id}/export- Export data before deletionGET /data-types/{data_type_id}/records- View records that will be deleted
Authorization: Requires datatypes:admin scope
Parameters:
data_type_id(Integer)
Get Data Type Id
GET /api/v2/w/{workspace_uuid}/data-types/{data_type_id}
Description:
Get detailed information about a specific data type.
Retrieves complete data type configuration including all field definitions, record count, and metadata. Includes field types, validation rules, and indexing status. This endpoint accepts either the numeric data type ID or stable UUID.
Path Parameters:
data_type_id: Data type numeric ID or UUID to retrieve
Response: Returns a DataTypeResponse object with complete field schema, record count, and all configuration details.
Permissions: Requires authenticated member session.
Error Responses:
401 Unauthorized: Missing or invalid authentication404 Not Found: Data type not found
Related Endpoints:
GET /data-types/slug/{slug}- Get data type by slugPUT /data-types/{data_type_id}- Update data typeGET /data-types/{data_type_id}/records- List records for this data type
Authorization: Requires datatypes:read scope
Parameters:
data_type_id(String)
Response: See DataTypeResponse
Update Data Type Id
PUT /api/v2/w/{workspace_uuid}/data-types/{data_type_id}
Description:
Update an existing data type definition.
Modifies a data type's metadata, field definitions, or configuration. Can add new fields, update field properties, or modify validation rules. Existing records are preserved and automatically adapt to schema changes.
Path Parameters:
id: Data type ID to update
Request Body:
name: Updated display name (optional)description: Updated description (optional)fields: Updated field definitions array (optional)
Response: Returns the updated DataTypeResponse object with refreshed schema and configuration.
Permissions: Requires appropriate admin scope to update data types.
Error Responses:
400 Bad Request: Invalid update parameters or validation error401 Unauthorized: Missing or invalid authentication403 Forbidden: User lacks appropriate admin scope404 Not Found: Data type not found500 Internal Server Error: Database error during update
Related Endpoints:
GET /data-types/{data_type_id}- Get current data type definitionDELETE /data-types/{data_type_id}- Delete the data typeGET /data-types/{data_type_id}/records- View records affected by schema changes
Authorization: Requires datatypes:write scope
Parameters:
data_type_id(Integer)data_type(UpdateDataTypeRequest)
Response: See DataTypeResponse