---
title: "Translate text"
method: POST
path: "/api/v1/translation/text"
tags: ["Translation"]
---

# Translate text

`POST /api/v1/translation/text`

Translate text from one language to another using DeepL API. Source language can be auto-detected if not provided.

## Request body

- TranslateTextDTO — DTO for translating text.
  - `text` union, required — Text or list of texts to translate
    - string
    - string[]
  - `targetLang` string, required — Target language code (e.g., 'UK' for Ukrainian, 'ES' for Spanish, 'DE' for German)
  - `sourceLang` string, nullable — Source language code (optional, auto-detected if not provided)
  - `preserveFormatting` boolean — Whether to preserve formatting in the translation

## Response `200`

Request completed successfully.

- OkResponse
  - `detail` string

## Other responses

- `400` — The request is invalid.
- `401` — Authentication required.
- `422` — Validation Error

---

[API](https://skmtc.dev/pwapps/apis/curie-api.md) · [All operations](https://skmtc.dev/pwapps/apis/curie-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/pwapps/curie-api/revisions/b0af9064dfef/schema)
