Skip to main content
POST
/
v1
/
{workspace}
/
translation
/
content
/
{locale_file}
/
Add Translation
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

ServiceToken <token>
string
header
required

You can get Service Token from SuprSend dashboard -> Account Settings -> Service Tokens section.

Path Parameters

workspace
string
required

Workspace slug (staging, production, etc.)

locale_file
string
required

Locale file name (e.g., "fr.json", "es-MX.json", "auth.en.json")

Body

application/json
locale
string
required

Locale file name (e.g., "fr.json", "es-MX.json", "auth.en.json")

Example:

"fr.json"

content
object
required

Translation key-value pairs in JSON format

Response

Translation file successfully updated

filename
string

Name of the translation file

Example:

"fr.json"

locale
string

Locale code for the translation file

Example:

"fr"

locale_name
string

Human-readable name of the locale

Example:

"French"

namespace
string | null

Namespace for the translation file, if any. Namespace can be used to group translations by feature or module.

Example:

null

action
enum<string>

action done in the version compared to last commit.

Available options:
added,
updated,
deleted,
unchanged
Example:

"updated"

updated_at
string<date-time>

When the translation file was last updated

content
object

Translation key-value pairs