API referencehttps://api.contit.cloud
Locales
Endpoints for managing workspace locale configurations: list, create, update, and delete.
GET
/locales
Get all locales
Retrieve all configured locales for the workspace, including fallback chains and the default locale.
Requires theReadAccess policy
Responses
200Success
(array) | LocaleModel[] | Array of locale configurations |
401Unauthorized
Code examples
curl -X GET "https://api.contit.cloud/locales" \
-H "X-Api-Key: YOUR_API_KEY"
var client = new ContitClient(
new ClientContitConfiguration(clientId, clientSecret));
var locales = await client.Locale.GetAll();
const response = await fetch(
"https://api.contit.cloud/locales",
{
method: "GET",
headers: {
"X-Api-Key": "YOUR_API_KEY",
}
}
);
const data = await response.json();
import requests
headers = {"X-Api-Key": "YOUR_API_KEY"}
response = requests.get(
"https://api.contit.cloud/locales",
headers=headers
)
data = response.json()
Example response 200
[
{
"code": "en",
"name": "English",
"fallbackCode": null,
"default": true
},
{
"code": "it",
"name": "Italiano",
"fallbackCode": "en",
"default": false
},
{
"code": "de",
"name": "Deutsch",
"fallbackCode": "en",
"default": false
}
]
Try it Live
curl
Response
PUT
/locales
Create or update locale
Create a new locale or update an existing one (matched by code). If `default` is true, the locale is set as the workspace default. The first locale created is automatically marked as default.
Requires theWriteAccess policy
Request body application/json
| Property | Type | Required | Description |
|---|---|---|---|
code |
string | Culture code (e.g. 'en', 'en-GB'). Unique within the workspace. | |
name |
string | — | Human-readable language name |
fallbackCode |
string | — | Code of another existing locale used as fallback when a translation is missing |
default |
boolean | — | If true, set this locale as workspace default |
Responses
200Success — locale created or updated
code | string | Culture code |
name | string | Human-readable language name |
fallbackCode | string | Fallback locale code |
default | boolean | True if this is the workspace default locale |
400Bad Request — missing code or unknown fallback
401Unauthorized
404Not Found — workspace does not exist
Code examples
curl -X PUT "https://api.contit.cloud/locales" \
-H "X-Api-Key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"code": "code_value",
"name": "name_value",
"fallbackCode": "fallbackCode_value",
"default": true
}'
using var http = new HttpClient();
http.DefaultRequestHeaders.Add("X-Api-Key", "YOUR_API_KEY");
var content = new StringContent("{
\"code\": \"code_value\",
\"name\": \"name_value\",
\"fallbackCode\": \"fallbackCode_value\",
\"default\": true
}",
Encoding.UTF8, "application/json");
var response = await http.PutAsync(
"https://api.contit.cloud/locales", content);
response.EnsureSuccessStatusCode();
var json = await response.Content.ReadAsStringAsync();
const response = await fetch(
"https://api.contit.cloud/locales",
{
method: "PUT",
headers: {
"X-Api-Key": "YOUR_API_KEY",
"Content-Type": "application/json"
},
body: JSON.stringify({
"code": "code_value",
"name": "name_value",
"fallbackCode": "fallbackCode_value",
"default": true
})
}
);
const data = await response.json();
import requests
headers = {"X-Api-Key": "YOUR_API_KEY"}
payload = {
"code": "code_value",
"name": "name_value",
"fallbackCode": "fallbackCode_value",
"default": true
}
response = requests.put(
"https://api.contit.cloud/locales",
json=payload,
headers=headers
)
data = response.json()
Example request
{
"code": "fr",
"name": "Français",
"fallbackCode": "en",
"default": false
}
Example response 200
{
"code": "fr",
"name": "Français",
"fallbackCode": "en",
"default": false
}
Try it Live
curl
Response
DELETE
/locales/{code}
Delete locale
Delete a locale by its code. The default locale cannot be deleted, and a locale referenced as fallback by another locale cannot be deleted until the reference is removed.
Requires theWriteAccess policy
Path parameters
| Name | Type | Required | Description |
|---|---|---|---|
code | string | Culture code of the locale to delete |
Responses
200Success — locale deleted
400Bad Request — cannot delete default locale or locale referenced as fallback
401Unauthorized
404Not Found — locale or workspace does not exist
Code examples
curl -X DELETE "https://api.contit.cloud/locales/{code}" \
-H "X-Api-Key: YOUR_API_KEY"
using var http = new HttpClient();
http.DefaultRequestHeaders.Add("X-Api-Key", "YOUR_API_KEY");
var content = new StringContent("{}",
Encoding.UTF8, "application/json");
var response = await http.DeleteAsync(
"https://api.contit.cloud/locales/{code}", content);
response.EnsureSuccessStatusCode();
var json = await response.Content.ReadAsStringAsync();
const response = await fetch(
"https://api.contit.cloud/locales/{code}",
{
method: "DELETE",
headers: {
"X-Api-Key": "YOUR_API_KEY",
}
}
);
const data = await response.json();
import requests
headers = {"X-Api-Key": "YOUR_API_KEY"}
response = requests.delete(
"https://api.contit.cloud/locales/{code}",
headers=headers
)
data = response.json()
Example request
DELETE /locales/fr
Try it Live
curl
Response