Iris API
This documentation covers the Jyro scripting API available in Iris for Event Hooks, Dynamic Endpoints, and Ad-hoc Scripts.
Getting Started
Key Concepts
- Event Hooks - Scripts triggered by domain events (e.g.,
BeforeOrganizationCreated,AfterPersonUpdated) - Dynamic Endpoints - Custom REST API endpoints powered by Jyro scripts
- Ad-hoc Scripts - Administrative scripts executed on-demand
Essential Reading
| Document | Description |
|---|---|
| Data context reference | Structure of the Data object passed to scripts |
| Iris API functions | All available host functions for interacting with Iris |
Data Context
Every script receives a Data object containing context-specific information:
Event Hooks
- Create/Delete Events: Access entity via
Data.{entityType}(e.g.,Data.organization,Data.person) - Update Events: Access both states via
Data.CurrentandData.Previous
# BeforeOrganizationCreated
Log("Information", "Creating: " + Data.organization.Name)
# AfterPersonUpdated
if Data.Current.EmailAddress != Data.Previous.EmailAddress then
Log("Information", "Email changed")
end
Dynamic Endpoints
- Request Data:
Data.request.method,Data.request.query,Data.request.body,Data.request.user - Response Control:
Data._payload,Data._statusCode,Data._redirect
# GET /api/dynamic/v1/hello
Data._payload = { "message": "Hello, " + Data.request.user.name }
Data._statusCode = 200
See the Data context reference for complete details.
Quick Reference
Event Types
| Entity | Before | After | Async |
|---|---|---|---|
| Organization | BeforeOrganizationCreated/Updated/Deleted | AfterOrganizationCreated/Updated/Deleted | AsyncOrganizationCreated/Updated/Deleted |
| Person | BeforePersonCreated/Updated/Deleted | AfterPersonCreated/Updated/Deleted | AsyncPersonCreated/Updated/Deleted |
Common Host Functions
| Function | Description |
|---|---|
Log(level, message) | Write to application logs |
CancelAction(reason) | Cancel operation (Before hooks only) |
GetOrganizationById(id) | Get organization by ID |
GetAllOrganizations() | Get all organizations |
SendNotification(userId, title, message, type, link) | Send push notification |
GetSecret(name) | Get decrypted secret value |
See the Iris API functions for the complete list.
In this section
- Blob storage setup: Configure Azure Blob Storage for your tenant
- Data context reference: Structure of the Data object passed to scripts
- Iris API functions: Complete host functions reference
External resources
- Jyro Language Documentation - Complete Jyro syntax reference