---
title: "Update a Workflow"
method: PUT
path: "/v1/templates/{template_id}"
tags: ["Workflows"]
---

# Update a Workflow

`PUT /v1/templates/{template_id}`

## Request

- Base URL: `https://api.documentpro.ai`
- URL: `https://api.documentpro.ai/v1/templates/{template_id}`
- Auth: API key in header `x-api-key`

Only fields included in the request body are updated; omitted fields keep their current value.

## Path parameters

- `template_id` string, uuid, required

## Request body

- WorkflowUpdateRequest: All fields optional; only included fields are changed.
  - `template_type` string
  - `template_schema` TemplateSchema
    - `fields` TemplateField[]
      - `name` string, required: Lowercase letters, numbers, or underscore only.
      - `type` 'text' | 'number' | 'date' | 'table', required
      - `description` string
      - `required` boolean
      - `subFields` object[]: Required (at least one entry) when type is table.
        - `name` string, required
        - `type` 'text' | 'number' | 'date', required
        - `description` string
        - `required` boolean
  - `webhook_url` string, uri, nullable
  - `parser_config` ParserConfig
    - `parse_email_attachments` boolean
    - `parse_email_body` boolean
    - `date_format` string, nullable
    - `ocr_config` object
      - `use_ocr` boolean
      - `detect_layout` boolean
      - `detect_tables` boolean
      - `remove_headers` boolean
      - `remove_footers` boolean
      - `remove_tables` boolean
    - `query_config` object
      - `query_model` string
      - `page_ranges` string
      - `start_regex` string, nullable
      - `end_regex` string, nullable
      - `split_regex` string, nullable
      - `use_all_matches` boolean

## Response `200`

Workflow updated.

- Workflow
  - `template_id` string, uuid: template_id and workflow_id are used interchangeably.
  - `template_title` string
  - `template_type` string
  - `template_category` string
  - `template_schema` TemplateSchema
    - `fields` TemplateField[]
      - `name` string, required: Lowercase letters, numbers, or underscore only.
      - `type` 'text' | 'number' | 'date' | 'table', required
      - `description` string
      - `required` boolean
      - `subFields` object[]: Required (at least one entry) when type is table.
        - `name` string, required
        - `type` 'text' | 'number' | 'date', required
        - `description` string
        - `required` boolean
  - `email_id` string, email: Auto-generated address for forwarding documents to this Workflow.
  - `webhook_url` string, uri, nullable
  - `parser_config` ParserConfig
    - `parse_email_attachments` boolean
    - `parse_email_body` boolean
    - `date_format` string, nullable
    - `ocr_config` object
      - `use_ocr` boolean
      - `detect_layout` boolean
      - `detect_tables` boolean
      - `remove_headers` boolean
      - `remove_footers` boolean
      - `remove_tables` boolean
    - `query_config` object
      - `query_model` string
      - `page_ranges` string
      - `start_regex` string, nullable
      - `end_regex` string, nullable
      - `split_regex` string, nullable
      - `use_all_matches` boolean
  - `created_at` string, date-time

## Other responses

- `400`: Malformed request or invalid arguments.
- `404`: The requested resource does not exist on this account.
- `500`: Something went wrong on DocumentPro's side.

---

[API](https://skmtc.dev/documentpro/apis/documentpro-api.md) · [All operations](https://skmtc.dev/documentpro/apis/documentpro-api/llms.txt) · [OpenAPI document](https://skmtc.dev/documentpro/apis/documentpro-api/revisions/05d6bd485e28?raw)
