---
title: "Create document from template"
method: POST
path: "/documents/create-from-template"
tags: ["General"]
---

# Create document from template

`POST /documents/create-from-template`

<small>Requires an API token with the **Document Manager** role.</small>

Creates a new [document](/#documents) based on the [template](/#templates) with the given UUID.

> **Note:** When a provided signatory's email corresponds to an existing user in the current fynk account,
> the signatory will be linked to that user. Any additional fields (`first_name`, `last_name`, `mobile_phone`,
> `title`) will be ignored and the signatory information will be populated from the existing user's profile.

## Request body

- CreateDocumentFromTemplateRequest
  - `name` string, nullable — The new document's name. If omitted, the name of the template will be used as the new document's name
  - `template_uuid` string, uuid, required — UUID of the template to use as a basis for the new document
  - `initial_stage` 'draft' | 'signing', nullable — If set, the document will be moved to this stage after creation. The default is `draft`. Depending on the template, moving to `signing` may require that the `dynamic_field_values`, `parties` and/or `signatories` fields are also provided.
  - `owner_emails` string[] — Email addresses of the user(s) from your account who should be given ownership of the new document
  - `dynamic_field_values` object, required — Initial values for the document's dynamic fields. Each key must identify a dynamic field on the template by either its `ref_uuid` or its `name`. Values accept the same format as the [Update dynamic field](/operations/v1.documents.dynamic-fields.update) endpoint.
  - `parties` object[] — Party data to update on document creation, keyed by the party's `ref_uuid`, `reference`, or `entity_name` from the template.
    - `entity_name` string, nullable
    - `address` string, nullable
  - `signatories` array[] — Signatories to add to the document on creation, keyed by their party's `ref_uuid`, `reference`, or `entity_name` from the template. Currently, signatories can only be provided for *external* parties, i.e. those where `is_internal_party` is `false` If an email corresponds to an existing user in the current fynk account, the signatory will be linked to that user and `first_name`, `last_name`, `mobile_phone` and `title` will be populated from the user's profile.
    - object[]
      - `email` string, email, required
      - `first_name` string, nullable
      - `last_name` string, nullable
      - `mobile_phone` string, nullable — Mobile phone number in E.164 format
      - `title` string, nullable

## Response `201`

`DocumentDetailResource`

- object
  - `data` DocumentDetailResource, required
    - `uuid` string, required
    - `name` string, required
    - `signature_type` 'aes' | 'qes' | 'ses', required
    - `sequential_signing` boolean, required — When true, signatories will sign one at a time, in ascending order by their `signing_order`. When false, signatories may sign in any order
    - `origin` 'signed_pdf' | 'signed_pdf_external_account' | 'template' | 'scratch' | 'onboarding' | 'pdf', required
    - `stage` 'draft' | 'approved_draft' | 'review' | 'approved_review' | 'signing' | 'done', required
    - `locale` string, nullable, required
    - `template_uuid` string, required — UUID of the [template](/#templates) the document was created from, if any
    - `document_type_uuid` string, required — UUID of the [document type](/#document-types) assigned to the document, if any
    - `external_signatory_invitation_message` string, nullable, required — This text will be displayed in the email notification sent to users when the document is ready for signing
    - `created_at` string, date-time, nullable, required
    - `updated_at` string, date-time, nullable, required
    - `archived_at` string, date-time, nullable, required
    - `parties` DocumentPartySnippetResource[], required — The people and/or organizations that will be involved in signing the document
      - `uuid` string, required
      - `ref_uuid` string, required — If the document containing this party was created from a template, this identifier will be the same as the `ref_uuid` of the corresponding party in the source template.
      - `reference` string, nullable, required — A generic reference for the party
      - `entity_name` string, nullable, required — The actual name of the party. May be null if the party was created via a Template's "set later" option
      - `address` string, nullable, required
      - `scope` 'internal' | 'internal_and_external', required
      - `is_internal_party` boolean, required — Indicates whether this party is linked to an account party (internal) or is standalone (external)
      - `is_ready_for_signing` boolean, required — `true` indicates that an external party has indicated they are ready to sign
      - `ready_for_signing_at` string, date-time, nullable, required
      - `created_at` string, date-time, nullable, required
      - `updated_at` string, date-time, nullable, required
    - `teams` TeamSnippetResource[]
      - `uuid` string, required
      - `name` string, required
    - `integration_reference` IntegrationReferenceResource
      - `integration_type` 'salesforce' | 'hubspot' | 'pipedrive', required
      - `object_type` string, required — Indicates which type of CRM object the document is linked to. Values will vary depending on the `integration_type`
      - `external_id` string, required — The external system's ID for the specific CRM object that the document is linked to
      - `external_name` string, required — The external system's name for the specific CRM object that the document is linked to
    - `users` DocumentUserResource[] — Everyone who has access to the document, each with their access level (`role`)
      - `uuid` string, required
      - `first_name` string, nullable, required
      - `last_name` string, nullable, required
      - `email` string, nullable, required
      - `title` string, nullable, required
      - `party_uuid` string, nullable, required — UUID of the [party](/#parties) the user belongs to, if any
      - `has_account_user` boolean, required — `true` if the document user has a fynk user belonging to your account
      - `role` 'owner' | 'collaborator' | 'viewer', required — The representation of a document user's access level in the external API. Internally the access level is held in the document user's roles (where a plain viewer simply has no role); the external API always exposes it as one of these three values.
      - `is_signatory` boolean, required — `true` if the user is also a [signatory](/#signatories) of the document. Use the signatory endpoints to manage this
      - `personal_link` ShareableLinkResource
        - `uuid` string, required
        - `url` string, required — The link URL. Treat it like a secret: anyone who has the URL can access the document with it
        - `expires_at` string, date-time, nullable, required — When the link stops working. `null` means the link never expires
        - `message` string, nullable, required — A personal message shown when the link is opened. Always `null` for public links
        - `created_at` string, date-time, nullable, required
    - `signatories` SignatoryResource[] — These are the users who will sign the document during the `signing` stage
      - `uuid` string, required
      - `first_name` string, nullable, required
      - `last_name` string, nullable, required
      - `email` string, nullable, required
      - `mobile_phone` string, nullable, required — Mobile phone number, in E.164 format
      - `title` string, nullable, required
      - `profile_photo_url` string, nullable, required
      - `signing_order` integer, nullable, required — When sequential signing is enabled, signatories will sign in ascending order of their `signing_order`
      - `has_account_user` boolean, required — `true` if the signatory has a fynk user belonging to your account
      - `party_uuid` string, nullable, required — UUID of the party that the signatory signs for
    - `dynamic_fields` DynamicFieldResource[]
      - `uuid` string, required
      - `ref_uuid` string, required — A static reference identifier, allowing dynamic fields in documents to be matched their corresponding field in the document's source template.
      - `type` 'id' | 'uuid' | 'bool' | 'date' | 'duration' | 'email' | 'list' | 'number' | 'currency' | 'currency_duration' | 'clause' | 'select' | 'multi_select' | 'text' | 'textarea' | 'timestamp' | 'array' | 'enum', required
      - `name` string, required
      - `scope` 'internal' | 'internal_and_external', required
      - `settings` MultiFieldSettingsResource, required
        - `currencies` string[], required — For `currency` or `currency_duration` fields, defines the currencies that can be assigned to the field's values
      - `autofill_type` 'document_created_date' | 'document_review_date' | 'document_signing_date', required
      - `format` DynamicFieldFormatResource, required
        - `decimals` integer, required
        - `decimal_separator` string, required
        - `thousands_separator` string, required
      - `select_values` string[], nullable, required — When `type` is "select" or "multi_select", defines the possible values for `value`
      - `is_mandatory` boolean, required
      - `question` string, nullable, required
      - `question_external` string, nullable, required — Question variant for external users
      - `value` union, required — The field's value, if it has been set
        - string
        - boolean
        - unknown[]
          - unknown
      - `order` integer, nullable, required
    - `metadata_values` MetadataValueResource[]
      - `uuid` string, required
      - `metadata` MetadataResource, required
        - `uuid` string, required
        - `type` 'system_autofilled' | 'system_computed' | 'system' | 'system_reference' | 'account', required
        - `value_type` 'id' | 'uuid' | 'bool' | 'date' | 'duration' | 'email' | 'list' | 'number' | 'currency' | 'currency_duration' | 'clause' | 'select' | 'multi_select' | 'text' | 'textarea' | 'timestamp' | 'array' | 'enum', required
        - `name` string, required
        - `display_name` string, required
        - `settings` MultiFieldSettingsResource, required
          - `currencies` string[], required — For `currency` or `currency_duration` fields, defines the currencies that can be assigned to the field's values
        - `select_values` string[], nullable, required — When `value_type` is `select`, defines the possible values for the metadata's value
        - `always_exists` boolean, required
        - `description` string, nullable, required
        - `keywords` string, nullable, required — Keywords to help with metadata identification.
        - `prompt` string, nullable, required — An AI prompt used for metadata extraction.
        - `is_contract_value` boolean, required — If true, this metadata will be included in the calculated "contract value" if it is present in a document. Only relevant when the value type is one of: `currency`, `currency_duration`
        - `relevant_document_type_uuids` string[], nullable, required — UUIDs of document types this metadata is relevant for. `null` means not relevant to any. `[]` means relevant to all.
      - `reference_dynamic_field_uuid` string, nullable, required
      - `value_source` 'user' | 'ai_analysis' | 'computed' | 'autofilled' | 'dynamic_field' | 'linked_document', required
      - `value` union, required — The metadata's value
        - string
        - boolean
        - unknown[]
          - unknown
      - `value_currency_monthly` string, nullable, required
      - `value_currency_yearly` string, nullable, required
      - `computed_status` 'missing_information' | 'conflicting_information' | 'not_applicable' | 'computed', required
      - `computed_value` union, required
        - string
        - boolean
        - unknown[]
          - unknown
      - `is_attached` boolean, required
      - `computed_at` string, date-time, nullable, required
    - `tags` TagResource[]
      - `uuid` string, required
      - `name` string, nullable, required
      - `color` string, required — Hex color code for the color that the tag has been assigned

## Other responses

- `401` — Unauthenticated
- `403` — Authorization error
- `422` — Validation error

---

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