---
title: "Get template by its ID"
url: "https://developers.vzconnect.com/apis/fleet-inspections-api/versions/e4689b0c-c26d-40d6-b023-5303083c4a3f/operations/templates-id-get"
---

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

# Get template by its ID

`GET` `/inspections/templates/{template-id}`

Operation ID: `templates-id-get`

Returns an individual template along with its items.

## Path parameters

- `template-id` (string, required) - Template identifier

## Responses

- `200` - Ok
- `400` - Bad Request
- `401` - Unauthorized
- `403` - Forbidden
- `404` - Not Found
- `429` - Too Many Requests
- `default` - Internal Server Error

## OpenAPI definition

```yaml
openapi: 3.0.0
info:
  title: Fleet Inspections API
  version: "1.0"
servers:
  - url: https://api.us.vzconnect.com
paths:
  /inspections/templates/{template-id}:
    parameters:
      - name: template-id
        in: path
        description: Template identifier
        required: true
        schema:
          $ref: "#/components/schemas/Identifier"
    get:
      tags:
        - Fleet Inspections API
      summary: Get template by its ID
      description: Returns an individual template along with its items.
      operationId: templates-id-get
      responses:
        "200":
          description: Ok
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Template"
              examples:
                Template with items:
                  value:
                    templateItems:
                      - name: Odometer reading
                        templateItemId: X8mg1bE81gKHxaTe
                        valueType: METER
                      - comment: Where vehicle has been inspected
                        name: Where inspected
                        templateItemId: sLt5QVmBSdcRDmjz
                        valueType: LOCATION
                      - templateItemId: cQcGZfvHY2spcM88
                        name: Steering wheel play
                        comment: Confirm no backlash
                        tags:
                          - Steering Mechanism
                        valueType: CHECK
                      - name: Steering linkage
                        templateItemId: Xumn1qDssT4LjUEd
                        tags:
                          - Steering Mechanism
                        valueType: CHECK
                      - name: Air compressor last operator
                        templateItemId: TArcm8HVXF2nAEFN
                        requireValue: true
                        valueType: TEXT
                      - name: Inside Cabin
                        templateItemId: 3p8HsT4uXAUgmyFD
                        requireValue: false
                        valueType: PHOTO
                    itemsSelectionType: SELECT_DEFECTS_ONLY
                    status: ACTIVE
                    comment: Inspection template for All trucks
                    links:
                      - method: GET
                        rel: self
                        href: /templates/LBq7fgyagQf4GaDF
                    name: All trucks
                    templateId: LBq7fgyagQf4GaDF
        "400":
          $ref: "#/components/responses/BadRequest"
          description: Bad request. The request is not valid.
        "401":
          $ref: "#/components/responses/Unauthorized"
          description: Unauthorized. The authorization token is missing or not valid.
        "403":
          $ref: "#/components/responses/Forbidden"
          description: Forbidden. The caller is not allowed to access this resource.
        "404":
          $ref: "#/components/responses/NotFound"
          description: Not found.
        "429":
          $ref: "#/components/responses/TooManyRequests"
          description: Too many requests. The rate limit has been exceeded.
        default:
          $ref: "#/components/responses/InternalServerError"
          description: An unexpected error occurred.
      deprecated: false
      x-kong-route-defaults:
        strip_path: false
        paths:
          - ~/inspections/templates/[^/]+/?$
components:
  schemas:
    Identifier:
      maxLength: 120
      minLength: 1
      pattern: ^[A-Za-z0-9-]{1,120}$
      type: string
      description: Unique identifier for a given resource.
    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.
    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
    ProblemJson:
      title: ProblemJson
      type: object
      properties:
        type:
          maxLength: 2000
          minLength: 0
          pattern: ^[^\n]*$
          type: string
          description: A URI reference that identifies the problem type.
          format: uri
        detail:
          maxLength: 2000
          minLength: 0
          pattern: ^[^\n]*$
          type: string
          description: A human-readable explanation specific to this occurrence of the
            problem.
        status:
          maximum: 599
          minimum: 300
          type: integer
          description: The HTTP status code generated by the origin server for this
            occurrence of the problem.
          format: int32
        errors:
          maxItems: 120
          minItems: 1
          uniqueItems: true
          type: array
          description: An extension that contains a list of individual error occurrences
            found, with details and a pointer to the location of each. Use this
            extension to convey more than one errors of the same type.
          items:
            type: object
            properties:
              debugId:
                maxLength: 120
                minLength: 0
                pattern: ^[^\n]*$
                type: string
                description: A unique error identifier string generated on the service-side and
                  logged for correlation purposes.
              pointer:
                maxLength: 120
                minLength: 0
                pattern: ^(\/[^\n]+)*$
                type: string
                description: A pointer to locate the problem within the request's content using
                  a [JSON Pointer](https://www.rfc-editor.org/info/rfc6901).
                  This extension is only applicable in case of 4xx range of
                  errors.
              detail:
                maxLength: 2000
                minLength: 0
                pattern: ^[^\n]*$
                type: string
                description: A human-readable explanation specific to this occurrence of the
                  problem.
            additionalProperties: false
        instance:
          maxLength: 2000
          minLength: 0
          pattern: ^[^\n]*$
          type: string
          description: A URI reference that identifies the specific occurrence of the
            problem. It may or may not yield further information if
            dereferenced.
          format: uri
        debugId:
          maxLength: 120
          minLength: 0
          pattern: ^[^\n]*$
          type: string
          description: A unique error identifier string generated on the service-side and
            logged for correlation purposes.
        pointer:
          maxLength: 120
          minLength: 0
          pattern: ^(\/[^\n]+)*$
          type: string
          description: A pointer to locate the problem within the request's content using
            a [JSON Pointer](https://www.rfc-editor.org/info/rfc6901). This
            extension is only applicable in case of 4xx range of errors.
        title:
          maxLength: 2000
          minLength: 0
          pattern: ^[^\n]*$
          type: string
          description: A short, human-readable summary of the problem type.
      additionalProperties: false
      description: JSON Schema for HTTP Problems as defined by RFC 9457
    TemplateItemValueType:
      type: string
      description: Defines the type of data element within a template
      enum:
        - CHECK
        - METER
        - TEXT
        - LOCATION
        - PHOTO
  responses:
    BadRequest:
      description: Bad Request
      content:
        application/problem+json:
          schema:
            $ref: "#/components/schemas/ProblemJson"
    Unauthorized:
      description: Unauthorized
      content:
        application/problem+json:
          schema:
            $ref: "#/components/schemas/ProblemJson"
    Forbidden:
      description: Forbidden
      content:
        application/problem+json:
          schema:
            $ref: "#/components/schemas/ProblemJson"
    NotFound:
      description: Not Found
      content:
        application/problem+json:
          schema:
            $ref: "#/components/schemas/ProblemJson"
    TooManyRequests:
      description: Too Many Requests
      content:
        application/problem+json:
          schema:
            $ref: "#/components/schemas/ProblemJson"
    InternalServerError:
      description: Internal Server Error
      content:
        application/problem+json:
          schema:
            $ref: "#/components/schemas/ProblemJson"
```
