---
title: "Update a document template"
method: PUT
path: "/fleetify/document_templates/{id}"
tags: ["Dispatches_Documents"]
---

# Update a document template

`PUT /fleetify/document_templates/{id}`

## Query parameters

- `key` string, required

## Request body

- object
  - `name` string — Specify the document template name to be updated.
  - `content` DocumentTemplateContentRequest[] — An object to collect the details of form fields to be updated - data structures, validation rules. Please note that the details provided here will overwrite any existing document fields in the given template.
    - `label` string, required — Specify the label or the name of the field. The `label` specified here can be used as field name when rendering the document in the Driver app.
    - `name` string — Specify the name of the document field. A field's`name` can be used for internal references to the document field.
    - `type` '`string`' | '`number`' | '`date_time`' | '`photos`' | '`multi_choices`' | '`signature`' | '`barcode`' | '`single_choice`', required — Specify the data type of the field. It corresponds to the type of information that the driver needs to collect.
    - `required` boolean — Specify if it is mandatory to fill the field. Default value is false.
    - `validation` object — Specify the validation rules for the field. This can be used to enforce data quality and integrity checks. For example, if the field is a number type, `validation` can define constraints like minimum / maximum number values.
      - `min` integer — Specifies the minimum allowed value for `number` type document field. Input values must be greater than or equal to this threshold.
      - `max` integer — Specifies the maximum allowed value for `number` type document field. Input values must be less than or equal to this threshold.
      - `min_items` integer — Specifies the minimum number of items for `multi_choices`, `photos` type document fields. The number of provided input items must be greater than or equal to this threshold.
      - `max_items` integer — Specifies the maximum number of items for `multi_choices`, `photos` type document fields. The number of provided input items must be less than or equal to this threshold.
    - `meta` object — An object to define additional information required for `single_choice` or `multi_choices` type document items.
      - `options` object[], required — An array of objects to define options for a `multi_choices` or `single_choice` type document field. Each object represents one option.
        - `label` string, required — Specify the label or name for the option.
        - `value` string, required — Specify the value associated with the option. This value will be submitted when the option is checked in the Driver app.

## Response `200`

- object
  - `status` integer — Returns the HTTP response code.
  - `msg` string — Returns the error message in case of a failed request. If the request is successful, this field is not present in the response.
  - `data` object — An object returning the details of the updated document template.
    - `id` string — Returns the unique ID of the document template.
    - `name` string — Returns the updated name of the document template.
    - `content` DocumentTemplateContentResponse[] — An array of object returning the details of updated data structures and validation rules for document fields. Each object represents one document field.
      - `label` string — Returns the label of the document field.
      - `name` string — Returns the name of the document field.
      - `type` string — Returns the data type of the document field. It will always belong to one of `string`, `number`, `date_time`, `photos`, `multi_choices`, `signature`, `barcode`, and `single_choice.`
      - `required` boolean — Indicates if the document field is mandatory or not.
      - `validation` object — Returns the validation rules for `number` , `multi_choices` , and `photos` document field types.
        - `min` integer — Returns the minimum allowed value for `number` type document item, as specified at the time of configuring the field. This parameter is not present in the response if it was not provided in the input.
        - `max` integer — Returns the maximum allowed value for `number` type document item, as specified at the time of configuring the field. This parameter is not present in the response if it was not provided in the input.
        - `min_items` string — Returns the minimum number of items required for `multi_choices`, `photos` type document items. This parameter will not be present in the response if it was not provided in the input.
        - `max_items` string — Returns the maximum number of items required for `multi_choices`, `photos` type document items. This parameter will not be present in the response if it was not provided in the input.
      - `meta` object — Returns the options configured for `single_choice` or `multi_choices` type document items.
        - `options` object[] — An array of objects returning the options for `multi_choices` or `single_choice` type document field. Each object represents one configured option.
          - `label` string — Returns the label for the option.
          - `value` string — Returns the value associated with the option. This value gets submitted when the option is checked in the Driver app.

---

[API](https://skmtc.dev/nextbillion-ai/apis/one-spec-service.md) · [All operations](https://skmtc.dev/nextbillion-ai/apis/one-spec-service/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/nextbillion-ai/one-spec-service/revisions/dfd629b1301e/schema)
