curl --request POST \
--url http://localhost:3000/api/v1/push \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"content": "{\"welcome.message\": \"Welcome to our app\"}",
"language": "de",
"projectId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"dryRun": false,
"format": "json",
"importMode": "merge",
"status": "approved"
}
'import requests
url = "http://localhost:3000/api/v1/push"
payload = {
"content": "{\"welcome.message\": \"Welcome to our app\"}",
"language": "de",
"projectId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"dryRun": False,
"format": "json",
"importMode": "merge",
"status": "approved"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
content: '{"welcome.message": "Welcome to our app"}',
language: 'de',
projectId: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
dryRun: false,
format: 'json',
importMode: 'merge',
status: 'approved'
})
};
fetch('http://localhost:3000/api/v1/push', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_PORT => "3000",
CURLOPT_URL => "http://localhost:3000/api/v1/push",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'content' => '{"welcome.message": "Welcome to our app"}',
'language' => 'de',
'projectId' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'dryRun' => false,
'format' => 'json',
'importMode' => 'merge',
'status' => 'approved'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "http://localhost:3000/api/v1/push"
payload := strings.NewReader("{\n \"content\": \"{\\\"welcome.message\\\": \\\"Welcome to our app\\\"}\",\n \"language\": \"de\",\n \"projectId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"dryRun\": false,\n \"format\": \"json\",\n \"importMode\": \"merge\",\n \"status\": \"approved\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("http://localhost:3000/api/v1/push")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"content\": \"{\\\"welcome.message\\\": \\\"Welcome to our app\\\"}\",\n \"language\": \"de\",\n \"projectId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"dryRun\": false,\n \"format\": \"json\",\n \"importMode\": \"merge\",\n \"status\": \"approved\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("http://localhost:3000/api/v1/push")
http = Net::HTTP.new(url.host, url.port)
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"content\": \"{\\\"welcome.message\\\": \\\"Welcome to our app\\\"}\",\n \"language\": \"de\",\n \"projectId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"dryRun\": false,\n \"format\": \"json\",\n \"importMode\": \"merge\",\n \"status\": \"approved\"\n}"
response = http.request(request)
puts response.read_body{
"dryRun": true,
"importMode": "merge",
"language": "de",
"rowCount": 128,
"toCreate": 40,
"toUpdate": 88
}{
"jobId": "5f6e8b2a-3b7a-4c2a-9c37-8e6f8d6a9b10",
"runId": "run_9c2a3b7a4c2a9c37"
}{
"error": "<string>",
"details": "<string>",
"timestamp": "2023-11-07T05:31:56Z"
}{
"error": "<string>",
"details": "<string>",
"timestamp": "2023-11-07T05:31:56Z"
}{
"error": "<string>",
"details": "<string>",
"timestamp": "2023-11-07T05:31:56Z"
}{
"error": "Payload too large"
}{
"error": "<string>",
"details": "<string>",
"timestamp": "2023-11-07T05:31:56Z"
}Push translations (import)
Bulk import a JSON translation file as a background job (or preview it with dryRun). Powers lingulink push.
curl --request POST \
--url http://localhost:3000/api/v1/push \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"content": "{\"welcome.message\": \"Welcome to our app\"}",
"language": "de",
"projectId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"dryRun": false,
"format": "json",
"importMode": "merge",
"status": "approved"
}
'import requests
url = "http://localhost:3000/api/v1/push"
payload = {
"content": "{\"welcome.message\": \"Welcome to our app\"}",
"language": "de",
"projectId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"dryRun": False,
"format": "json",
"importMode": "merge",
"status": "approved"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
content: '{"welcome.message": "Welcome to our app"}',
language: 'de',
projectId: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
dryRun: false,
format: 'json',
importMode: 'merge',
status: 'approved'
})
};
fetch('http://localhost:3000/api/v1/push', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_PORT => "3000",
CURLOPT_URL => "http://localhost:3000/api/v1/push",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'content' => '{"welcome.message": "Welcome to our app"}',
'language' => 'de',
'projectId' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'dryRun' => false,
'format' => 'json',
'importMode' => 'merge',
'status' => 'approved'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "http://localhost:3000/api/v1/push"
payload := strings.NewReader("{\n \"content\": \"{\\\"welcome.message\\\": \\\"Welcome to our app\\\"}\",\n \"language\": \"de\",\n \"projectId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"dryRun\": false,\n \"format\": \"json\",\n \"importMode\": \"merge\",\n \"status\": \"approved\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("http://localhost:3000/api/v1/push")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"content\": \"{\\\"welcome.message\\\": \\\"Welcome to our app\\\"}\",\n \"language\": \"de\",\n \"projectId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"dryRun\": false,\n \"format\": \"json\",\n \"importMode\": \"merge\",\n \"status\": \"approved\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("http://localhost:3000/api/v1/push")
http = Net::HTTP.new(url.host, url.port)
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"content\": \"{\\\"welcome.message\\\": \\\"Welcome to our app\\\"}\",\n \"language\": \"de\",\n \"projectId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"dryRun\": false,\n \"format\": \"json\",\n \"importMode\": \"merge\",\n \"status\": \"approved\"\n}"
response = http.request(request)
puts response.read_body{
"dryRun": true,
"importMode": "merge",
"language": "de",
"rowCount": 128,
"toCreate": 40,
"toUpdate": 88
}{
"jobId": "5f6e8b2a-3b7a-4c2a-9c37-8e6f8d6a9b10",
"runId": "run_9c2a3b7a4c2a9c37"
}{
"error": "<string>",
"details": "<string>",
"timestamp": "2023-11-07T05:31:56Z"
}{
"error": "<string>",
"details": "<string>",
"timestamp": "2023-11-07T05:31:56Z"
}{
"error": "<string>",
"details": "<string>",
"timestamp": "2023-11-07T05:31:56Z"
}{
"error": "Payload too large"
}{
"error": "<string>",
"details": "<string>",
"timestamp": "2023-11-07T05:31:56Z"
}Authorizations
Enter your API key in the format: Bearer <api_key>
Body
Bulk import request
Raw JSON file content. Nested objects are flattened into dot-separated keys (e.g. {"auth":{"title":"Sign in"}} becomes the key "auth.title"). A null value imports as the literal string "null"; array values are flattened into index-suffixed keys (e.g. "key.0", "key.1") rather than being rejected.
"{\"welcome.message\": \"Welcome to our app\"}"
Target language code for the imported values
"de"
Project UUID
Validate and preview changes without starting an import
Only JSON is supported in v1
json Whether to merge with or replace existing translations
merge, replace Status to assign to imported translation rows
draft, pending, approved, needs_review Was this page helpful?