# Export a file containing translations

`POST /api/translations/export`

- **Success:** `200 OK`
- **Products:** Operator (`FOH`)
- **Features:** Front of House Generic Access (`FOHGENERIC`)

HTML version: [Export a file containing translations](https://support.gladstonesoftware.cloud/reference/configuration/export-a-file-containing-translations)

## Overview

Exports a **CSV file** containing rows and columns with the requested translations.

Despite being a `POST`, this reads rather than writes: it returns a file download, not JSON. The response is `text/csv` with a `Content-Disposition` attachment named `{translationType}-Translations.csv`, so read the body as text rather than parsing it as JSON.

**The file is the round-trip format for the import endpoint.** Export first, edit the translated columns, then send the same file back — the import endpoint checks the column count against the translation type's configuration, so a hand-built file with the wrong shape is rejected. Columns come in pairs: a source column suffixed ` (DO NOT CHANGE)` and the editable translation beside it. A basic type gives 3 columns; a type with names gives 5; a type with names and web comments gives 7.

**Every row is quoted and HTML tags are rewritten.** Angle-bracketed tags become double square brackets — `<b>` is exported as `[[b]]` — carriage returns are dropped, newlines become spaces, and embedded double quotes are doubled. The import endpoint reverses the bracket substitution, so leave it alone rather than converting the tags back by hand.

**One row is exported for every record of the type, whether or not it has a translation.** Every record of the type is included, not only those with existing translations, so an untranslated record still appears with its translation columns empty. A type with no records at all returns a file containing only the header line.

## Endpoint

`POST {base_url}/api/translations/export`

`{base_url}` is the environment URL issued to your integration. See [Authenticating with Gladstone APIs](../../guides/authenticating-with-gladstone-apis.md).

## Request body

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `onlyMissingTranslations` | boolean | No | Restricts the file to records that have nothing translated yet for `language` — a row is included only when its translated name, description and web comments are all empty. Defaults to `false`, which exports every record of the type. Useful for handing a translator just the outstanding work, but note that a row with a partial translation counts as translated and is left out. |
| `language` | string | Yes | The culture code whose translations fill the editable columns — matched case-insensitively against the culture recorded on each translation. Required: omitting it or sending null returns `400` with `Language must be specified`. **It is not validated against the list of configured cultures.** A code that matches nothing is not an error; you get a file where every translation column is empty, and combined with `onlyMissingTranslations: true` that means every record comes back looking untranslated. Check the code against the cultures endpoint before you trust the output. |
| `translationType` | string | Yes | The kind of record to export translations for — for example `Site`, `Product` or `ActivityGroup`. Required: omitting it or sending null returns `400` with `TranslationType must be specified`. It is matched case-insensitively against the configured translation types, and an unrecognised value returns `400` with `TranslationType "{value}" is not a valid translation type`. Take the value from the translation-types endpoint rather than guessing. It also determines the file's shape — whether name and web-comment columns are present — and the download filename. |

## Sample request

```bash title="cURL"
curl -X POST '{base_url}/api/translations/export' \
  -H 'Authorization: Bearer {accessToken}' \
  -H 'X-Use-SSO: true' \
  -H 'Content-Type: application/json' \
  -d '{
  "onlyMissingTranslations": true,
  "language": "string",
  "translationType": "string"
}'
```

## Sample response

```json title="200 OK"
"string"
```

## Errors

| Status | Meaning | When |
|--------|---------|------|
| `400` | Bad request | `language` or `translationType` was omitted or null — `Language must be specified` or `TranslationType must be specified`. The body is a validation error object keyed by field name. |
| `400` | Bad request | `translationType` does not match any configured translation type — `TranslationType "{value}" is not a valid translation type`, as a plain string. Note there is no equivalent check on `language`. |
| `500` | Internal server error | The export failed while reading the type's records or building the file. The body is empty. |
