---
title: "Create a template"
method: POST
path: "/templates"
tags: ["templates"]
---

# Create a template

`POST /templates`

## Request

- Base URL: `https://docs-api.formify.eu/v1`
- URL: `https://docs-api.formify.eu/v1/templates`
- Auth: OAuth 2 (authorization code, authorization URL `https://docs-api.formify.eu/v1/oauth/authorize`, token URL `https://docs-api.formify.eu/v1/oauth/token`, scopes: `write`)

Creates a reusable template from a file you have already uploaded with `POST /files`.

A template stores a document together with its signature fields, so a later `POST /docs` (or
`POST /docs/drafts`) with `templateId` only has to supply the recipients.

### Requirements
- `fileId` is **required**.
- `signeeDetails` must contain at least one field.
- Contact details on a field are optional. Store them to pre-fill a recurring counterparty, or leave
  them out and supply them per document.

Requires the `templates` capability. Check `GET /account/capabilities`.

## Request body

- CreateTemplateRequest
  - `fileId` string, uuid, required: File ID from `POST /files`
  - `name` string: Name of the template
  - `sharingSetting` 'private' | 'shared': `private` (default) — only you can use and manage the template. `shared` — everyone on the account can. Requires the `accessLevels` capability.
  - `signeeDetails` TemplateSignatureFieldRequest[], required: The signature fields to store on the template. At least one is required. Nothing inside them is required. `fullName` is normally a role label such as `"Buyer"`, and contact details can be left out and supplied per document.
    - `fullName` string: What this field is called. A role label such as `"Buyer"` when the signer is not known yet, or a real name when the same person always signs. A document created from the template replaces it with whatever it supplies.
    - `emailAddress` string, email: Optional. Store a contact address only for a signee who is the same every time.
    - `phoneNumber` string: Optional. International format with a leading `+` and 9 to 15 digits. Requires the `deliverySms` or `deliveryWhatsapp` capability to be used on a document.
    - `phoneNumberDeliveryMethod` 'sms' | 'whatsapp': See `SignatureField.phoneNumberDeliveryMethod`. Only applicable when `phoneNumber` is set.
    - `signatureType` 'digital_ink' | 'bankid_identification' | 'digital_ink_id_scan' | 'face_liveness': Same values and capability requirements as `SignatureField.signatureType`.
    - `signaturePlacement` 'existing' | 'new_page': Same as `SignatureField.signaturePlacement`. `digital_ink_id_scan` must use `existing`.
    - `signingOrder` integer: The signing turn to store on this field. Only has an effect on a document created with `enableSigningOrder: true`.
    - `signatureBox` object: Placement of the signature field. Required when `signaturePlacement` is `existing`. Base size before scaling: - Width: 219 points - Height: 58 points
      - `page` integer: Page number where the signature box should be placed. The first page has index 0.
      - `x` integer: X-coordinate for the signature box placement (minimum value 0)
      - `y` integer: Y-coordinate for the signature box placement (minimum value 0)
      - `scale` number, float: Scales the entire signature field.
    - `idScanBox` object: Placement of the scanned ID placeholder, required when `signatureType` is `digital_ink_id_scan`. Base size before scaling: - Width: 218 points - Height: 138 points
      - `page` integer: Page number where the ID scan placeholder should be placed. The first page has index 0.
      - `x` integer: X-coordinate for the ID scan placeholder placement (minimum value 0)
      - `y` integer: Y-coordinate for the ID scan placeholder placement (minimum value 0)
      - `scale` number, float: Scales the entire ID scan placeholder.
  - `enableSigningOrder` boolean: Store a sequential signing order on the template. Requires the `signingOrder` capability.
  - `errorLanguage` 'en' | 'sv' | 'es': Language for error messages

## Response `201`

Template created successfully

- TemplateCreatedResponse
  - `templateId` string, uuid: Unique identifier of the template
  - `name` string: Name of the template
  - `createdAt` string, date-time: Template creation timestamp
  - `userId` string, uuid: User ID of the template owner
  - `sharingSetting` 'shared' | 'private': Who on the account may use and manage the template

## Other responses

- `400`: Invalid request parameters (missing field, wrong format, coordinates outside the document, etc.)
- `401`: Unauthorized - Missing or invalid access token.
- `403`: Forbidden - not the owner, or the `templates` capability is missing.
- `404`: Template not found
- `500`: Internal server error

---

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