---
title: "Publish a new legal document version"
method: POST
path: "/legal/documents"
tags: ["Legal"]
---

# Publish a new legal document version

`POST /legal/documents`

## Request

- Base URL: `http://localhost:8486`
- URL: `http://localhost:8486/legal/documents`
- Auth: API key in header `x-auth-token`

Requires create:legal_document. Creates an immutable catalog row. Duplicate type+version returns 409. SHA-256 is computed server-side from content.

## Request body

- PublishLegalDocumentRequestDTO
  - `documentType` 'TERMS_AND_CONDITIONS' | 'PRIVACY_POLICY', required
  - `documentVersion` string, required
  - `content` string, required

## Response `201`

Published

- LegalDocumentVersionDTO
  - `id` integer
  - `documentType` 'TERMS_AND_CONDITIONS' | 'PRIVACY_POLICY'
  - `documentVersion` string
  - `documentHash` string
  - `content` string
  - `publishedAt` string, date-time
  - `publishedByUserId` integer
  - `publishedByDisplayName` string

## Other responses

- `400`: Validation error
- `409`: Version already exists — change version and upload again

---

[API](https://skmtc.dev/airdodge/apis/api-core.md) - [All operations](https://skmtc.dev/airdodge/apis/api-core/llms.txt) - [OpenAPI document](https://skmtc.dev/airdodge/apis/api-core/revisions/fb3c5a1055cc?raw)
