> ## Documentation Index
> Fetch the complete documentation index at: https://docs.voyantcloud.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Update File Translation

> Upsert localized alt text and descriptions for a gallery file.

## Method

`PUT` `/v1/gallery/files/:id/translations`

## Path Parameters

<ParamField path="id" type="string">Gallery file ID.</ParamField>

## Body Parameters

<ParamField name="locale" type="string">Language/locale code (`en`, `fr-CA`, etc.).</ParamField>
<ParamField name="altText" type="string | null">Localized alt text (omit or `null` to clear).</ParamField>
<ParamField name="description" type="string | null">Localized description (omit or `null` to clear).</ParamField>

## Headers

<ParamField header="Authorization" type="string">Bearer token (e.g. <code>Authorization: Bearer YOUR\_API\_KEY</code>)</ParamField>
<ParamField header="content-type" type="string">`application/json`</ParamField>

## Request Example

<RequestExample>
  ```bash cURL theme={null}
  curl -X PUT "https://api.voyantcloud.com/v1/gallery/files/gal_file_123/translations" \
    -H "Authorization: Bearer $VOYANT_API_KEY" \
    -H "content-type: application/json" \
    -d '{
      "locale": "fr",
      "altText": "Bannière croisière d'été",
      "description": "Visuel principal pour la campagne 2025"
    }'
  ```

  ```javascript Node.js theme={null}
  await fetch("https://api.voyantcloud.com/v1/gallery/files/gal_file_123/translations", {
    method: "PUT",
    headers: {
      Authorization: `Bearer ${process.env.VOYANT_API_KEY}`,
      "content-type": "application/json",
    },
    body: JSON.stringify({
      locale: "de",
      altText: "Sommerbanner",
      description: null,
    }),
  })
  ```

  ```python Python theme={null}
  import os, requests

  payload = {
    "locale": "es",
    "altText": "Banner de verano",
    "description": "Arte principal para 2025",
  }

  resp = requests.put(
    "https://api.voyantcloud.com/v1/gallery/files/gal_file_123/translations",
    headers={
      "Authorization": f"Bearer {os.environ['VOYANT_API_KEY']}",
      "content-type": "application/json",
    },
    json=payload,
  )
  result = resp.json()
  ```
</RequestExample>

## Response

<ResponseExample>
  ```json 200 OK theme={null}
  {
    "data": {
      "fileId": "gal_file_123",
      "locale": "fr",
      "altText": "Bannière croisière d'été",
      "description": "Visuel principal pour la campagne 2025",
      "translations": {
        "en": { "altText": "Summer sail banner", "description": "Hero artwork" },
        "fr": { "altText": "Bannière croisière d'été", "description": "Visuel principal pour la campagne 2025" }
      },
      "supportedLanguages": ["en", "fr", "de"],
      "defaultLocale": "en"
    }
  }
  ```
</ResponseExample>

<Tip>Supplying `null` (or omitting both fields) removes the translation for that locale.</Tip>
