POST/v2/projects/{projectId}/content-delivery-configs

Create a content delivery configuration

Creates a content delivery configuration for a project. Supply its required name, export format, and publishing options, then set optional filters and file structure settings as needed.

  • IdempotentThe SDK sends Idempotency-Key, so a retried request is only applied once.

1 parameter · 22 body fields
projectIdintegerrequired
The integer identifier of the project for the new content delivery configuration.

Configuration for exporting project content to a content delivery destination.

autoPublishbooleanrequired
If true, data are published to the content delivery automatically after each change.
contentStorageIdintegeroptional
Id of custom storage to use for content delivery. If null, default server storage is used. Tolgee Cloud provides default Content Storage.
escapeHtmlbooleanoptional
If true, HTML tags are escaped in the exported file. (Supported in the XLIFF format only). e.g. Key <b>hello</b> will be exported as &lt;b&gt;hello&lt;/b&gt;
fileStructureTemplatestringoptional
This is a template that defines the structure of the resulting .zip file content. The template is a string that can contain the following placeholders: {namespace}, {languageTag}, {androidLanguageTag}, {snakeLanguageTag}, {extension}. For example, when exporting to JSON with the template `{namespace}/{languageTag}.{extension}`, the English translations of the `home` namespace will be stored in `home/en.json`. The `{snakeLanguageTag}` placeholder is the same as `{languageTag}` but in snake case. (e.g., en_US). The Android specific `{androidLanguageTag}` placeholder is the same as `{languageTag}` but in Android format. (e.g., en-rUS)
filterBranchstringoptional
Filter translations with branch. By default, default branch is exported.
filterKeyIdarray<integer>optional
Filter key IDs to be contained in export
filterKeyIdNotarray<integer>optional
Filter key IDs not to be contained in export
filterKeyPrefixstringoptional
Filter keys with prefix
filterNamespacearray<string>optional
Filter translations with namespace. By default, all namespaces everything are exported. To export default namespace, use empty string.
filterStatearray<string>optional
Filter translations with state. By default, all states except untranslated is exported.
filterTagstringoptional
Filter keys tagged by. This filter works the same as `filterTagIn` but in this cases it accepts single tag only.
filterTagInarray<string>optional
Filter keys tagged by one of provided tags
filterTagNotInarray<string>optional
Filter keys not tagged by one of provided tags
formatstringrequired
Format to export to
Allowed:JSONJSON_TOLGEEXLIFFPOAPPLE_STRINGS_STRINGSDICTAPPLE_XLIFFANDROID_XMLCOMPOSE_XMLFLUTTER_ARBPROPERTIESYAML_RUBYYAML
languagesarray<string>optional
Languages to be contained in export. If null, all languages are exported
messageFormatstringoptional
Message format to be used for export. e.g. PHP_PO: Hello %s, ICU: Hello {name}. This property is honored only for generic formats like JSON or YAML. For specific formats like `YAML_RUBY` it's ignored.
Allowed:C_SPRINTFPHP_SPRINTFJAVA_STRING_FORMATAPPLE_SPRINTFRUBY_SPRINTFI18NEXTICUPYTHON_PERCENTPYTHON_BRACE
namestringrequired
Name for the content delivery configuration.
pruneBeforePublishbooleanrequired
Whether the data in the CDN should be pruned before publishing new data. In some cases, you might want to keep the data in the storage and only replace the files created by following publish operation.
slugstringoptional
Tolgee uses a custom slug as a directory name for content storage and public content delivery URL. It is only applicable for custom storage. This field needs to be kept null for Tolgee Cloud content storage or global server storage on self-hosted instances. Slag has to match following regular expression: `^[a-z0-9]+(?:-[a-z0-9]+)*$`. If null is provided for update operation, slug will be assigned with generated value.
structureDelimiterstringoptional
Delimiter to structure file content. e.g. For key "home.header.title" would result in {"home": {"header": "title": {"Hello"}}} structure. When null, resulting file won't be structured. Works only for generic structured formats (e.g. JSON, YAML), specific formats like `YAML_RUBY` don't honor this parameter.
supportArraysbooleanrequired
If true, for structured formats (like JSON) arrays are supported. e.g. Key hello[0] will be exported as {"hello": ["..."]}
zipbooleanrequired
Whether to export all files as a single zip archive (translations.zip).

5 status codes
200Returns the created content delivery configuration, including its identifier, name, export settings, and publishing details.
autoPublishbooleanrequired
branchNamestringoptional
Branch name this CDN config is associated with. Null means default branch or no branching.
escapeHtmlbooleanoptional
If true, HTML tags are escaped in the exported file. (Supported in the XLIFF format only). e.g. Key <b>hello</b> will be exported as &lt;b&gt;hello&lt;/b&gt;
fileStructureTemplatestringoptional
This is a template that defines the structure of the resulting .zip file content. The template is a string that can contain the following placeholders: {namespace}, {languageTag}, {androidLanguageTag}, {snakeLanguageTag}, {extension}. For example, when exporting to JSON with the template `{namespace}/{languageTag}.{extension}`, the English translations of the `home` namespace will be stored in `home/en.json`. The `{snakeLanguageTag}` placeholder is the same as `{languageTag}` but in snake case. (e.g., en_US). The Android specific `{androidLanguageTag}` placeholder is the same as `{languageTag}` but in Android format. (e.g., en-rUS)
filterBranchstringoptional
Filter translations with branch. By default, default branch is exported.
filterKeyIdarray<integer>optional
Filter key IDs to be contained in export
filterKeyIdNotarray<integer>optional
Filter key IDs not to be contained in export
filterKeyPrefixstringoptional
Filter keys with prefix
filterNamespacearray<string>optional
Filter translations with namespace. By default, all namespaces everything are exported. To export default namespace, use empty string.
filterStatearray<string>optional
Filter translations with state. By default, all states except untranslated is exported.
filterTagstringoptional
Filter keys tagged by. This filter works the same as `filterTagIn` but in this cases it accepts single tag only.
filterTagInarray<string>optional
Filter keys tagged by one of provided tags
filterTagNotInarray<string>optional
Filter keys not tagged by one of provided tags
formatstringrequired
Format to export to
Allowed:JSONJSON_TOLGEEXLIFFPOAPPLE_STRINGS_STRINGSDICTAPPLE_XLIFFANDROID_XMLCOMPOSE_XMLFLUTTER_ARBPROPERTIESYAML_RUBYYAML
idintegerrequired
languagesarray<string>optional
Languages to be contained in export. If null, all languages are exported
lastPublishedintegeroptional
lastPublishedFilesarray<string>required
messageFormatstringoptional
Message format to be used for export. e.g. PHP_PO: Hello %s, ICU: Hello {name}. This property is honored only for generic formats like JSON or YAML. For specific formats like `YAML_RUBY` it's ignored.
Allowed:C_SPRINTFPHP_SPRINTFJAVA_STRING_FORMATAPPLE_SPRINTFRUBY_SPRINTFI18NEXTICUPYTHON_PERCENTPYTHON_BRACE
namestringrequired
pruneBeforePublishbooleanrequired
publicUrlstringoptional
slugstringrequired
storageobjectoptional
structureDelimiterstringoptional
Delimiter to structure file content. e.g. For key "home.header.title" would result in {"home": {"header": "title": {"Hello"}}} structure. When null, resulting file won't be structured. Works only for generic structured formats (e.g. JSON, YAML), specific formats like `YAML_RUBY` don't honor this parameter.
supportArraysbooleanrequired
If true, for structured formats (like JSON) arrays are supported. e.g. Key hello[0] will be exported as {"hello": ["..."]}
zipbooleanrequired
400Returned when the request is invalid, including when a required field is missing or a filter value is invalid.
codestringrequired
Allowed:unauthenticatedapi_access_forbiddenapi_key_not_foundinvalid_api_keyinvalid_project_api_keyproject_api_key_expiredbad_credentialsmfa_enabledinvalid_otp_codemfa_not_enabledcan_not_revoke_own_permissionsdata_corrupted
paramsarray<object>optional
401Returned when the request is unauthenticated.
codestringrequired
Allowed:unauthenticatedapi_access_forbiddenapi_key_not_foundinvalid_api_keyinvalid_project_api_keyproject_api_key_expiredbad_credentialsmfa_enabledinvalid_otp_codemfa_not_enabledcan_not_revoke_own_permissionsdata_corrupted
paramsarray<object>optional
403Returned when the authenticated user does not have permission to create a configuration.
codestringrequired
Allowed:unauthenticatedapi_access_forbiddenapi_key_not_foundinvalid_api_keyinvalid_project_api_keyproject_api_key_expiredbad_credentialsmfa_enabledinvalid_otp_codemfa_not_enabledcan_not_revoke_own_permissionsdata_corrupted
paramsarray<object>optional
404Returned when the project cannot be found.
codestringrequired
Allowed:unauthenticatedapi_access_forbiddenapi_key_not_foundinvalid_api_keyinvalid_project_api_keyproject_api_key_expiredbad_credentialsmfa_enabledinvalid_otp_codemfa_not_enabledcan_not_revoke_own_permissionsdata_corrupted
paramsarray<object>optional

Error handling

A 400 is returned when the request is invalid. A 401 is returned when the request is unauthenticated, and a 403 is returned when the authenticated user lacks permission to create a configuration. A 404 is returned when the project cannot be found. autoPublish, format, name, pruneBeforePublish, supportArrays, and zip are required. filterState, when supplied, must use the documented values: UNTRANSLATED, TRANSLATED, REVIEWED, or DISABLED. The projectId path parameter must identify a project.