---
title: "Create a document template for PDFs"
method: POST
path: "/onboarding/v2/templates"
tags: ["Onboarding"]
---

# Create a document template for PDFs

`POST /onboarding/v2/templates`

## Request

- The document declares no server URL.
- Auth: API key in header `Ocp-Apim-Subscription-Key`

Create a custom HTML document template (such as an invoice PDF layout).

## Request body

- DocumentTemplateRequest
  - `content` string, required: Raw HTML document template content (maximum 65536 bytes) Validations: - Must not be empty. - Length ({{.actual}}) must be between {{.min}} and {{.max}} bytes long.
  - `name` string, required: Display name for the document template Validations: - Required property
  - `status` string: Document template status. Defaults to active when omitted. Validations: - Values allowed are (letter case matters): active, inactive

## Response `201`

Created - document template was successfully created.

- ApiResponseWrapperTemplateResponse
  - `data` DocumentTemplateResponse
    - `created_at` string
    - `id` string: Unique identifier for the document template
    - `name` string: Display name for the document template
    - `status` string: Document template status
    - `updated_at` string
    - `url` string: Presigned GET URL for document template HTML. Present when include_url is true.
  - `errors` ErrorResponse[]: List of errors for request. Returns `null` if it is successful.
    - `code` string: Code describing the error.
    - `doc_link` string: The link for the error documentation. Follow it to gather more details about the error
    - `field` string: A validation error can specify the field that generated that error.
    - `message` string: Detailed message containing information on how to resolve the error.
    - `type` string: Type of error: validation, tax_authority, warning, general, unknown.
  - `message` string
  - `status` string: The status of the request.

## Other responses

- `400`: Bad customer request - some of the provided information is incorrect or mandatory data is missing.
- `401`: Authentication failed - missing or incorrect subscription key.
- `429`: Too many requests were sent for a short period of time. Try again a bit later.
- `5XX`: Internal server error. Its not you, its us! We are experiencing a rare and unexpected system disruption. Retry again later. The message field of the response will contain more information for the cause. Feel free to contact us.

---

[API](https://skmtc.dev/fonoa/apis/fonoa-e-invoicing.md) - [All operations](https://skmtc.dev/fonoa/apis/fonoa-e-invoicing/llms.txt) - [OpenAPI document](https://skmtc.dev/fonoa/apis/fonoa-e-invoicing/revisions/d38890cb6fcd?raw)
