Iris API functions
This section documents all host functions available in Iris Jyro scripts. These functions extend the Jyro scripting language with Iris-specific capabilities for managing organizations, persons, facets, secrets, notifications, and more.
Function Categories
Organizations
Functions for managing organization entities:
- GetOrganizationById - Retrieve organization by ID
- GetAllOrganizations - Get all organizations
- GetChildOrganizations - Get child organizations
- GetOrganizationsBySet - Get organizations by set membership
- CreateOrganization - Create a new organization
- SetOrganizationParent - Set organization parent
- DeleteOrganization - Delete an organization
Persons
Functions for managing person entities:
- GetPersonById - Get person by ID
- GetPersonByEmail - Get person by email address
- GetAllPersons - Get all persons
- GetAllPersonsByEmail - Get all persons with matching email (find duplicates)
- GetPersonsBySet - Get persons by set membership
- CreatePerson - Create a new person
- UpdatePerson - Update an existing person
- DeletePerson - Delete a person
- AddPersonToOrganization - Add person to an organization
- RemovePersonFromOrganization - Remove person from an organization
Facets
Functions for managing facet definitions and instances:
- GetFacetDefinitionByName - Get facet definition by name
- GetAllFacetDefinitions - Get all facet definitions
- CreateFacetDefinition - Create a new facet definition
- GetOrganizationFacetInstance - Get single facet instance
- GetOrganizationFacetInstances - Get all facet instances
- SetOrganizationFacetInstance - Set organization facet
- GetPersonFacetInstance - Get person facet instance
- SetPersonFacetInstance - Set person facet instance
Fields
Functions for managing field definitions and instances:
- GetAllFieldDefinitions - Get all field definitions
- CreateFieldDefinition - Create a new field definition
- SetOrganizationFieldInstance - Set field instance items on organization
- GetAllOrganizationFieldInstances - Get all field instances for organization
- GetOrganizationFieldInstanceByName - Get field instance by definition name
Hybrid Lists
Functions for managing hybrid list definitions and instances:
- GetAllHybridListDefinitions - Get all hybrid list definitions
- CreateHybridListDefinition - Create a new hybrid list definition
- CreateHybridListDefinitionCategory - Create a category in a hybrid list
- CreateHybridListDefinitionItem - Create an item in a hybrid list category
- SetOrganizationHybridListInstance - Set hybrid list items on organization
Entitlements
Functions for managing entitlement definitions and granting entitlements to organizations:
- GetAllEntitlementDefinitions - Get all entitlement definitions
- GetEntitlementDefinitionByName - Get entitlement definition by name
- CreateEntitlementDefinition - Create a new entitlement definition
- DeleteEntitlementDefinition - Delete an entitlement definition
- ActivateEntitlementDefinition - Activate an entitlement definition
- DeactivateEntitlementDefinition - Deactivate an entitlement definition
- GetAllOrganizationEntitlementInstances - Get all entitlement instances for organization
- GetOrganizationEntitlementInstanceByName - Get entitlement instance by definition name
- AddEntitlementInstance - Grant entitlement to an organization
- RemoveEntitlementInstance - Revoke entitlement from an organization
- RenewEntitlementInstance - Set new end date for entitlement instance
Roles
Functions for managing person roles:
- GetPersonRoles - Get roles assigned to a person
- GetCurrentUserRoles - Get roles of the current authenticated user
- AssignRoleToPerson - Assign a role to a person
- RemoveRoleFromPerson - Remove a role from a person
Secrets
Functions for managing encrypted secrets:
- GetSecret - Retrieve decrypted secret
- SetSecret - Create or update secret
- DeleteSecret - Delete secret
Notepads
Functions for persisting and retrieving script output data:
- CreateNotepad - Create a notepad to persist data
- GetNotepads - Get notepads from current or specific execution
- GetNotepadContent - Retrieve notepad content by ID
- DeleteNotepad - Delete a notepad
Notifications
Functions for real-time notifications via SignalR:
- SendNotification - Send to specific user
- BroadcastNotification - Broadcast to all users
Functions for sending emails:
- SendEmail - Send email via Postmark
Templating
Functions for template rendering:
- RenderTemplate - Render Scriban templates
Articles
Functions for news/article management:
- CreateArticle - Create home page articles
Data Import
Functions for reading external data files:
- ReadCsv - Read CSV files
- ReadJson - Read JSON files
- ReadExcel - Read Excel (.xlsx) files
- ReadXml - Read XML files
File Generation
Functions for generating files:
- GenerateExcel - Generate Excel with temporary download URL (1-hour expiry)
- GenerateExcelBytes - Generate Excel and return raw bytes for blob storage
Blob Storage
Functions for persistent file storage using Azure Blob Storage. Requires tenant configuration (see Blob Storage Setup):
- IsBlobStorageEnabled - Check if blob storage is enabled
- WriteToBlobStorage - Upload file to blob storage
- ReadFromBlobStorage - Download file from blob storage
- ListBlobStorage - List files in blob storage
- DeleteFromBlobStorage - Delete file from blob storage
- BlobStorageExists - Check if file exists
- GetBlobStorageSasUrl - Generate time-limited download URL
External Blob Storage
Functions for working with external Azure Blob Storage accounts (not the tenant’s configured storage):
- DownloadBlobFiles - Download files from external blob storage
- MoveBlob - Move blobs within a container
File Handles
Functions for working with downloaded file handles:
- ReadFileContent - Read text content of a downloaded file
- GetFileHandle - Get file handle metadata
PDF Processing
Functions for extracting data from PDF documents:
- ReadCustomDataFromPdf - Extract key-value pairs from PDFs using label mappings
SQL Database
Functions for querying external SQL Server databases:
- SqlConnect - Establish a database connection
- SqlQuery - Execute SELECT queries
- SqlExecute - Execute INSERT/UPDATE/DELETE commands
- SqlClose - Close a database connection
SharePoint Integration
Functions for uploading files and creating folders in SharePoint Online:
- UploadFileToSharePoint - Upload files to SharePoint with metadata
- CreateSharePointFolder - Create folders in SharePoint
Context
Functions for accessing current execution context:
- GetCurrentUser - Get authenticated user info
- GetCurrentTenant - Get current tenant info
Audit
Functions for accessing audit trail data:
- GetRecentAuditEntries - Get recent audit entries for the tenant
Utility
Core utility functions:
- Log - Write to application logs
- CancelAction - Cancel current operation (Before hooks only)
Usage Context
These functions are available in three execution contexts:
- Event Hooks - Scripts triggered by domain events (BeforeOrganizationCreated, AfterPersonUpdated, etc.)
- Dynamic Endpoints - Custom API endpoints powered by Jyro scripts
- Ad-hoc Scripts - Administrative scripts executed on-demand
For detailed information about the Data object structure passed to scripts in each context, see the Data Context Reference.
Jyro Syntax Reminder
Remember that Jyro uses its own syntax, not JavaScript:
# Conditionals
if condition then
# code
end
# Loops
foreach item in items do
# code
end
# Boolean operators
if isActive and age > 18 then
# code
end
See the Jyro documentation for complete language reference.
Best Practices
- Always validate inputs - Check for null/empty values before using
- Use appropriate log levels - Debug, Information, Warning, Error
- Handle errors gracefully - Check return values and log failures
- Use CancelAction wisely - Only in Before hooks, with clear reason
- Keep scripts simple - Complex logic belongs in the domain layer