Languages
Language object
idstring · read-only
The language's internal ID.
The ID of the default language is always
00000000-0000-0000-0000-000000000000.namerequired · string · max. 25 chars
The language's display name.
codenamerequired · string · max. 25 chars
The language's codename. Initially generated from the language's
name unless you add the language via API.external_idstring
External ID of the language. Only present if defined when creating the language.
is_activeboolean
Determines whether the language is active.
is_defaultboolean · read-only
Determines whether the language is default.
fallback_languagenestedSchema
Language to use when the current language contains no content. With multiple languages you can create fallback chains.
idstring · uuid
The referenced object's internal ID.
codenamestring · write-only
The referenced object's codename. The value of the
codename property must meet the conditions defined in rules for codenames.external_idstring · write-only
The referenced object’s external ID. The value of the
external_id property must not contain the following characters: /, ., ;.JSON
{
"id": "00000000-0000-0000-0000-000000000000",
"name": "Default language",
"codename": "default",
"external_id": "string",
"is_active": true,
"is_default": true,
"fallback_language": {
"id": "00000000-0000-0000-0000-000000000000"
}
}Add a language
Create new languages in your environment. For each active language, you can create localized content using language variants.
POST
https://manage.kontent.ai/v2/projects/{environment_id}/languagesRequest
Path parameters
environment_idrequired · string
Identifies your environment.
Body schema
Application/json
The language to be added.
namerequired · string · max. 25 chars
The language's display name.
codenamerequired · string · max. 25 chars
The language's codename. Initially generated from the language's
name unless you add the language via API.external_idstring
External ID of the language. Only present if defined when creating the language.
is_activeboolean
Determines whether the language is active.
fallback_languagenestedSchema
Language to use when the current language contains no content. With multiple languages you can create fallback chains.
idstring · uuid
The referenced object's internal ID.
codenamestring · write-only
The referenced object's codename. The value of the
codename property must meet the conditions defined in rules for codenames.external_idstring · write-only
The referenced object’s external ID. The value of the
external_id property must not contain the following characters: /, ., ;.Request samples
Payload
TypeScript
C#
cURL
// Tip: Find more about JS/TS SDKs at https://kontent.ai/learn/javascript
import { ManagementClient } from '@kontent-ai/management-sdk';
const client = new ManagementClient({
environmentId: 'KONTENT_AI_ENVIRONMENT_ID',
apiKey: 'KONTENT_AI_MANAGEMENT_API_KEY',
});
const response = await client
.addLanguage()
.withData({
name: 'German (Germany)',
codename: 'de-DE',
is_active: true,
fallback_language: {
codename: 'de-AT',
},
external_id: 'standard-german',
})
.toPromise();
Response
Status (201)
The created language object.
idstring · read-only
The language's internal ID.
The ID of the default language is always
00000000-0000-0000-0000-000000000000.namerequired · string · max. 25 chars
The language's display name.
codenamerequired · string · max. 25 chars
The language's codename. Initially generated from the language's
name unless you add the language via API.external_idstring
External ID of the language. Only present if defined when creating the language.
is_activeboolean
Determines whether the language is active.
is_defaultboolean · read-only
Determines whether the language is default.
fallback_languagenestedSchema
Language to use when the current language contains no content. With multiple languages you can create fallback chains.
fallback_language
idstring · uuid
The referenced object's internal ID.
Example responses
201
400
{
"id": "2ea66788-d3b8-5ff5-b37e-258502e4fd5d",
"name": "German (Germany)",
"codename": "de-DE",
"external_id": "standard-german",
"is_active": true,
"is_default": false,
"fallback_language": {
"id": "00000000-0000-0000-0000-000000000000"
}
}Retrieve a language
Retrieve a language from your environment.
GET
https://manage.kontent.ai/v2/projects/{environment_id}/languages/{language_identifier}Request
Path parameters
environment_idrequired · string
Identifies your environment.
language_identifierrequired · string
Identifies the language by its internal ID (e.g.,
2ea66788-d3b8-5ff5-b37e-258502e4fd5d), external ID (e.g., external-id/standard-german), or codename (e.g., codename/de-DE).Request samples
TypeScript
C#
cURL
// Tip: Find more about JS/TS SDKs at https://kontent.ai/learn/javascript
import { ManagementClient } from '@kontent-ai/management-sdk';
const client = new ManagementClient({
environmentId: 'KONTENT_AI_ENVIRONMENT_ID',
apiKey: 'KONTENT_AI_MANAGEMENT_API_KEY',
});
const response = await client
.viewLanguage()
.byLanguageId('2ea66788-d3b8-5ff5-b37e-258502e4fd5d')
// .byLanguageCodename('de-DE')
// .byExternalId('standard-german')
.toPromise();
Response
Status (200)
A single language object.
idstring · read-only
The language's internal ID.
The ID of the default language is always
00000000-0000-0000-0000-000000000000.namerequired · string · max. 25 chars
The language's display name.
codenamerequired · string · max. 25 chars
The language's codename. Initially generated from the language's
name unless you add the language via API.external_idstring
External ID of the language. Only present if defined when creating the language.
is_activeboolean
Determines whether the language is active.
is_defaultboolean · read-only
Determines whether the language is default.
fallback_languagenestedSchema
Language to use when the current language contains no content. With multiple languages you can create fallback chains.
fallback_language
idstring · uuid
The referenced object's internal ID.
Example responses
200
404
{
"id": "00000000-0000-0000-0000-000000000000",
"name": "Default language",
"codename": "default",
"external_id": "string",
"is_active": true,
"is_default": true,
"fallback_language": {
"id": "00000000-0000-0000-0000-000000000000"
}
}List languages
Retrieve a dynamically paginated list of languages from your environment.
GET
https://manage.kontent.ai/v2/projects/{environment_id}/languagesRequest
Path parameters
environment_idrequired · string
Identifies your environment.
Header parameters
x-continuationstring
Determines the page of results to retrieve.To get the next page of results, check the pagination object in the API response and set the
x-continuation header parameter to the value of the continuation_token property.Request samples
TypeScript
C#
cURL
// Tip: Find more about JS/TS SDKs at https://kontent.ai/learn/javascript
import { ManagementClient } from '@kontent-ai/management-sdk';
const client = new ManagementClient({
environmentId: 'KONTENT_AI_ENVIRONMENT_ID',
apiKey: 'KONTENT_AI_MANAGEMENT_API_KEY',
});
// Gets the first page of results
const response = await client.listLanguages().toPromise();
// Gets all pages of results
// const response = await client.listLanguages()
// .toAllPromise();
Response
Status (200)
A dynamically paginated list of languages.
languages[]required · array
List of languages.
Show child attributes
paginationrequired · object
Information about the next page of results.
Show child attributes
Example responses
200
400
{
"languages": {
"id": "00000000-0000-0000-0000-000000000000",
"name": "Default language",
"codename": "default",
"external_id": "string",
"is_active": true,
"is_default": true,
"fallback_language": {
"id": "00000000-0000-0000-0000-000000000000"
}
},
"pagination": {
"continuation_token": "W3sidG9rZW4iOiIrUklEOn...",
"next_page": "https://manage.kontent.ai/v2/your/chosen/list/endpoint"
}
}Modify a language
Modify languages in your environment.
PATCH
https://manage.kontent.ai/v2/projects/{environment_id}/languages/{language_identifier}Request
Path parameters
environment_idrequired · string
Identifies your environment.
language_identifierrequired · string
Identifies the language by its internal ID (e.g.,
2ea66788-d3b8-5ff5-b37e-258502e4fd5d), external ID (e.g., external-id/standard-german), or codename (e.g., codename/de-DE).Body schema
Application/json
Specifies the operations to perform on the existing languages.
array · min. 1 items · unique items
Hide child attributes
oprequired · string
The operation to perform.
property_namerequired · string
The name of the language property that you want to modify.
valuerequired · nestedSchema
The value or object to insert in the specified property. The format of the
value property depends on value of the property_name property.- For
property_nameofnameorcodename, thevalueproperty is string. - For
property_nameoffallback_language, thevalueproperty is a Reference object. - For
property_nameofis_active, thevalueproperty is boolean.
Any of:
String
Reference object
Boolean
String
stringstring
Request samples
Payload
TypeScript
C#
cURL
// Tip: Find more about JS/TS SDKs at https://kontent.ai/learn/javascript
import { ManagementClient } from '@kontent-ai/management-sdk';
const client = new ManagementClient({
environmentId: 'KONTENT_AI_ENVIRONMENT_ID',
apiKey: 'KONTENT_AI_MANAGEMENT_API_KEY',
});
const response = await client
.modifyLanguage()
.byLanguageId('2ea66788-d3b8-5ff5-b37e-258502e4fd5d')
// .byLanguageCodename('de-DE')
// .byExternalId('standard-german')
.withData([
{
op: 'replace',
property_name: 'fallback_language',
value: {
codename: 'en-US',
},
},
{
op: 'replace',
property_name: 'name',
value: 'German',
},
])
.toPromise();
Response
Status (200)
The modified language object.
idstring · read-only
The language's internal ID.
The ID of the default language is always
00000000-0000-0000-0000-000000000000.namerequired · string · max. 25 chars
The language's display name.
codenamerequired · string · max. 25 chars
The language's codename. Initially generated from the language's
name unless you add the language via API.external_idstring
External ID of the language. Only present if defined when creating the language.
is_activeboolean
Determines whether the language is active.
is_defaultboolean · read-only
Determines whether the language is default.
fallback_languagenestedSchema
Language to use when the current language contains no content. With multiple languages you can create fallback chains.
fallback_language
idstring · uuid
The referenced object's internal ID.
Example responses
200
400
404
{
"id": "2ea66788-d3b8-5ff5-b37e-258502e4fd5d",
"name": "Deutsch",
"codename": "de-DE",
"external_id": "standard-german",
"is_active": true,
"is_default": false,
"fallback_language": {
"id": "00000000-0000-0000-0000-000000000000"
}
}