---
title: "Save a document template (NDA, contract, SOP, letterhead) for reuse across sessions."
method: POST
path: "/v1/templates/upload-base64"
tags: ["v1", "mcp", "templates"]
---

# Save a document template (NDA, contract, SOP, letterhead) for reuse across sessions.

`POST /v1/templates/upload-base64`

## Request

- Base URL: `https://api.superdocs.app`
- URL: `https://api.superdocs.app/v1/templates/upload-base64`
- Auth: HTTP bearer

Templates persist across sessions and can be referenced by the AI when drafting new documents (e.g., "draft an NDA using my standard template"). Stored at user or organization scope. Ideal for boilerplate, branded letterheads, recurring document structures, or compliance-required templates. Supports the same formats as document upload: .docx, .pdf, .txt, .rtf, .md, .html, .htm, .tex. Max 50 MB validated; note the hosted transport layer caps any REQUEST BODY at ~32 MB and rejects larger ones at the gateway with an HTML (not JSON) error — base64 inflates content ~33%, so inline uploads are reliable up to ~20 MB of file bytes; beyond that use request_upload_url (pre-signed flow, up to 100 MB).

## Headers

- `authorization` string, nullable

## Request body

- Base64UploadRequest: JSON request body for base64-encoded file uploads.
  - `filename` string, required: Original filename with extension (e.g. 'contract.pdf'). Used for file type detection.
  - `file_base64` string, required: Base64-encoded file content.
  - `session_id` string, nullable: Session ID. Auto-generated if not provided.
  - `return_html` boolean: With a session_id: false (default) returns compact metadata only (chunks_count, version_id, page_setup) — the document is loaded into the session and you edit it via chat, keeping your context small; true returns the full parsed HTML inline. Ignored on the convert-only path (no session_id), which always returns the converted html.

## Response `200`

Successful Response

- unknown

## Other responses

- `422`: Validation Error

---

[API](https://skmtc.dev/superdocs/apis/universal-document-ai-api.md) · [All operations](https://skmtc.dev/superdocs/apis/universal-document-ai-api/llms.txt) · [OpenAPI document](https://skmtc.dev/superdocs/apis/universal-document-ai-api/revisions/37d03122940b?raw)
