Create Transform
API that transforms unstructured data into structured format based on your schema. You can specify classification, extraction and generation options on the data all in the transform_params
curl --request POST \
--url https://api.runtrellis.com/v1/transforms/create \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '{
"proj_id": "<string>",
"actions": {
"run_on_extract": false
},
"transform_name": "<string>",
"transform_params": {
"table_preferences": {
"included_table_names": [
"<string>"
],
"advanced_reasoning": false
},
"model": "<string>",
"mode": "document",
"operations": [
{
"column_name": "<string>",
"column_type": "text",
"transform_type": "extraction",
"task_description": "Derive the invoice amount from {{Invoices}}, and add it to the rent from {{Rent Amount}}.",
"output_values": {},
"has_default": true,
"default_value": {},
"api_request": {
"method": "GET",
"url": "<string>",
"header": {},
"body": {}
},
"run_function_code": "<string>",
"prompt_type": "text",
"operations": [
{}
]
}
]
}
}'
{
"message": "<string>",
"data": {
"transform_id": "<string>",
"operations": {}
}
}
Authorizations
Headers
Pass in an API version to guarantee a consistent response format.
The latest version should be used for all new API calls. Existing API calls should be updated to the latest version when possible.
Valid versions:
-
Latest API version (recommended):
2025-03
-
Previous API version (maintenance mode):
2025-02
If no API version header is included, the response format is considered unstable and could change without notice (not recommended).
Body
The id of the project.
The model to be used for the transformation. Must be one of 'trellis-scale', 'trellis-premium', or 'trellis-vertix'
Applicable for table transform mode only. Optional parameter that specifies the table names to be included for table transforms.
Parameter that specifies the table names to be included for table transforms.
Using advanced reasoning when extracting rows from the tables. Transformation becomes slower and more computationally intensive
The mode to be used for the transformation. Must be one of 'document' or 'table'
"document"
A list of columns used to extract, classify and generate data from your assets. At least one column of transform_type = 'parse'
and column_type = 'assets'
is required. If your account was created before March 1st, we will automatically create an assets
-type column on transform creation.
Name of the column to be transformed. Any alphanumeric characters are allowed. Must be unique.
Type of the data residing in this column. Because of upcoming changes, please use list
, object
, text
, date
, time
, number
and assets
going forward.
text
, integer
, numeric
, boolean
, list
, object
, string
, number
, time
, date
, text[]
, jsonb
, assets
Type of transformation to be applied.
extraction
, classification
, generation
, manual
, api_request
, parse
, run_function
Description of the task to be performed. If transform_type
is not one of [parse
, manual
], the task description must contain a reference to another column. Otherwise, the task description may be left blank.
"Derive the invoice amount from {{Invoices}}, and add it to the rent from {{Rent Amount}}."
NOTE: only valid with classification tasks. Output values of the transformation operation.
If true, use the default value specified in default_value. If false, return null if no value found.
The default value to use if has_default is true and no value is found in the document. The value you should return is stored under the 'value' key.
For transform_type='api_request', specify the HTTP method, URL, header, and body.
HTTP method for the API request (GET or POST).
GET
, POST
URL endpoint for the API request.
Headers to include with the API request.
JSON body to send with the API request (for POST).
For transform_type='run_function', the javascript code to run on AWS lambda
Prompt type for the operation. Default is 'text'.
text
, multimodal
Required when column_type is object
or list
. Defines the structure of object or list operations. If column_type is list
, then operations should only be of length 1 since list
can only be of one type. If column_type is object
, then operations can be longer of length one (and optionally be nested.)
Name of the column to be transformed. Any alphanumeric characters are allowed. Must be unique.
Type of the data residing in this column. Because of upcoming changes, please use list
, object
, text
, date
, time
, number
and assets
going forward.
text
, integer
, numeric
, boolean
, list
, object
, string
, number
, time
, date
, text[]
, jsonb
, assets
Type of transformation to be applied.
extraction
, classification
, generation
, manual
, api_request
, parse
, run_function
Description of the task to be performed. If transform_type
is not one of [parse
, manual
], the task description must contain a reference to another column. Otherwise, the task description may be left blank.
"Derive the invoice amount from {{Invoices}}, and add it to the rent from {{Rent Amount}}."
NOTE: only valid with classification tasks. Output values of the transformation operation.
If true, use the default value specified in default_value. If false, return null if no value found.
The default value to use if has_default is true and no value is found in the document. The value you should return is stored under the 'value' key.
For transform_type='api_request', specify the HTTP method, URL, header, and body.
HTTP method for the API request (GET or POST).
GET
, POST
URL endpoint for the API request.
Headers to include with the API request.
JSON body to send with the API request (for POST).
For transform_type='run_function', the javascript code to run on AWS lambda
Prompt type for the operation. Default is 'text'.
text
, multimodal
Required when column_type is object
or list
. Defines the structure of object or list operations. If column_type is list
, then operations should only be of length 1 since list
can only be of one type. If column_type is object
, then operations can be longer of length one (and optionally be nested.)
Name of the column to be transformed. Any alphanumeric characters are allowed. Must be unique.
Type of the data residing in this column. Because of upcoming changes, please use list
, object
, text
, date
, time
, number
and assets
going forward.
text
, integer
, numeric
, boolean
, list
, object
, string
, number
, time
, date
, text[]
, jsonb
, assets
Type of transformation to be applied.
extraction
, classification
, generation
, manual
, api_request
, parse
, run_function
Description of the task to be performed. If transform_type
is not one of [parse
, manual
], the task description must contain a reference to another column. Otherwise, the task description may be left blank.
"Derive the invoice amount from {{Invoices}}, and add it to the rent from {{Rent Amount}}."
NOTE: only valid with classification tasks. Output values of the transformation operation.
If true, use the default value specified in default_value. If false, return null if no value found.
The default value to use if has_default is true and no value is found in the document. The value you should return is stored under the 'value' key.
For transform_type='api_request', specify the HTTP method, URL, header, and body.
For transform_type='run_function', the javascript code to run on AWS lambda
Prompt type for the operation. Default is 'text'.
text
, multimodal
Required when column_type is object
or list
. Defines the structure of object or list operations. If column_type is list
, then operations should only be of length 1 since list
can only be of one type. If column_type is object
, then operations can be longer of length one (and optionally be nested.)
Enable actions specific to this transformation.
Enable immediate transformation runs on asset uploaded and extracted
The transform_name parameter is an optional parameter that provides a human-readable name or description for the transformation, which can be useful for identifying and referencing transformations. If provided, the transform_name parameter should be a string. If not provided, the value of transform_name will be None.
curl --request POST \
--url https://api.runtrellis.com/v1/transforms/create \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '{
"proj_id": "<string>",
"actions": {
"run_on_extract": false
},
"transform_name": "<string>",
"transform_params": {
"table_preferences": {
"included_table_names": [
"<string>"
],
"advanced_reasoning": false
},
"model": "<string>",
"mode": "document",
"operations": [
{
"column_name": "<string>",
"column_type": "text",
"transform_type": "extraction",
"task_description": "Derive the invoice amount from {{Invoices}}, and add it to the rent from {{Rent Amount}}.",
"output_values": {},
"has_default": true,
"default_value": {},
"api_request": {
"method": "GET",
"url": "<string>",
"header": {},
"body": {}
},
"run_function_code": "<string>",
"prompt_type": "text",
"operations": [
{}
]
}
]
}
}'
{
"message": "<string>",
"data": {
"transform_id": "<string>",
"operations": {}
}
}