Skip to content

Create Export Template

Create a new export template under the current project (sync response, including a server-generated id and timestamps).

Endpoint

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

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",
  "name": "Default INI export",
  "format": "ini",
  "is_default": false,
  "mode": "single",
  "languages": ["en", "ja", "ko"],
  "field_order": [
    { "type": "language", "value": "en" },
    { "type": "language", "value": "ja" },
    { "type": "language", "value": "ko" }
  ]
}

Field Reference

FieldTypeRequiredDescription
typestringYesTemplate type: project_strings / task_strings. See List Export Templates
namestringYesDisplay name (no uniqueness constraint)
formatstringYesExport format: csv / json / xlsx / ini / xliff / xml
is_defaultboolNoWhether to set this template as the default for its type. When true, the server atomically flips every other template's is_default to false within the same type (concurrency-safe, single update)
modestringNosingle (combined file) / separate (one file per language); only meaningful when supported by format
fieldsstring[]NoSelected base fields (e.g. CSV / Excel columns)
languagesstring[]NoDefault target language codes selected by the template
field_orderarrayNoDisplay order of fields / languages: each element is { "type": "field" | "language", "value": "<name or language code>" }

id, created_at, updated_at are generated server-side; do not include them in the body. The server returns an id shaped like tpl-xxxxxxxx.

Response

json
{
  "success": true,
  "code": 0,
  "msg": "ok",
  "trace_id": "...",
  "data": {
    "type": "project_strings",
    "template": {
      "id": "tpl-9d3f1a2c",
      "name": "Default INI export",
      "is_default": false,
      "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": 1715520000000
    }
  }
}

Field semantics are identical to those in List Export Templates.

Error Codes

codeDescription
400Body is not a JSON object / type / name / format missing or invalid / mode not in single, separate / wrong type for fields / languages / field_order
401Signature invalid / timestamp expired
403App Secret not configured
404The project for this appKey does not exist (the auth layer fails first)
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","name":"Default INI export","format":"ini","is_default":false,"mode":"single","languages":["en","ja","ko"]}'
TIMESTAMP=$(date +%s)
SIGN=$(printf '%s' "${TIMESTAMP}${BODY}${APP_SECRET}" | md5)

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