> ## Documentation Index
> Fetch the complete documentation index at: https://docs.xenia.team/llms.txt
> Use this file to discover all available pages before exploring further.

# Save Template



## OpenAPI

````yaml PUT /api/v1/ops/workspaces/{workspaceId}/checklists/{templateId}
openapi: 3.1.0
info:
  title: Xenia Team API - Save Template
  version: 1.0.0
  description: >-
    Saves a template's content and steps. Creates the template when the id is
    new.
servers:
  - url: https://api.xenia.team
security: []
paths:
  /api/v1/ops/workspaces/{workspaceId}/checklists/{templateId}:
    put:
      tags:
        - Templates
      summary: Save Template
      description: >-
        Saves the template's name, details, steps and sections. **There is no
        separate create endpoint: a PUT to an id that does not exist yet creates
        the template.** Generate the template UUID yourself.


        Requires **Manage Templates** (`CAN_MANAGE_CHECKLIST`) or **Template
        Super Admin** (`CHECKLIST_SUPER_ADMIN`). The key acts as its user (the
        key's default user, or `x-client-user`), so that user's role and
        template access apply.


        **Ids.** Every step and section in the body needs an `id`. Use the ids
        from **Get Template** to update existing ones, and generate a new UUID
        for each new one. A body with a step or section without an id is
        rejected with `422 Every step and section needs an id. Generate a UUID
        for new ones.`


        **What is kept.** Steps and sections you leave out of the body are kept
        as they are. To remove one, put its id in `deletedItemIds` or
        `deletedSectionIds`. Deleting a section keeps its steps: they move to
        the parent section, or to the top level.


        **Other rules.**

        - `name` is required on every call, including updates.

        - **`templateContext` is cleared when you leave it out** (it defaults to
        an empty string). Send the current value if the template uses it.

        - PUT does not publish or unpublish. A new template starts unpublished;
        publishing is done in the app for now.

        - PUT does not change who can access the template. Use **Update Template
        Settings** (`access`, `submissionAccess`).

        - `FolderId` only applies when the PUT creates the template.

        - Unknown keys are rejected with `422`.


        **On create**, the key's user becomes a template admin and can see all
        its submissions. If that user is a workspace admin or owner, everyone
        can submit the template; otherwise the user's locations can. A
        `FolderId` whose folder auto-applies access replaces these defaults with
        the folder's.


        The response is the saved template, in the same shape as **Get
        Template**.
      parameters:
        - name: workspaceId
          in: path
          required: true
          description: >-
            UUID of the workspace. Must be the workspace the API key belongs to.
            Only this workspace-in-path form is open to API keys.
          schema:
            type: string
            format: uuid
            example: cb363f7e-c52a-4478-911d-f6a6f791090e
        - name: templateId
          in: path
          required: true
          description: >-
            UUID of the template. Any value that is not UUID-shaped returns `403
            Forbidden: API key not authorized for this route`.
          schema:
            type: string
            format: uuid
            example: 3f1c9a52-8e4b-4d27-9b6a-2a7e5c1d0f84
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              additionalProperties: false
              required:
                - name
              properties:
                name:
                  type: string
                  minLength: 1
                  maxLength: 150
                description:
                  type:
                    - string
                    - 'null'
                icon:
                  description: 'Icon object, e.g. `{"icon": "Default", "color": "#FFA681"}`.'
                image:
                  type:
                    - string
                    - 'null'
                logo:
                  type:
                    - string
                    - 'null'
                attachments:
                  description: Array of attachment URLs or keys.
                FolderId:
                  type:
                    - string
                    - 'null'
                  format: uuid
                  description: Folder to create the template in. Only read on create.
                ChecklistTypeId:
                  type:
                    - string
                    - 'null'
                ChecklistIndustryId:
                  type:
                    - string
                    - 'null'
                enableAiSummary:
                  type:
                    - boolean
                    - 'null'
                pdfAiSummary:
                  type:
                    - boolean
                    - 'null'
                emailAiSummary:
                  type:
                    - boolean
                    - 'null'
                templateContext:
                  type:
                    - string
                    - 'null'
                  description: >-
                    AI context for the template. **If you leave it out, it is
                    saved as an empty string**, clearing any existing value.
                    Send the current value on every call if the template uses
                    it.
                reportSectionConfig:
                  type:
                    - string
                    - 'null'
                  enum:
                    - SHOW_ALL
                    - SHOW_ONLY_FLAGGED
                    - SHOW_ONLY_CORRECTIVE
                    - SHOW_FLAGGED_AND_CORRECTIVE
                    - null
                reportSectionIds:
                  type:
                    - array
                    - 'null'
                  items:
                    type: string
                    format: uuid
                enableSubmissionLookback:
                  type:
                    - boolean
                    - 'null'
                lookbackPrompt:
                  type:
                    - string
                    - 'null'
                  maxLength: 2000
                lookbackConfig:
                  type:
                    - object
                    - 'null'
                  properties:
                    showFlaggedFromLastVisit:
                      type: boolean
                    showGoingRightWay:
                      type: boolean
                    showWatchForRepeatIssues:
                      type: boolean
                    showNotesFromLastSubmission:
                      type: boolean
                    summaryLength:
                      type: string
                      enum:
                        - low
                        - medium
                        - high
                checklistItems:
                  type:
                    - array
                    - 'null'
                  description: Top-level steps (not in a section). Each needs an `id`.
                  items:
                    type: object
                    required:
                      - id
                      - type
                    properties:
                      id:
                        type: string
                        format: uuid
                        description: >-
                          **Required for API keys.** An existing step's id
                          updates that step; a new UUID (generated by you)
                          creates the step.
                      type:
                        type: string
                        description: >-
                          Step type, for example `passFail`, `textField`,
                          `number`, `temperature`, `takePhoto`, `signature`,
                          `dateTime`, `dropdown`, `multipleChoice`,
                          `instruction`, `header`.
                      description:
                        type:
                          - string
                          - 'null'
                        description: The question or instruction text.
                      unit:
                        type:
                          - string
                          - 'null'
                      order:
                        type: number
                        description: Position within its parent (template or section).
                      options:
                        description: >-
                          Type-specific configuration. Ignored for `passFail`
                          (Pass / Fail / N/A is set by the server). For
                          option-bearing types such as `dropdown` or
                          `multipleChoice`, copy the shape from **Get Template**
                          on a template built in the app.
                      required:
                        type: boolean
                      isImageOrNoteRequired:
                        type: boolean
                      score:
                        type:
                          - number
                          - 'null'
                      attachments:
                        description: Array of attachment URLs or keys.
                      info:
                        description: Extra step configuration, as returned by Get Template.
                checklistSections:
                  type:
                    - array
                    - 'null'
                  description: >-
                    Sections, each with its own `checklistItems`. Each needs an
                    `id`.
                  items:
                    type: object
                    required:
                      - id
                    properties:
                      id:
                        type: string
                        format: uuid
                        description: >-
                          **Required for API keys.** An existing section's id
                          updates it; a new UUID creates it.
                      title:
                        type:
                          - string
                          - 'null'
                      description:
                        type:
                          - string
                          - 'null'
                      order:
                        type: number
                      checklistItems:
                        type:
                          - array
                          - 'null'
                        description: Steps in this section. Each needs an `id`.
                        items:
                          type: object
                          required:
                            - id
                            - type
                          properties:
                            id:
                              type: string
                              format: uuid
                              description: >-
                                **Required for API keys.** An existing step's id
                                updates that step; a new UUID (generated by you)
                                creates the step.
                            type:
                              type: string
                              description: >-
                                Step type, for example `passFail`, `textField`,
                                `number`, `temperature`, `takePhoto`,
                                `signature`, `dateTime`, `dropdown`,
                                `multipleChoice`, `instruction`, `header`.
                            description:
                              type:
                                - string
                                - 'null'
                              description: The question or instruction text.
                            unit:
                              type:
                                - string
                                - 'null'
                            order:
                              type: number
                              description: >-
                                Position within its parent (template or
                                section).
                            options:
                              description: >-
                                Type-specific configuration. Ignored for
                                `passFail` (Pass / Fail / N/A is set by the
                                server). For option-bearing types such as
                                `dropdown` or `multipleChoice`, copy the shape
                                from **Get Template** on a template built in the
                                app.
                            required:
                              type: boolean
                            isImageOrNoteRequired:
                              type: boolean
                            score:
                              type:
                                - number
                                - 'null'
                            attachments:
                              description: Array of attachment URLs or keys.
                            info:
                              description: >-
                                Extra step configuration, as returned by Get
                                Template.
                deletedItemIds:
                  type:
                    - array
                    - 'null'
                  items:
                    type: string
                    format: uuid
                  description: Ids of steps to remove.
                deletedSectionIds:
                  type:
                    - array
                    - 'null'
                  items:
                    type: string
                    format: uuid
                  description: >-
                    Ids of sections to remove. Their steps are kept and moved up
                    a level.
            examples:
              create:
                summary: Create a new template
                value:
                  name: Opening Safety Walk
                  description: Daily walk-through before the store opens
                  FolderId: 5e8a7c21-3b94-4d1f-8c6e-0a2b9f4d7e13
                  checklistItems:
                    - id: c1d2e3f4-a5b6-4c7d-8e9f-0a1b2c3d4e51
                      type: passFail
                      description: Fire exits are clear and unobstructed
                      order: 0
                      required: true
                  checklistSections:
                    - id: a2c4e6f8-1b3d-4f5a-8c7e-9d0b2a4c6e81
                      title: Cold storage
                      order: 1
                      checklistItems:
                        - id: d2e3f4a5-b6c7-4d8e-9f0a-1b2c3d4e5f62
                          type: temperature
                          description: Walk-in cooler temperature
                          unit: F
                          order: 0
                          required: true
                        - id: e3f4a5b6-c7d8-4e9f-8a1b-2c3d4e5f6a73
                          type: takePhoto
                          description: Photo of the cooler display
                          order: 1
              update:
                summary: Add one step and remove another
                value:
                  name: Opening Safety Walk
                  checklistItems:
                    - id: f4a5b6c7-d8e9-4f0a-9b2c-3d4e5f6a7b84
                      type: textField
                      description: Anything else to report?
                      order: 2
                  deletedItemIds:
                    - e3f4a5b6-c7d8-4e9f-8a1b-2c3d4e5f6a73
      responses:
        '200':
          description: >-
            Template saved (created or updated). The example is abridged: the
            response carries every template setting (all the PATCH keys below,
            plus internal ids such as `nameSnippetId`), and each step carries
            every step column.
          content:
            application/json:
              example:
                data:
                  id: 3f1c9a52-8e4b-4d27-9b6a-2a7e5c1d0f84
                  name: Opening Safety Walk
                  description: Daily walk-through before the store opens
                  icon:
                    icon: Default
                    color: '#FFA681'
                  image: null
                  attachments: []
                  CreatedInWorkspaceId: cb363f7e-c52a-4478-911d-f6a6f791090e
                  isPublic: false
                  isPublished: false
                  publishedAt: null
                  isScoring: false
                  isShowTimestamp: false
                  isConfirmBeforeSubmit: false
                  SubmissionType: BOTH
                  parentId: null
                  itemsCount: 3
                  totalLogsCount: 0
                  isActive: true
                  enableAiSummary: false
                  pdfAiSummary: false
                  emailAiSummary: false
                  templateContext: ''
                  isGeofenceRequired: false
                  geofenceMode: null
                  scoringMethodology: additive
                  overallScoreRollup: totalPoints
                  scoreDisplayMode: percentage
                  CreatedBy: 37d98201-9f3a-41fd-89b3-3be457c3f7ba
                  UpdatedBy: 37d98201-9f3a-41fd-89b3-3be457c3f7ba
                  createdAt: '2026-11-20T14:02:11.418Z'
                  updatedAt: '2026-11-20T14:02:11.418Z'
                  WorkspaceChecklist:
                    id: 6d5c4b3a-2f1e-4d0c-9b8a-7f6e5d4c3b29
                    WorkspaceId: cb363f7e-c52a-4478-911d-f6a6f791090e
                    ChecklistId: 3f1c9a52-8e4b-4d27-9b6a-2a7e5c1d0f84
                    isEditable: true
                    logsCount: 0
                    isPubliclyAccessible: false
                    isPrivateOnMobile: false
                    isRequestForm: false
                    isNameAndEmailRequired: false
                    isQREnable: false
                    archivedAt: null
                    FolderId: 5e8a7c21-3b94-4d1f-8c6e-0a2b9f4d7e13
                    scoreConfig: null
                    viewByDeductionRange: true
                    sendSubmitterEmail: false
                    sendLocationEmail: false
                    collapseSections: false
                  Creator:
                    id: 37d98201-9f3a-41fd-89b3-3be457c3f7ba
                    firstName: Dana
                    lastName: Reyes
                  ChecklistItems:
                    - id: c1d2e3f4-a5b6-4c7d-8e9f-0a1b2c3d4e51
                      type: passFail
                      description: Fire exits are clear and unobstructed
                      unit: null
                      order: 0
                      score: null
                      options:
                        - type: success
                          label: Pass
                          value: pass
                        - type: error
                          label: Fail
                          value: fail
                        - type: info
                          label: N/A
                          value: na
                      attachments: []
                      isImageOrNoteRequired: false
                      required: true
                      info: null
                      ParentId: null
                      RelatedAutomationId: null
                      WorkspaceId: cb363f7e-c52a-4478-911d-f6a6f791090e
                      ChecklistId: 3f1c9a52-8e4b-4d27-9b6a-2a7e5c1d0f84
                      ChecklistSectionId: null
                      ItemCategoryId: null
                      isActive: true
                      enforceRealTimeLocation: false
                      CreatedBy: 37d98201-9f3a-41fd-89b3-3be457c3f7ba
                      UpdatedBy: 37d98201-9f3a-41fd-89b3-3be457c3f7ba
                      createdAt: '2026-11-20T14:02:11.418Z'
                      updatedAt: '2026-11-20T14:02:11.418Z'
                  ChecklistSections:
                    - id: a2c4e6f8-1b3d-4f5a-8c7e-9d0b2a4c6e81
                      title: Cold storage
                      description: null
                      order: 1
                      isActive: true
                      ChecklistId: 3f1c9a52-8e4b-4d27-9b6a-2a7e5c1d0f84
                      ParentId: null
                      ParentSectionId: null
                      WorkspaceId: cb363f7e-c52a-4478-911d-f6a6f791090e
                      RelatedAutomationId: null
                      repeat: null
                      CreatedBy: 37d98201-9f3a-41fd-89b3-3be457c3f7ba
                      UpdatedBy: 37d98201-9f3a-41fd-89b3-3be457c3f7ba
                      createdAt: '2026-11-20T14:02:11.418Z'
                      updatedAt: '2026-11-20T14:02:11.418Z'
                      ChecklistItems:
                        - id: d2e3f4a5-b6c7-4d8e-9f0a-1b2c3d4e5f62
                          type: temperature
                          description: Walk-in cooler temperature
                          unit: F
                          order: 0
                          score: null
                          options: null
                          attachments: []
                          isImageOrNoteRequired: false
                          required: true
                          info: null
                          ParentId: null
                          RelatedAutomationId: null
                          WorkspaceId: cb363f7e-c52a-4478-911d-f6a6f791090e
                          ChecklistId: 3f1c9a52-8e4b-4d27-9b6a-2a7e5c1d0f84
                          ChecklistSectionId: a2c4e6f8-1b3d-4f5a-8c7e-9d0b2a4c6e81
                          ItemCategoryId: null
                          isActive: true
                          enforceRealTimeLocation: false
                          CreatedBy: 37d98201-9f3a-41fd-89b3-3be457c3f7ba
                          UpdatedBy: 37d98201-9f3a-41fd-89b3-3be457c3f7ba
                          createdAt: '2026-11-20T14:02:11.418Z'
                          updatedAt: '2026-11-20T14:02:11.418Z'
                        - id: e3f4a5b6-c7d8-4e9f-8a1b-2c3d4e5f6a73
                          type: takePhoto
                          description: Photo of the cooler display
                          unit: null
                          order: 1
                          score: null
                          options: null
                          attachments: []
                          isImageOrNoteRequired: false
                          required: false
                          info: null
                          ParentId: null
                          RelatedAutomationId: null
                          WorkspaceId: cb363f7e-c52a-4478-911d-f6a6f791090e
                          ChecklistId: 3f1c9a52-8e4b-4d27-9b6a-2a7e5c1d0f84
                          ChecklistSectionId: a2c4e6f8-1b3d-4f5a-8c7e-9d0b2a4c6e81
                          ItemCategoryId: null
                          isActive: true
                          enforceRealTimeLocation: false
                          CreatedBy: 37d98201-9f3a-41fd-89b3-3be457c3f7ba
                          UpdatedBy: 37d98201-9f3a-41fd-89b3-3be457c3f7ba
                          createdAt: '2026-11-20T14:02:11.418Z'
                          updatedAt: '2026-11-20T14:02:11.418Z'
                  ChecklistAccess:
                    - id: 0b1c2d3e-4f5a-4b6c-8d7e-9f0a1b2c3d41
                      ChecklistId: 3f1c9a52-8e4b-4d27-9b6a-2a7e5c1d0f84
                      WorkspaceId: cb363f7e-c52a-4478-911d-f6a6f791090e
                      AccessorId: 37d98201-9f3a-41fd-89b3-3be457c3f7ba
                      isEveryone: false
                      groupId: 9a8b7c6d-5e4f-4a3b-8c2d-1e0f9a8b7c65
                      role: admin
                    - id: 1c2d3e4f-5a6b-4c7d-9e8f-0a1b2c3d4e52
                      ChecklistId: 3f1c9a52-8e4b-4d27-9b6a-2a7e5c1d0f84
                      WorkspaceId: cb363f7e-c52a-4478-911d-f6a6f791090e
                      AccessorId: null
                      isEveryone: true
                      groupId: 2d3e4f5a-6b7c-4d8e-8f9a-1b2c3d4e5f63
                      role: submitter
                  SubmissionAccess:
                    - id: 3e4f5a6b-7c8d-4e9f-9a0b-2c3d4e5f6a74
                      ChecklistId: 3f1c9a52-8e4b-4d27-9b6a-2a7e5c1d0f84
                      WorkspaceId: cb363f7e-c52a-4478-911d-f6a6f791090e
                      groupId: 4f5a6b7c-8d9e-4f0a-8b1c-3d4e5f6a7b85
                      AccessorId: 37d98201-9f3a-41fd-89b3-3be457c3f7ba
                      isEveryone: false
                      canEdit: false
                      permission: CAN_VIEW_ALL_SUBMISSIONS
                  itemCategories: []
                  templateAccess:
                    isAdmin: true
                    isSubmitter: true
                  logsCount: 0
                  isPubliclyAccessible: false
                  isNameAndEmailRequired: false
                  isQREnable: false
                  scoreConfig: null
                  viewByDeductionRange: true
                  sendSubmitterEmail: false
                  sendLocationEmail: false
                  collapseSections: false
                  canChangeScoringMethodology: true
                  scoringMethodologyLockReason: null
                meta: {}
        '400':
          description: >-
            Bad Request - the workspace's trial or subscription has ended. Also
            returned when a step or section uses something the workspace does
            not have enabled (for example repeating sections).
        '401':
          description: >-
            Unauthorized - `Invalid client credentials`, or `Client does not
            belong to this workspace` when `workspaceId` is not the key's
            workspace.
        '403':
          description: >-
            Forbidden - `API key not authorized for this route` (path is not the
            workspace-in-path form, or `templateId` is not a UUID), or the key's
            user lacks the permission: `You don't have permission "Can manage
            checklist checklist super admin".` Also returned when the template
            is not editable in this workspace (`Your workspace does not have
            permission to edit this template!`), when it is a brand template
            shared into this franchisee workspace, or when the user may only
            reorder the template.
        '422':
          description: >-
            Unprocessable Entity - the body failed validation (for example a
            missing `name`, an unknown key such as `isPublished`), or a step or
            section has no `id`.
          content:
            application/json:
              example:
                error:
                  error: >-
                    ValidationError: Every step and section needs an id.
                    Generate a UUID for new ones.
                  message: >-
                    Every step and section needs an id. Generate a UUID for new
                    ones.
                  meta: {}
        '426':
          description: >-
            Upgrade Required - creating this template would go over the plan's
            template limit.
          content:
            application/json:
              example:
                error:
                  message: You’ve exceeded your usage of Operations Templates.
                  meta:
                    paywall: Operations Templates
        '500':
          description: Internal Server Error.
      security:
        - clientKey: []
          clientSecret: []
components:
  securitySchemes:
    clientKey:
      type: apiKey
      in: header
      name: x-client-key
    clientSecret:
      type: apiKey
      in: header
      name: x-client-secret

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.