Skip to content

Update Export Template

Partially update an existing export template by (type, id). Only fields that appear in the request body are updated; everything else is left unchanged.

Endpoint

POST {BASE_URL}/api/open/v1/export-templates/update

Authentication Headers

Same as Create Translation Task. The raw POST body participates in the signature: MD5(timestamp + raw_body + appSecret).

Request Body (JSON)

json
{
  "type": "project_strings",
  "id": "tpl-9d3f1a2c",
  "name": "Default INI export (renamed)",
  "is_default": true
}

Field Reference

FieldTypeRequiredDescription
typestringYesTemplate type, used to locate the template (not editable). See List Export Templates
idstringYesTemplate ID, used to locate the template (not editable)
namestringNoNew name (non-empty)
formatstringNoNew format: csv / json / xlsx / ini / xliff / xml
is_defaultboolNoWhen true, the server atomically flips every other template's is_default to false within the same type (concurrency-safe, single update)
modestringNoNew mode: single / separate
fieldsstring[]NoReplacement field list (full replace, not append)
languagesstring[]NoReplacement language list (full replace)
field_orderarrayNoReplacement order (full replace); each element is { "type": "field" | "language", "value": "<name or language code>" }

Array fields are full replace, not append — if you only want to add one language, fetch the current languages first, append, then submit the whole array.

created_at / updated_at are server-managed; updated_at is refreshed on every successful update.

Response

json
{
  "success": true,
  "code": 0,
  "msg": "ok",
  "trace_id": "...",
  "data": {
    "type": "project_strings",
    "template": {
      "id": "tpl-9d3f1a2c",
      "name": "Default INI export (renamed)",
      "is_default": true,
      "format": "ini",
      "mode": "single",
      "languages": ["en", "ja", "ko"],
      "field_order": [
        { "type": "language", "value": "en" },
        { "type": "language", "value": "ja" },
        { "type": "language", "value": "ko" }
      ],
      "created_at": 1715520000000,
      "updated_at": 1715606400000
    }
  }
}

The returned template is the full post-update object (same shape as Get Export Template).

Error Codes

codeDescription
400Body is not a JSON object / type missing or invalid / id missing / no updatable fields / field type wrong
401Signature invalid / timestamp expired
403App Secret not configured
404No template found for the given id (a wrong type also yields 404)
500Write failed or internal error

Example

bash
APP_KEY="5685414646a54423c891d87194d87f3f"
APP_SECRET="<your App Secret>"
BASE_URL="https://api.loxily.com"

BODY='{"type":"project_strings","id":"tpl-9d3f1a2c","name":"Default INI export (renamed)","is_default":true}'
TIMESTAMP=$(date +%s)
SIGN=$(printf '%s' "${TIMESTAMP}${BODY}${APP_SECRET}" | md5)

curl -s -X POST "${BASE_URL}/api/open/v1/export-templates/update" \
  -H "Content-Type: application/json" \
  -H "X-Loxily-AppKey: ${APP_KEY}" \
  -H "X-Loxily-Timestamp: ${TIMESTAMP}" \
  -H "X-Loxily-Sign: ${SIGN}" \
  --data "${BODY}"