---
title: "Upload Export Template"
method: POST
path: "/teacher/export-templates"
tags: ["Export Templates"]
---

# Upload Export Template

`POST /teacher/export-templates`

Analyze an uploaded Word/PDF document and store it as the teacher's
export template for that document type (replaces the previous one).

## Request body

- ExportTemplateUpload
  - `doc_type` 'cours' | 'devoir' | 'evaluation', required
  - `file_content` string, required
  - `file_name` string, required
  - `content_type` string, required

## Response `200`

Successful Response

- ExportTemplateResponse
  - `doc_type` 'cours' | 'devoir' | 'evaluation', required
  - `source_filename` string, required
  - `source_format` 'docx' | 'pdf', required
  - `body_font` string, nullable, required
  - `body_size_pt` number, nullable, required
  - `justify` boolean, required
  - `heading_bold` boolean, required
  - `heading_underline` boolean, required
  - `margins_cm` number[], required — Top, right, bottom, left margins in centimeters.
  - `header_kind` 'table' | 'banner', nullable, required
  - `header_rows` array[], required
    - ExportTemplateHeaderCellResponse[]
      - `text` string, required
      - `bold` boolean, required
      - `italic` boolean, required
      - `underline` boolean, required
  - `instructions` string[], required
  - `slot_samples` object, required
  - `warnings` string[], required
  - `llm_refined` boolean, required
  - `created_at` string, date-time, nullable, required
  - `updated_at` string, date-time, nullable, required

## Other responses

- `409` — Business rule violated
- `422` — Validation Error
- `502` — Upstream LLM returned unusable output

## Changes

- **2026-09-14** `0a41d91c9d20` — 1 info
  - endpoint added

[Change history](https://skmtc.dev/excellence-ai/apis/excellence-learning/changes/teacher/export-templates/post.md)

---

[API](https://skmtc.dev/excellence-ai/apis/excellence-learning.md) · [All operations](https://skmtc.dev/excellence-ai/apis/excellence-learning/llms.txt) · [OpenAPI document](https://skmtc.dev/excellence-ai/apis/excellence-learning/revisions/2a0c1636fd3b?raw)
