Add Translation
Upload or create a new translation file. The file content should be valid JSON following the translation file structure.
curl -X POST "https://management-api.suprsend.com/v1/{workspace}/translation/content/{locale_file}/" \
--header 'Authorization: ServiceToken <token>' \
--header 'Content-Type: application/json' \
--data '{
"content": {
"welcome": "Bienvenue",
"goodbye": "Au revoir"
}
}'import requests
url = "https://management-api.suprsend.com/v1/{workspace}/translation/content/{locale_file}/"
payload = {
"locale": "fr.json",
"content": {
"welcome": "Bienvenue",
"goodbye": "Au revoir",
"greeting": "Bonjour, {{name}}!"
}
}
headers = {
"ServiceToken <token>": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'ServiceToken <token>': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
locale: 'fr.json',
content: {welcome: 'Bienvenue', goodbye: 'Au revoir', greeting: 'Bonjour, {{name}}!'}
})
};
fetch('https://management-api.suprsend.com/v1/{workspace}/translation/content/{locale_file}/', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://management-api.suprsend.com/v1/{workspace}/translation/content/{locale_file}/",
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([
'locale' => 'fr.json',
'content' => [
'welcome' => 'Bienvenue',
'goodbye' => 'Au revoir',
'greeting' => 'Bonjour, {{name}}!'
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"ServiceToken <token>: <api-key>"
],
]);
$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 := "https://management-api.suprsend.com/v1/{workspace}/translation/content/{locale_file}/"
payload := strings.NewReader("{\n \"locale\": \"fr.json\",\n \"content\": {\n \"welcome\": \"Bienvenue\",\n \"goodbye\": \"Au revoir\",\n \"greeting\": \"Bonjour, {{name}}!\"\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("ServiceToken <token>", "<api-key>")
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("https://management-api.suprsend.com/v1/{workspace}/translation/content/{locale_file}/")
.header("ServiceToken <token>", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"locale\": \"fr.json\",\n \"content\": {\n \"welcome\": \"Bienvenue\",\n \"goodbye\": \"Au revoir\",\n \"greeting\": \"Bonjour, {{name}}!\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://management-api.suprsend.com/v1/{workspace}/translation/content/{locale_file}/")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["ServiceToken <token>"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"locale\": \"fr.json\",\n \"content\": {\n \"welcome\": \"Bienvenue\",\n \"goodbye\": \"Au revoir\",\n \"greeting\": \"Bonjour, {{name}}!\"\n }\n}"
response = http.request(request)
puts response.read_body{
"filename": "fr.json",
"locale": "fr",
"locale_name": "French",
"namespace": null,
"action": "updated",
"updated_at": "2025-10-29T17:14:33.048313Z",
"content": {
"task_created": "Tâche créée",
"task_completed": "Tâche terminée",
"task_due": "Tâche due",
"task_assigned": "Tâche assignée"
}
}{
"code": 400,
"error_code": "validation_error",
"type": "ValidationError",
"message": "Invalid JSON format"
}{
"code": 401,
"error_code": "authentication_failed",
"type": "AuthenticationFailed",
"message": "Invalid service token.",
"detail": "Invalid service token."
}{
"code": 404,
"error_code": "not_found",
"type": "NotFound",
"message": "workspace 'demo' not found",
"detail": "workspace 'demo' not found"
}Authorizations
You can get Service Token from SuprSend dashboard -> Account Settings -> Service Tokens section.
Path Parameters
Workspace slug (staging, production, etc.)
Locale file name (e.g., "fr.json", "es-MX.json", "auth.en.json")
Body
Response
Translation file successfully updated
Name of the translation file
"fr.json"
Locale code for the translation file
"fr"
Human-readable name of the locale
"French"
Namespace for the translation file, if any. Namespace can be used to group translations by feature or module.
null
action done in the version compared to last commit.
added, updated, deleted, unchanged "updated"
When the translation file was last updated
Translation key-value pairs
Show child attributes
Show child attributes
Was this page helpful?
curl -X POST "https://management-api.suprsend.com/v1/{workspace}/translation/content/{locale_file}/" \
--header 'Authorization: ServiceToken <token>' \
--header 'Content-Type: application/json' \
--data '{
"content": {
"welcome": "Bienvenue",
"goodbye": "Au revoir"
}
}'import requests
url = "https://management-api.suprsend.com/v1/{workspace}/translation/content/{locale_file}/"
payload = {
"locale": "fr.json",
"content": {
"welcome": "Bienvenue",
"goodbye": "Au revoir",
"greeting": "Bonjour, {{name}}!"
}
}
headers = {
"ServiceToken <token>": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'ServiceToken <token>': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
locale: 'fr.json',
content: {welcome: 'Bienvenue', goodbye: 'Au revoir', greeting: 'Bonjour, {{name}}!'}
})
};
fetch('https://management-api.suprsend.com/v1/{workspace}/translation/content/{locale_file}/', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://management-api.suprsend.com/v1/{workspace}/translation/content/{locale_file}/",
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([
'locale' => 'fr.json',
'content' => [
'welcome' => 'Bienvenue',
'goodbye' => 'Au revoir',
'greeting' => 'Bonjour, {{name}}!'
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"ServiceToken <token>: <api-key>"
],
]);
$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 := "https://management-api.suprsend.com/v1/{workspace}/translation/content/{locale_file}/"
payload := strings.NewReader("{\n \"locale\": \"fr.json\",\n \"content\": {\n \"welcome\": \"Bienvenue\",\n \"goodbye\": \"Au revoir\",\n \"greeting\": \"Bonjour, {{name}}!\"\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("ServiceToken <token>", "<api-key>")
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("https://management-api.suprsend.com/v1/{workspace}/translation/content/{locale_file}/")
.header("ServiceToken <token>", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"locale\": \"fr.json\",\n \"content\": {\n \"welcome\": \"Bienvenue\",\n \"goodbye\": \"Au revoir\",\n \"greeting\": \"Bonjour, {{name}}!\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://management-api.suprsend.com/v1/{workspace}/translation/content/{locale_file}/")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["ServiceToken <token>"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"locale\": \"fr.json\",\n \"content\": {\n \"welcome\": \"Bienvenue\",\n \"goodbye\": \"Au revoir\",\n \"greeting\": \"Bonjour, {{name}}!\"\n }\n}"
response = http.request(request)
puts response.read_body{
"filename": "fr.json",
"locale": "fr",
"locale_name": "French",
"namespace": null,
"action": "updated",
"updated_at": "2025-10-29T17:14:33.048313Z",
"content": {
"task_created": "Tâche créée",
"task_completed": "Tâche terminée",
"task_due": "Tâche due",
"task_assigned": "Tâche assignée"
}
}{
"code": 400,
"error_code": "validation_error",
"type": "ValidationError",
"message": "Invalid JSON format"
}{
"code": 401,
"error_code": "authentication_failed",
"type": "AuthenticationFailed",
"message": "Invalid service token.",
"detail": "Invalid service token."
}{
"code": 404,
"error_code": "not_found",
"type": "NotFound",
"message": "workspace 'demo' not found",
"detail": "workspace 'demo' not found"
}