Skip to main content

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.

CreateDataTypeRequest​

FieldTypeRequiredDescription
adminOnlyBooleanDefault: False
descriptionString
eventRulesArray<EventRuleData> | null
fieldsArray<SchemaField>
isCollectionBooleanDefault: False
nameString✓
pinnedBooleanDefault: False
promptString
recordScope<enum DataTypeRecordScopeDefault: member
slugString✓
webhookEventsEnabledBooleanDefault: False

Example:

{
"name": "string",
"slug": "string",
"isCollection": false,
"pinned": false,
"webhookEventsEnabled": false,
"recordScope": "member",
"adminOnly": false
}

DataTypeResponse​

FieldTypeRequiredDescription
accessModeInteger
adminOnlyBooleanDefault: False
archivedBooleanDefault: False
categoriesArray✓
createdAtDateTime✓
descriptionString✓
eventRulesArray<EventRuleResponse>✓
fieldsArray<SchemaField>✓
idInteger✓
isCollectionBoolean✓
nameString✓
ownerIdInteger
pinnedBoolean
promptString✓
recordCountInteger
recordScopeString✓
sensitivityString✓
slugString✓
updatedAtDateTime✓
uuidString✓
webhookEventsEnabledBooleanDefault: False

Example:

{
"id": 0,
"name": "string",
"uuid": "string",
"slug": "string",
"description": "string",
"prompt": "string",
"isCollection": false,
"webhookEventsEnabled": false,
"archived": false,
"recordScope": "string",
"adminOnly": false,
"sensitivity": "string",
"categories": [],
"createdAt": "2024-01-01T00:00:00Z",
"updatedAt": "2024-01-01T00:00:00Z",
"eventRules": [],
"fields": []
}

EnumOption​

FieldTypeRequiredDescription
labelString✓Display label shown to users
valuestrintfloat
visibleWhenStringCEL expression that must return true for this option to be visible. Uses record.data.<field_slug> syntax to reference other field values. CONSTRAINT: Can only reference non-FUNCTION fields.

Example:

{
"label": "string",
"value": "string"
}

EventRuleData​

FieldTypeRequiredDescription
actionParamsdict[str, Any]Parameters for the action
actionType<enum EventRuleActionType✓The action type to execute
activeBooleanWhether the rule is active (default: True)
conditionsStringCEL condition expression for conditional execution
delayIntegerDelay in seconds before executing the action (default: 0)
eventType<enum EventRuleEventType✓The event type that triggers this rule
nameStringDisplay name for the rule
objectTypeEventRuleObjectTypeThe object type this rule applies to (inferred from parent if not provided)
triggerParamsdict[str, Any]Parameters for the trigger (e.g., webhook config)
uuidString✓UUID for matching/creating event rules

Example:

{
"uuid": "string",
"eventType": null,
"actionType": null,
"active": true,
"delay": 0
}

EventRuleResponse​

FieldTypeRequiredDescription
actionParamsDict[str, Any]✓
actionSetLockedBooleanDefault: False
actionType<enum EventRuleActionType✓
activeBoolean✓
appConnectionIdInteger
calendarEventTypeIdInteger✓
calendarIdInteger✓
celBlockedAtDateTime
conditionsString✓
createdAtDateTime✓
dataTypeIdInteger✓
dataTypeNameString
delayInteger✓
errorString✓
errorMessageString✓
eventType<enum EventRuleEventType✓
failedAtDateTime✓
idInteger✓
journeyIdInteger
journeyStepIdInteger✓
nameString✓
objectType<enum EventRuleObjectType✓
orderInteger✓
routineIdInteger✓
taskIdInteger✓
taskNameString
taskWorkflowIdInteger
triggerParamsDict[str, Any]✓
updatedAtDateTime✓
uuidString✓
workflowRevisionIdInteger✓

Example:

{
"id": 0,
"uuid": "string",
"objectType": null,
"name": "string",
"eventType": null,
"conditions": "string",
"actionType": null,
"actionParams": {},
"triggerParams": {},
"active": false,
"createdAt": "2024-01-01T00:00:00Z",
"updatedAt": "2024-01-01T00:00:00Z",
"taskId": 0,
"dataTypeId": 0,
"routineId": 0,
"workflowRevisionId": 0,
"calendarId": 0,
"calendarEventTypeId": 0,
"journeyStepId": 0,
"error": "string",
"errorMessage": "string",
"failedAt": "2024-01-01T00:00:00Z",
"delay": 0,
"order": 0,
"actionSetLocked": false
}

FieldRenameMapping​

FieldTypeRequiredDescription
sourceString✓
targetString✓

Example:

{
"source": "string",
"target": "string"
}

SchemaField​

FieldTypeRequiredDescription
adminOnlyBooleanWhether only admins can see this field (default: False)
categoriesArray<Literal[personal, identifier, phi, credential]>Regulatory or content categories for audit and policy
celFunctionStringCEL 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'
defaultValueAnyDefault value for the field
descriptionStringOptional field description
fieldTypeUnion[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)
nameString✓Display name for the field
optionsArray<EnumOption> | nullOptions for enum fields as {label, value} objects.
orderIntegerDeprecated: Display order is now determined by array position
referencedTypeIdIntegerReferenced DataType ID for reference fields
requiredBooleanWhether field is required (default: False)
sensitivityLiteral['public', 'internal', 'confidential', 'restricted', 'secret']Disclosure severity for audit and access policy (default: confidential)
shouldIndexBooleanWhether to index this field (default: False)
slugString✓Unique field identifier
validateCelStringCEL 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",
"name": "string",
"fieldType": "text",
"required": false,
"shouldIndex": false,
"adminOnly": false,
"sensitivity": "confidential"
}

UpdateDataTypeRequest​

FieldTypeRequiredDescription
adminOnlyBooleanDefault: False
descriptionString
eventRulesArray<EventRuleData> | null
fieldsArray<SchemaField> | null
isCollectionBoolean
nameString
ownerIdInteger
pinnedBoolean
promptString
recordScopeDataTypeRecordScope
renameFieldsArray<FieldRenameMapping> | null
slugString
webhookEventsEnabledBooleanDefault: False

Example:

{
"webhookEventsEnabled": false,
"adminOnly": false
}

ValidateSlugRequest​

FieldTypeRequiredDescription
excludeIdInteger
slugString✓

Example:

{
"slug": "string"
}

ValidateSlugResponse​

FieldTypeRequiredDescription
availableBoolean✓
suggestedSlugString

Example:

{
"available": false
}

Endpoints​

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 type
  • GET /data-types/{data_type_id} - Get a specific data type
  • GET /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 type
  • slug: URL-friendly identifier (auto-generated if not provided)
  • description: Optional description of the data type's purpose
  • fields: Array of field definitions with name, type, validation, and indexing options
  • adminOnly: Hide the Form and its records from every Member without records:admin (default false)

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 slug
  • 401 Unauthorized: Missing or invalid authentication
  • 403 Forbidden: User lacks appropriate admin scope
  • 500 Internal Server Error: Database error during creation

Related Endpoints:

  • GET /data-types - List all data types
  • PUT /data-types/{data_type_id} - Update data type definition
  • POST /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 authentication
  • 404 Not Found: Data type with specified slug not found

Related Endpoints:

  • GET /data-types/{data_type_id} - Get data type by numeric ID
  • GET /data-types - List all data types
  • GET /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 validate
  • excludeId: Optional data type ID to exclude (for updates)

Response:

  • available: Whether the slug is available
  • suggestedSlug: A suggested unique slug if the original is taken

Permissions: Requires valid workspace membership.

Authorization: Requires datatypes:write scope

Parameters:

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 authentication
  • 403 Forbidden: User lacks appropriate admin scope
  • 404 Not Found: Data type not found
  • 500 Internal Server Error: Database error during deletion

Related Endpoints:

  • GET /data-types - List remaining data types
  • POST /data-types/{data_type_id}/export - Export data before deletion
  • GET /data-types/{data_type_id}/records - View records that will be deleted

Authorization: Requires datatypes:admin scope

Parameters:

  • data_type_id (Integer)

Response: dict[str, str]


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 authentication
  • 404 Not Found: Data type not found

Related Endpoints:

  • GET /data-types/slug/{slug} - Get data type by slug
  • PUT /data-types/{data_type_id} - Update data type
  • GET /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)
  • adminOnly: Hide the Form and its records from every Member without records:admin (optional; changing it needs the per-DataType admin action)

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 error
  • 401 Unauthorized: Missing or invalid authentication
  • 403 Forbidden: User lacks appropriate admin scope
  • 404 Not Found: Data type not found
  • 500 Internal Server Error: Database error during update

Related Endpoints:

  • GET /data-types/{data_type_id} - Get current data type definition
  • DELETE /data-types/{data_type_id} - Delete the data type
  • GET /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