---
title: "Template"
url: "https://developers.vzconnect.com/apis/fleet-inspections-api/versions/e4689b0c-c26d-40d6-b023-5303083c4a3f/schemas/Template"
---

> Full API specification: https://developers.vzconnect.com/apis/fleet-inspections-api/versions/e4689b0c-c26d-40d6-b023-5303083c4a3f.md

# Template

A name will identify the template.

## OpenAPI definition

```yaml
openapi: 3.0.0
info:
  title: Fleet Inspections API
  version: "1.0"
servers:
  - url: https://api.us.vzconnect.com
components:
  schemas:
    TemplateItem:
      title: Template Item
      required:
        - name
        - valueType
      type: object
      properties:
        templateItemId:
          maxLength: 120
          minLength: 1
          pattern: ^[A-Za-z0-9-]{1,120}$
          type: string
          description: Unique identifier for a template item.
          readOnly: true
        valueType:
          $ref: "#/components/schemas/TemplateItemValueType"
        name:
          maxLength: 120
          minLength: 3
          pattern: ^\S[^\n]+\S$
          type: string
          description: Unique name of the template item.
        comment:
          maxLength: 2000
          minLength: 0
          pattern: ^(?!\s)(?!.*\s$)[\S\s]+(?<!\s)$
          type: string
          description: Additional information on the item
          nullable: true
        requireValue:
          type: boolean
          description: Marks template item as mandatory to fill in on every report based
            on the template
        tags:
          maxItems: 1
          minItems: 0
          uniqueItems: true
          type: array
          description: Labels and attributes of an item. If it is present, then the tag
            text is rendered as a group title for items in Reveal UI.
          items:
            maxLength: 80
            minLength: 1
            pattern: ^\S[^\n]*\S$
            type: string
            description: Individual label or attribute of an item
            readOnly: true
      additionalProperties: false
      description: An item can be of a valueType and is uniquely identified by the name
    ItemsSelectionType:
      type: string
      description: >
        Determines how inspection items will be presented to the drivers on the
        user interface. Specifies whether drivers need to confirm only defective
        items or must verify all inspection items regardless of condition before
        submitting the report.


        Types of template:
          - `SELECT_DEFECTS_ONLY` Requires driver to selects only the defective inspection items from the user interface during the creation of an inspection report,
          - `SELECT_ALL_ITEMS` Requires driver to check and selects all inspection items from the user interface during the creation of an inspection report
      enum:
        - SELECT_DEFECTS_ONLY
        - SELECT_ALL_ITEMS
    TemplateStatus:
      type: string
      description: >
        Status of a template:
          - ACTIVE template is visible to drivers to inspect with,
          - INACTIVE templates are used only to display historical reports and for backward compatibility of mobile apps,
          - DRAFT is in the process of being edited by the admin and not available for inspections yet.
      enum:
        - ACTIVE
        - INACTIVE
        - DRAFT
    Link:
      title: Link
      required:
        - href
        - rel
      type: object
      properties:
        rel:
          maxLength: 10
          minLength: 4
          pattern: ^(appendix|next|prev|self)$
          type: string
          description: |
            Meaning of the values [described at IANA](https://www.iana.org/assignments/link-relations/link-relations.xhtml)
              - *appendix* - refers to documents serving as an appendix to the current resource
              - *next* - context is a part of a series, and that the next in the series is the link target
              - *prev* - context is a part of a series, and that the previous in the series is the link target
              - *self* - URI of a resource or current page of the collection
        method:
          type: string
          description: HTTP method to interact with linked resource
          enum:
            - GET
            - PUT
        title:
          maxLength: 120
          minLength: 1
          pattern: ^[^\n]+$
          type: string
          description: Relation type with the target resource as human-readable text
        href:
          maxLength: 2000
          minLength: 1
          pattern: ^[^\n]+$
          type: string
          description: URL of linked resource
          format: uri-reference
      additionalProperties: false
      description: Reference to another resource
    TemplateItemValueType:
      type: string
      description: Defines the type of data element within a template
      enum:
        - CHECK
        - METER
        - TEXT
        - LOCATION
        - PHOTO
    Template:
      title: Template
      required:
        - name
      type: object
      properties:
        templateItems:
          maxItems: 200
          minItems: 0
          uniqueItems: true
          type: array
          description: Items bound to a template
          items:
            $ref: "#/components/schemas/TemplateItem"
        itemsSelectionType:
          $ref: "#/components/schemas/ItemsSelectionType"
        status:
          $ref: "#/components/schemas/TemplateStatus"
        comment:
          maxLength: 120
          minLength: 0
          pattern: ^(?!\s)(?!.*\s$)[\S\s]+(?<!\s)$
          type: string
          description: Notes about the template
          nullable: true
        links:
          maxItems: 100
          minItems: 0
          uniqueItems: true
          type: array
          description: Related resources
          readOnly: true
          items:
            $ref: "#/components/schemas/Link"
        name:
          maxLength: 60
          minLength: 3
          pattern: ^\S[^\n]+\S$
          type: string
          description: Unique name of the template.
        templateId:
          maxLength: 120
          minLength: 1
          pattern: ^[A-Za-z0-9-]{1,120}$
          type: string
          description: Unique identifier for a template.
          readOnly: true
      additionalProperties: false
      description: A name will identify the template.
```
