Skip to main content

Overview

Templates (also called checklists) are the blueprints for inspections, audits, and forms in Xenia. A template defines:
  • Sections: Logical groupings of questions
  • Items: Individual questions with response types and scoring
  • Notifications: Automated alerts based on answers
  • Approval Workflows: Review processes for completed submissions

Key Concepts

Template Structure

Template (Checklist)
├── Section 1
│   ├── Item 1 (Question)
│   ├── Item 2 (Question)
│   └── Item 3 (Question)
├── Section 2
│   ├── Item 4 (Question)
│   └── Item 5 (Question)
└── Notifications
    └── Alert on flagged items

Template States

StateDescription
draftWork in progress, not available for submissions
publishedActive and available for use
archivedDeactivated, not available for new submissions

Template CRUD Operations

List Templates

Retrieve all templates in your workspace.
curl -X GET "https://api.xenia.team/api/v1/ops/workspaces/{workspaceId}/checklists" \
  -H "x-client-key: YOUR_CLIENT_KEY" \
  -H "x-client-secret: YOUR_CLIENT_SECRET" \
  -H "workspace-id: {workspaceId}"
Response:
{
  "status": "success",
  "code": 200,
  "data": [
    {
      "id": "template-uuid-1",
      "name": "Daily Safety Inspection",
      "description": "Daily safety checklist for all sites",
      "isPublished": true,
      "isArchived": false,
      "category": "Safety",
      "type": "Inspection",
      "FolderId": "folder-uuid",
      "itemCount": 25,
      "sectionCount": 5,
      "createdAt": "2024-01-15T10:00:00Z",
      "updatedAt": "2024-06-20T14:30:00Z"
    }
  ]
}

Get Template by ID

Retrieve a specific template with full details.
curl -X GET "https://api.xenia.team/api/v1/ops/workspaces/{workspaceId}/checklists/{checklistId}" \
  -H "x-client-key: YOUR_CLIENT_KEY" \
  -H "x-client-secret: YOUR_CLIENT_SECRET" \
  -H "workspace-id: {workspaceId}"
Response:
{
  "status": "success",
  "code": 200,
  "data": {
    "id": "template-uuid",
    "name": "Daily Safety Inspection",
    "description": "Daily safety checklist for all sites",
    "isPublished": true,
    "isArchived": false,
    "category": "Safety",
    "type": "Inspection",
    "industry": "Manufacturing",
    "icon": "safety",
    "scoringEnabled": true,
    "passingScore": 80,
    "sections": [
      {
        "id": "section-uuid-1",
        "title": "PPE Check",
        "description": "Personal Protective Equipment verification",
        "order": 1,
        "items": [
          {
            "id": "item-uuid-1",
            "title": "Hard hat available and in good condition?",
            "type": "yesNo",
            "required": true,
            "order": 1,
            "scoring": {
              "enabled": true,
              "yesScore": 10,
              "noScore": 0,
              "naScore": 0
            }
          }
        ]
      }
    ],
    "notifications": [],
    "WorkspaceId": "workspace-uuid",
    "createdAt": "2024-01-15T10:00:00Z"
  }
}

Create or Update Template

Create a new template or update an existing one (upsert).
curl -X PUT "https://api.xenia.team/api/v1/ops/workspaces/{workspaceId}/checklists/{checklistId}" \
  -H "x-client-key: YOUR_CLIENT_KEY" \
  -H "x-client-secret: YOUR_CLIENT_SECRET" \
  -H "workspace-id: {workspaceId}" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Daily Safety Inspection",
    "description": "Comprehensive daily safety checklist",
    "category": "Safety",
    "type": "Inspection",
    "industry": "Manufacturing",
    "scoringEnabled": true,
    "passingScore": 80,
    "sections": [
      {
        "title": "PPE Check",
        "description": "Personal Protective Equipment verification",
        "order": 1,
        "items": [
          {
            "title": "Hard hat available and in good condition?",
            "type": "yesNo",
            "required": true,
            "order": 1,
            "scoring": {
              "enabled": true,
              "yesScore": 10,
              "noScore": 0
            }
          },
          {
            "title": "Safety glasses worn?",
            "type": "yesNo",
            "required": true,
            "order": 2
          }
        ]
      },
      {
        "title": "Equipment Inspection",
        "order": 2,
        "items": [
          {
            "title": "Equipment condition",
            "type": "multipleChoice",
            "required": true,
            "options": [
              {"label": "Excellent", "score": 10},
              {"label": "Good", "score": 8},
              {"label": "Fair", "score": 5},
              {"label": "Poor", "score": 0, "flagged": true}
            ],
            "order": 1
          }
        ]
      }
    ]
  }'
Request Body:
FieldTypeRequiredDescription
namestringYesTemplate name
descriptionstringNoTemplate description
categorystringNoCategory (Safety, Quality, etc.)
typestringNoType (Inspection, Audit, Form)
industrystringNoIndustry classification
scoringEnabledbooleanNoEnable scoring for this template
passingScorenumberNoMinimum passing score (0-100)
sectionsarrayNoArray of sections with items
FolderIdUUIDNoFolder to organize template
Permission Required: CAN_MANAGE_CHECKLIST or CHECKLIST_SUPER_ADMIN

Partial Update Template

Update specific fields without replacing the entire template.
curl -X PATCH "https://api.xenia.team/api/v1/ops/workspaces/{workspaceId}/checklists/{checklistId}" \
  -H "x-client-key: YOUR_CLIENT_KEY" \
  -H "x-client-secret: YOUR_CLIENT_SECRET" \
  -H "workspace-id: {workspaceId}" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Updated Safety Inspection",
    "passingScore": 85
  }'

Delete Template

curl -X DELETE "https://api.xenia.team/api/v1/ops/workspaces/{workspaceId}/checklists/{checklistId}" \
  -H "x-client-key: YOUR_CLIENT_KEY" \
  -H "x-client-secret: YOUR_CLIENT_SECRET" \
  -H "workspace-id: {workspaceId}"
Deleting a template removes it permanently. Consider archiving instead if you want to preserve historical submissions.

Template Items (Questions)

Question Types

TypeDescriptionExample
yesNoYes/No toggle”Is the area clean?”
multipleChoiceSingle selection from options”Rate condition: Excellent/Good/Fair/Poor”
checkboxMultiple selections”Select all hazards present”
textFree text input”Describe any issues found”
numberNumeric input”Temperature reading”
dateDate picker”Last inspection date”
dateTimeDate and time”Incident time”
sliderRange slider”Satisfaction (1-10)“
signatureSignature capture”Inspector signature”
photoImage attachment”Photo of equipment”
fileFile attachment”Upload documentation”

Get Template Items

curl -X GET "https://api.xenia.team/api/v1/ops/workspaces/{workspaceId}/checklists/{checklistId}/items" \
  -H "x-client-key: YOUR_CLIENT_KEY" \
  -H "x-client-secret: YOUR_CLIENT_SECRET" \
  -H "workspace-id: {workspaceId}"

Create or Update Item

curl -X PUT "https://api.xenia.team/api/v1/ops/workspaces/{workspaceId}/checklists/{checklistId}/items/{itemId}" \
  -H "x-client-key: YOUR_CLIENT_KEY" \
  -H "x-client-secret: YOUR_CLIENT_SECRET" \
  -H "workspace-id: {workspaceId}" \
  -H "Content-Type: application/json" \
  -d '{
    "title": "Fire extinguisher inspection",
    "description": "Check pressure gauge and inspection tag",
    "type": "yesNo",
    "required": true,
    "sectionId": "section-uuid",
    "order": 5,
    "scoring": {
      "enabled": true,
      "yesScore": 10,
      "noScore": 0,
      "naScore": 5
    },
    "flagOnAnswer": "no",
    "flagMessage": "Fire extinguisher needs attention"
  }'
Item Configuration:
FieldTypeDescription
titlestringQuestion text
descriptionstringHelp text or instructions
typestringQuestion type (see table above)
requiredbooleanWhether answer is required
sectionIdUUIDSection this item belongs to
ordernumberDisplay order within section
scoring.enabledbooleanInclude in score calculation
scoring.yesScorenumberPoints for “Yes” answer
scoring.noScorenumberPoints for “No” answer
scoring.naScorenumberPoints for “N/A” answer
optionsarrayOptions for multipleChoice/checkbox
flagOnAnswerstringAnswer value that triggers flag
flagMessagestringMessage shown when flagged

Delete Item

curl -X DELETE "https://api.xenia.team/api/v1/ops/workspaces/{workspaceId}/checklists/{checklistId}/items/{itemId}" \
  -H "x-client-key: YOUR_CLIENT_KEY" \
  -H "x-client-secret: YOUR_CLIENT_SECRET" \
  -H "workspace-id: {workspaceId}"

Publishing Templates

Publish Template

Make a template available for submissions.
curl -X POST "https://api.xenia.team/api/v1/ops/workspaces/{workspaceId}/checklists/{checklistId}/publish" \
  -H "x-client-key: YOUR_CLIENT_KEY" \
  -H "x-client-secret: YOUR_CLIENT_SECRET" \
  -H "workspace-id: {workspaceId}"
Permission Required: CAN_PUBLISH_CHECKLIST or CHECKLIST_SUPER_ADMINFeature Required: PUBLISH_CHECKLISTS feature flag

Toggle Publish State

curl -X PUT "https://api.xenia.team/api/v1/ops/workspaces/{workspaceId}/checklists/{checklistId}/toggle-publish" \
  -H "x-client-key: YOUR_CLIENT_KEY" \
  -H "x-client-secret: YOUR_CLIENT_SECRET" \
  -H "workspace-id: {workspaceId}"

Unarchive Template

Restore an archived template.
curl -X PUT "https://api.xenia.team/api/v1/ops/workspaces/{workspaceId}/checklists/{checklistId}/unarchive" \
  -H "x-client-key: YOUR_CLIENT_KEY" \
  -H "x-client-secret: YOUR_CLIENT_SECRET" \
  -H "workspace-id: {workspaceId}"

Template Folders

Organize templates into folders for better management.

List Folders

curl -X GET "https://api.xenia.team/api/v1/ops/workspaces/{workspaceId}/folders" \
  -H "x-client-key: YOUR_CLIENT_KEY" \
  -H "x-client-secret: YOUR_CLIENT_SECRET" \
  -H "workspace-id: {workspaceId}"

Create Folder

curl -X POST "https://api.xenia.team/api/v1/ops/workspaces/{workspaceId}/folders" \
  -H "x-client-key: YOUR_CLIENT_KEY" \
  -H "x-client-secret: YOUR_CLIENT_SECRET" \
  -H "workspace-id: {workspaceId}" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Safety Inspections",
    "description": "All safety-related templates"
  }'

Move Templates to Folder

curl -X PUT "https://api.xenia.team/api/v1/ops/workspaces/{workspaceId}/checklists/update-folder" \
  -H "x-client-key: YOUR_CLIENT_KEY" \
  -H "x-client-secret: YOUR_CLIENT_SECRET" \
  -H "workspace-id: {workspaceId}" \
  -H "Content-Type: application/json" \
  -d '{
    "checklistIds": ["template-uuid-1", "template-uuid-2"],
    "folderId": "folder-uuid"
  }'

Remove Templates from Folder

curl -X PUT "https://api.xenia.team/api/v1/ops/workspaces/{workspaceId}/checklists/unset-folder" \
  -H "x-client-key: YOUR_CLIENT_KEY" \
  -H "x-client-secret: YOUR_CLIENT_SECRET" \
  -H "workspace-id: {workspaceId}" \
  -H "Content-Type: application/json" \
  -d '{
    "checklistIds": ["template-uuid-1"]
  }'

Template Notifications

Configure automated notifications based on submission answers.

List Notifications

curl -X GET "https://api.xenia.team/api/v1/ops/workspaces/{workspaceId}/checklists/{checklistId}/notifications" \
  -H "x-client-key: YOUR_CLIENT_KEY" \
  -H "x-client-secret: YOUR_CLIENT_SECRET" \
  -H "workspace-id: {workspaceId}"

Create Notification

curl -X POST "https://api.xenia.team/api/v1/ops/workspaces/{workspaceId}/checklists/{checklistId}/notifications" \
  -H "x-client-key: YOUR_CLIENT_KEY" \
  -H "x-client-secret: YOUR_CLIENT_SECRET" \
  -H "workspace-id: {workspaceId}" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Safety Alert",
    "trigger": "flaggedItem",
    "channels": ["email", "push"],
    "recipients": {
      "userIds": ["user-uuid-1"],
      "roleIds": ["safety-manager-role-uuid"]
    },
    "message": "A safety issue was flagged during inspection"
  }'
Notification Configuration:
FieldTypeDescription
namestringNotification name
triggerstringWhen to send: flaggedItem, submission, score
channelsarrayDelivery channels: email, push, sms
recipients.userIdsarraySpecific user IDs to notify
recipients.roleIdsarrayRole IDs to notify all members
messagestringNotification message
scoreThresholdnumberFor score triggers, threshold value

Update Notification

curl -X PUT "https://api.xenia.team/api/v1/ops/workspaces/{workspaceId}/checklists/{checklistId}/notifications/{notificationId}" \
  -H "x-client-key: YOUR_CLIENT_KEY" \
  -H "x-client-secret: YOUR_CLIENT_SECRET" \
  -H "workspace-id: {workspaceId}" \
  -H "Content-Type: application/json" \
  -d '{
    "message": "Updated notification message"
  }'

Delete Notification

curl -X DELETE "https://api.xenia.team/api/v1/ops/workspaces/{workspaceId}/checklists/{checklistId}/notifications/{notificationId}" \
  -H "x-client-key: YOUR_CLIENT_KEY" \
  -H "x-client-secret: YOUR_CLIENT_SECRET" \
  -H "workspace-id: {workspaceId}"

Template Duplication

Duplicate Template

Create a copy of an existing template.
curl -X POST "https://api.xenia.team/api/v1/ops/workspaces/{workspaceId}/checklists/{checklistId}/duplicate" \
  -H "x-client-key: YOUR_CLIENT_KEY" \
  -H "x-client-secret: YOUR_CLIENT_SECRET" \
  -H "workspace-id: {workspaceId}"
Response:
{
  "status": "success",
  "code": 200,
  "data": {
    "id": "new-template-uuid",
    "name": "Daily Safety Inspection (Copy)",
    "isPublished": false
  }
}

Reference Data

Get Categories

curl -X GET "https://api.xenia.team/api/v1/ops/workspaces/{workspaceId}/checklist-categories" \
  -H "x-client-key: YOUR_CLIENT_KEY" \
  -H "x-client-secret: YOUR_CLIENT_SECRET" \
  -H "workspace-id: {workspaceId}"

Get Types

curl -X GET "https://api.xenia.team/api/v1/ops/workspaces/{workspaceId}/checklist-types" \
  -H "x-client-key: YOUR_CLIENT_KEY" \
  -H "x-client-secret: YOUR_CLIENT_SECRET" \
  -H "workspace-id: {workspaceId}"

Get Industries

curl -X GET "https://api.xenia.team/api/v1/ops/workspaces/{workspaceId}/checklist-industries" \
  -H "x-client-key: YOUR_CLIENT_KEY" \
  -H "x-client-secret: YOUR_CLIENT_SECRET" \
  -H "workspace-id: {workspaceId}"

Common Workflows

Creating a Complete Template

Migrating Templates from External System

# Step 1: Create template structure
TEMPLATE_ID="new-template-uuid"
curl -X PUT ".../checklists/${TEMPLATE_ID}" \
  -d '{
    "name": "Imported Checklist",
    "sections": [
      {
        "title": "Section 1",
        "items": [...]
      }
    ]
  }'

# Step 2: Add to folder
curl -X PUT ".../checklists/update-folder" \
  -d "{
    \"checklistIds\": [\"${TEMPLATE_ID}\"],
    \"folderId\": \"imported-folder-uuid\"
  }"

# Step 3: Publish when ready
curl -X POST ".../checklists/${TEMPLATE_ID}/publish"

Best Practices

Create modular sections that can be combined. Use clear naming conventions and descriptions.
Enable scoring for compliance-critical templates. Set passing scores that align with your quality standards.
Set up alerts for flagged items to ensure immediate attention to safety or quality issues.
Create test submissions for new templates to verify question flow, scoring, and notifications work as expected.
Group related templates into folders (by department, location, or category) for easier management.
Before major changes, duplicate the template. This preserves the original and allows rollback if needed.