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/createAuthentication 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
| Field | Type | Required | Description |
|---|---|---|---|
type | string | Yes | Template type: project_strings / task_strings. See List Export Templates |
name | string | Yes | Display name (no uniqueness constraint) |
format | string | Yes | Export format: csv / json / xlsx / ini / xliff / xml |
is_default | bool | No | Whether 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) |
mode | string | No | single (combined file) / separate (one file per language); only meaningful when supported by format |
fields | string[] | No | Selected base fields (e.g. CSV / Excel columns) |
languages | string[] | No | Default target language codes selected by the template |
field_order | array | No | Display order of fields / languages: each element is { "type": "field" | "language", "value": "<name or language code>" } |
id,created_at,updated_atare generated server-side; do not include them in the body. The server returns anidshaped liketpl-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
| code | Description |
|---|---|
| 400 | Body is not a JSON object / type / name / format missing or invalid / mode not in single, separate / wrong type for fields / languages / field_order |
| 401 | Signature invalid / timestamp expired |
| 403 | App Secret not configured |
| 404 | The project for this appKey does not exist (the auth layer fails first) |
| 500 | Write 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}"