Stacks are "smart folders" in Stax.ai. The Stack Resource is used to access a stack, list documents in it, and modify stack configuration.
Resource Schema
{
"_id": "", // [String] Unique stack ID
"path": "", // [String] Path to stack
"team": "", // [String] Unique team ID
"base": "", // [String] ID of base stack - if using a pretrained model
"enabled": true, // [Boolean] If false, Stax.ai will not move any files into this stack
"numDocuments": 0, // [Integer] Number of documents in this stack
"numUnread": 0, // [Integer] Number of unread documents in this stack
"numMovedFiles": 0, // [Integer] Number of files moved since last training
"receivedOn": ISODate(), // [ISODate] When this document was received on
"lastModified": ISODate(),// [ISODate] When this document was last modified on
"forms": [ "" ], // [List.String] List of form IDs attached to this stack
// Access management
"restrict": false, // [string] Should all users not have access to this stack?
"access": [ "" ], // [List.String] List of users who should have access to this stack
// Sorting rules
"rules": {
"enabled": false, // [Boolean] Enable manual sorting override?
// Match properties for manual sorting
"match": {
"mode": "all", // [String] Match all or any pattern?
"source": [ "" ], // [List.String] Match patterns in document source
"name": [ "" ], // [List.String] Match patterns in document name
"phrases": [ "" ] // [List.String] Match patterns in document text content
}
},
// Stack model trainer
"trainer": {
"manualTrigger": false, // [Boolean] Manually triggered a training op? (Read-only)
"isTraining": false, // [Boolean] True if stack is currently being trained
"lastTrained": ISODate()// [ISODate] Last training date/time
},
// Automation pipeline
"pipeline": [
{
"module": "", // [String] Module ID for this step
"subscription": "", // [String] (INTERNAL) Subscription ID
"locked": false, // [Boolean] True if user edit access via portal is disabled
"usage": 0, // [Integer] Number of successful runs for this pipeline step
// Module step configuration
"config": [
{
"label": "", // [String] Configuration parameter label
"value": "" // [String] Configuration parameter value
}
],
// Module step trainer
"trainer": {
"usage": 0, // [Integer] Number of times the module was trained
"lastTrained": ISODate(), // [ISODate] Date/time the module was last trained
"training": false, // [Boolean] True if the step is currently being trained
"config": [
{
"label": "", // [String] Trainer configuration parameter label
"value": "" // [String] Trainer configuration parameter value
}
]
}
}
],
// INSIGHTS ONLY
// Data types
"dataTypes": [
{
"key": "", // [String] Document field key for datatype
"dataType": "text", // [String] One of text (default), number, or date
}
]
}
Access management
Access and roles are controlled using the restrict and access properties. If the restrict property is true, only administrators and users on the access list will have access to this stack and all documents in this stack.
The access array is a list of user IDs for Stax.ai user accounts that should have access to this stack and documents in this stack.
Stax.ai Forms
Stax.ai lets you configure forms which can either be used to intake data into Stax.ai or view/review document metadata in a more visually appealing and intuitive manner.
The forms property is an array of Form resources that are attached to this stack. All documents inside this stack will let users view/edit their fields using all forms on this list.
Automatic vs. manual document sorting
Stax.ai sorts all your documents automatically based on examples by default. However, there might be times when you have defined rules to sort document into the stack. Or maybe you don't want Stax.ai to ever move any documents into this stack. You can configure the sorting rules as needed.
Sorting Rules
To enable manual sorting, set the enabled property of the rules object to true.
The general schema for the rules object is as follows:
{
"enabled": false, // [Boolean] Enable manual sorting override?
// Match properties for manual sorting
"match": {
"mode": "all", // [String] Match all or any pattern?
"source": [ "" ], // [List.String] Match patterns in document source
"name": [ "" ], // [List.String] Match patterns in document name
"phrases": [ "" ] // [List.String] Match patterns in document text content
}
},
The "match.mode" property is used to define whether you want to match all sorting rules, or just one by setting the value to any.
Use Regular Expression (RegEx) patterns to match
For each sorting rule method, you can use RegEx instead of strings and match against complex patterns.
Sorting by document source
If the "match.source" array is populated, the document source must have at least one string in the array, or must match at least one RegEx pattern in the array.
Sorting by document name
If the "match.name" array is populated, the document source must container at least one string in the array, or match at least one RegEx pattern in the array.
Sorting by document content match
If the "match.phrases" array is populated, the document's extracted text content must container at least one phrase in the array, or match at least one RegEx pattern in the array.
Disable files form being sorted to this stack
To disable sorting and prevent files from being moved to this stack automatically, set the enabled property to false.
Automation Pipeline
The automation pipeline steps are a READ-ONLY property via the API. None of the variables can be modified via the Stax.ai developer API. To attach new steps, edit step configuration, or detach existing steps, use the functions in the Module Resource.
{
"module": "", // [String] Module ID for this step
"subscription": "", // [String] (INTERNAL) Subscription ID
"locked": false, // [Boolean] True if user edit access via portal is disabled
"usage": 0, // [Integer] Number of successful runs for this pipeline step
// Module step configuration
"config": [
{
"label": "", // [String] Configuration parameter label
"value": "" // [String] Configuration parameter value
}
],
// Module step trainer
"trainer": {
"usage": 0, // [Integer] Number of times the module was trained
"lastTrained": ISODate(), // [ISODate] Date/time the module was last trained
"training": false, // [Boolean] True if the step is currently being trained
"config": [
{
"label": "", // [String] Trainer configuration parameter label
"value": "" // [String] Trainer configuration parameter value
}
]
}
}
Indexing data types for analytics
If your team has the INSIGHTS scope enabled on your account (enterprise-only), you can configure data types for files in a stack. This allows the Stax.ai Insights platform to aggregate information in that field.
Additional resource properties
The Stack Resource has a lot of additional properties that are not detailed in this reference. This is because those properties are meant only for internal use for the Stax.ai portal.