---
title: "Update a template"
method: POST
path: "/template/update"
tags: ["Templates"]
---

# Update a template

`POST /template/update`

## Request

- Base URL: `https://apisign.io/api`
- URL: `https://apisign.io/api/template/update`
- Auth: API key in header `x-api-key`

Update a non-archived template. `name` and `content` are required on every call. Unless `content` is empty, at least one variable must resolve to a signer-completed signature field.

## Request body

- UpdateTemplateRequest
  - `id` string, required
  - `name` string, required
  - `content` string, required: Full markdown content
  - `fields` object[]: Replaces stored field definitions; omit to keep them
    - `name` string, required
    - `type` string, required
    - `completedBy` 'signer' | 'creator': Defaults to signer
    - `label` string

## Response `200`

Template updated

- object
  - `success` boolean
  - `template` Template
    - `id` string
    - `created_at` string, date-time
    - `updated_at` string, date-time
    - `org_id` string
    - `name` string
    - `content` string, nullable: Markdown with {{variables}}
    - `fields` StoredFields, nullable: Field data as stored on a contract or template
      - `fields` FieldDefinition[]
        - `name` string, required: Variable name without braces
        - `type` string, required: signature, initials, signer_name, timestamp, text, email, phone or date
        - `completedBy` 'signer' | 'creator', required
        - `label` string: Prompt shown for a text field
      - `signers` object[]: Per-signer field assignments, matched to signers by signing_order
        - `signing_order` integer
        - `signerFields` string[]
    - `archived` boolean
    - `test_mode` boolean

## Other responses

- `400`: Invalid request, or the action is not allowed in the resource's current state
- `401`: Missing, invalid, expired or deleted API key. Body: `{ "error": "Unauthorized" }`
- `404`: Resource not found in this organization
- `500`: Internal server error (also returned for a request body that is not valid JSON)

---

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