---
title: "Update a template's document with a cached S3 file upload"
method: PUT
path: "/templates/{template_id}?endpoint_variant=update_template_pdf_with_cached_upload"
tags: ["Templates"]
---

# Update a template's document with a cached S3 file upload

`PUT /templates/{template_id}?endpoint_variant=update_template_pdf_with_cached_upload`

Updates a PDF template's document using a cached file upload. This is a three-step process:
First, request a presigned URL to upload your PDF file to our S3 bucket. Then, use that URL to
upload your PDF file. Finally, submit the ID of the uploaded file to replace the template's
document.

## Path parameters

- `template_id` string, required

## Request body

- object
  - `template` object, required
    - `add_data_request_submission_id_footers` boolean
    - `allow_additional_properties` boolean
    - `defaults` object
      - `alignment` 'left' | 'center' | 'right'
      - `backgroundColor` string, nullable
      - `bold` boolean
      - `characterSpacing` number
      - `checkBackgroundColor` string, nullable
      - `checkCharacter` string, nullable
      - `checkColor` string, nullable
      - `color` string, nullable, required
      - `dateFormat` string, nullable
      - `dateTimeFormat` string, nullable
      - `falseText` string, nullable
      - `fontSize` number, required
      - `opacity` number
      - `shapeBorderColor` string, nullable
      - `shapeBorderWidth` number
      - `shapeFillColor` string, nullable
      - `textColor` string, nullable
      - `trueText` string, nullable
      - `typeface` string, nullable, required
      - `uppercase` boolean
    - `description` string, nullable
    - `document` union
      - object
      - string
    - `editable_submissions` boolean
    - `embed_domains` string, nullable
    - `embed_edit_allow_document_replacement` boolean — Allow the embedded template editor to replace the template's PDF document.
    - `embed_edit_allow_settings` boolean — Allow the embedded template editor to change sensitive template settings (webhooks, redirect URL, encryption, public access, expiration, etc.)
    - `embed_edit_allow_versioning` boolean — Allow the embedded template editor to publish, restore, diff, and delete published versions.
    - `encrypt_pdfs` boolean
    - `encrypt_pdfs_password` string, nullable
    - `expiration_interval` 'minutes' | 'hours' | 'days'
    - `expire_after` number
    - `expire_submissions` boolean
    - `external_predefined_fields_template_id` string, nullable
    - `external_predefined_fields_template_name` string, nullable
    - `field_dependencies` object[] — Template-level field dependency rules (conditional logic). Each rule shows/hides or conditionally requires its target fields based on the value or presence of other fields.
      - `action` 'require_and_show' | 'show' | 'require', required
      - `conditions` object[], required
        - `field` string, required
        - `operator` 'present' | 'blank' | 'equals' | 'not_equals' | 'in' | 'gt' | 'gte' | 'lt' | 'lte' | 'range', required
        - `rangeMax` union
          - number
          - string
        - `value` unknown
      - `group` string
      - `match` 'all' | 'any'
      - `targets` string[], required
    - `field_order` array[]
      - number[]
    - `fields` object
    - `fields_patch` object[] — Array of field updates to apply
    - `footer_html` string, nullable
    - `header_html` string, nullable
    - `html` string, nullable
    - `html_engine_options` object
    - `locked` boolean
    - `merge_audit_trail_pdf` boolean
    - `name` string, nullable
    - `parent_folder_id` string, nullable
    - `predefined_fields` object[]
    - `predefined_fields_sample_data` union — Sample data for predefined fields. Can be a string when sent with multipart form upload.
      - object
      - string
    - `public_submissions` boolean
    - `public_web_form` boolean
    - `redirect_url` string, nullable
    - `scss` string, nullable
    - `shared_field_data` object
    - `shared_field_data_patch` object[] — Array of shared field data updates to apply
    - `slack_webhook_url` string, nullable
    - `template_type` 'pdf' | 'html'
    - `webhook_options` object, nullable
      - `exclude_data` boolean
    - `webhook_url` string, nullable

## Response `200`

returns a template with updated document

- SuccessMultipleErrorsResponse
  - `status` 'success' | 'error', required
  - `errors` string[]

## Other responses

- `401` — authentication failed

---

[API](https://skmtc.dev/docspring/apis/docspring-api.md) · [All operations](https://skmtc.dev/docspring/apis/docspring-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/docspring/docspring-api/revisions/5726657b9432/schema)
