# Update legal texts

`PATCH https://api.tentary.com/v1/legal`

Source: https://tentary.com/de/help/api/update-legal-texts/
Area: Rechtstexte
MCP tool: `update_legal_texts`. Changes data at once.

---

Saves legal texts of the shop as HTML. Allowed tags: `h2` to `h5`, `p`, `ul`, `li`, `strong`, `a`, `br` and `hr`.

- Only the texts that you send change. An empty text removes the document.
- Buyers see the change at once.

Start from [`GET /v1/legal/templates/{document}`](https://tentary.com/de/help/api/get-legal-template/) and fill in the real data of the account. Never invent it. [`GET /v1/legal`](https://tentary.com/de/help/api/get-legal-texts/) shows which documents the country of the account needs.

## Authorization

`Authorization: Bearer <API key>`

A personal API key (tnt_...). Create it in the Tentary app on the page AI & API.

## Request body

- `terms_html` (string): Terms of service. Limits: maxLength 200000.
- `cancellation_html` (string): EU: cancellation policy. Other countries: return and refund policy. Limits: maxLength 200000.
- `privacy_html` (string): Privacy policy. Limits: maxLength 200000.
- `imprint_html` (string): Germany, Austria, Switzerland: Impressum. Other countries: contact information. Limits: maxLength 200000.
- `attach_terms_to_order_emails` (boolean): Attach the terms and the cancellation policy as a PDF to every order e-mail.

## Response

- `country` (string): Seller country, like DE. It decides which documents the shop needs.
- `documents` (array of object): The legal documents for the seller country.
  - `document` (string): terms, cancellation, privacy or imprint. Allowed values: `terms`, `cancellation`, `privacy`, `imprint`.
  - `title` (string): Name of the document for the seller country.
  - `filled` (boolean): true = the text is not empty.
  - `html` (string): The text as HTML.
- `attach_terms_to_order_emails` (boolean): true = the terms and the cancellation policy go as a PDF with every order e-mail.
- `admin_url` (string<uri>): The page in the Tentary app.
- `shop_url` (string<uri>): The terms in the shop.

## Example request

```bash
curl -X PATCH "https://api.tentary.com/v1/legal" \
  -H "Authorization: Bearer $TENTARY_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "attach_terms_to_order_emails": true
}'
```

## Example response

```json
{
  "country": "DE",
  "documents": [
    {
      "document": "terms",
      "title": "Terms of service",
      "filled": true,
      "html": "<h2>Terms of service</h2><p>Lena Berg Yoga, Lindenstrasse 12, 10969 Berlin, Germany.</p>"
    },
    {
      "document": "cancellation",
      "title": "Cancellation policy",
      "filled": true,
      "html": "<h2>Cancellation policy</h2><p>Lena Berg Yoga, Lindenstrasse 12, 10969 Berlin, Germany.</p>"
    },
    {
      "document": "privacy",
      "title": "Privacy policy",
      "filled": true,
      "html": "<h2>Privacy policy</h2><p>Lena Berg Yoga, Lindenstrasse 12, 10969 Berlin, Germany.</p>"
    },
    {
      "document": "imprint",
      "title": "Legal notice (Impressum)",
      "filled": true,
      "html": "<h2>Impressum</h2><p>Lena Berg Yoga, Lindenstrasse 12, 10969 Berlin, Germany.</p>"
    }
  ],
  "attach_terms_to_order_emails": true,
  "admin_url": "https://app.tentary.com/settings/legal",
  "shop_url": "https://shop.tentary.com/legal/61326/tos"
}
```
