Create a style rule list

Changed on

Create a style rule list for a single language, optionally with its configured rules and custom instructions. The language can be a root code such as de or a variant code such as de-CH. Use the returned style_id with the translation endpoints to apply the list.

post/v3/style_rules

Request

  • Base URL
    https://api.deepl.com
  • URL
    https://api.deepl.com/v3/style_rules
  • Auth
    API key in header Authorization

Request body

namestring required

Name associated with the style rule list.

language'ar' | 'bg' | 'cs' | 'da' | 'de' | 'de-CH' | 'de-DE' | 'el' | 'en' | 'en-GB' | 'en-US' | 'es' | 'es-419' | 'es-ES' | 'et' | 'fi' | 'fr' | 'fr-CA' | 'fr-FR' | 'he' | 'hu' | 'id' | 'it' | 'ja' | 'ko' | 'lt' | 'lv' | 'nb' | 'nl' | 'pl' | 'pt' | 'pt-BR' | 'pt-PT' | 'ro' | 'ru' | 'sk' | 'sl' | 'sv' | 'th' | 'tr' | 'uk' | 'vi' | 'zh' | 'zh-Hans' | 'zh-Hant' required

The target language the style rule list applies to. Codes are matched case-insensitively; the response returns the canonical form (for example de-CH).

A root code (for example en) applies to that language and all of its variants. A variant code (for example en-GB) applies only when target_lang is that variant.

Variant lists for de-CH, fr-CA, pt-BR, and pt-PT are generally available. Variant lists for de-DE, en-GB, en-US, es-419, es-ES, fr-FR, zh-Hans, and zh-Hant are in beta. The current list and the status of each language are returned by GET /v3/languages?resource=style_rules&include=beta.

Example request

{
  "configured_rules": {
    "style_and_tone": {
      "abbreviations": "use_abbreviations_and_symbols",
      "short_vs_long_words": "use_short_words"
    },
    "punctuation": {
      "apostrophe": "use_curly_apostrophes"
    }
  }
}

Response

Style rule list created successfully

style_idstring required

A unique ID assigned to a style rule list.

namestring required

Name associated with the style rule list.

creation_timestring date-time required

The creation time of the style rule list in the ISO 8601-1:2019 format (e.g.: 2021-08-03T14:16:18.329Z).

updated_timestring date-time required

The time of the style rule list when it was last updated in the ISO 8601-1:2019 format (e.g.: 2022-08-03T14:16:18.329Z).

language'ar' | 'bg' | 'cs' | 'da' | 'de' | 'de-CH' | 'de-DE' | 'el' | 'en' | 'en-GB' | 'en-US' | 'es' | 'es-419' | 'es-ES' | 'et' | 'fi' | 'fr' | 'fr-CA' | 'fr-FR' | 'he' | 'hu' | 'id' | 'it' | 'ja' | 'ko' | 'lt' | 'lv' | 'nb' | 'nl' | 'pl' | 'pt' | 'pt-BR' | 'pt-PT' | 'ro' | 'ru' | 'sk' | 'sl' | 'sv' | 'th' | 'tr' | 'uk' | 'vi' | 'zh' | 'zh-Hans' | 'zh-Hant' required

The target language the style rule list applies to. Codes are matched case-insensitively; the response returns the canonical form (for example de-CH).

A root code (for example en) applies to that language and all of its variants. A variant code (for example en-GB) applies only when target_lang is that variant.

Variant lists for de-CH, fr-CA, pt-BR, and pt-PT are generally available. Variant lists for de-DE, en-GB, en-US, es-419, es-ES, fr-FR, zh-Hans, and zh-Hant are in beta. The current list and the status of each language are returned by GET /v3/languages?resource=style_rules&include=beta.

versioninteger required

The version of the style rule list. Incremented when the style rule list is updated.

Example response

{
  "style_id": "bd0a38f3-1831-440b-a8dd-2c702e2325ab",
  "version": 13,
  "configured_rules": {
    "style_and_tone": {
      "abbreviations": "use_abbreviations_and_symbols",
      "short_vs_long_words": "use_short_words"
    },
    "punctuation": {
      "apostrophe": "use_curly_apostrophes"
    }
  },
  "custom_instructions": [
    {
      "id": "68fdb803-c013-4e67-b62e-1aad0ab519cd",
      "label": "Currency custom instruction",
      "prompt": "Have currency symbols before the numerical value (e.g. $100, €100)",
      "source_language": "en"
    }
  ]
}

Changes

    • warning

      added the new ar enum value to the response property for the response status

    • warning

      added the new bg enum value to the response property for the response status

    • warning

      added the new cs enum value to the response property for the response status

    • warning

      added the new da enum value to the response property for the response status

    • warning

      added the new de-CH enum value to the response property for the response status

    • warning

      added the new de-DE enum value to the response property for the response status

    • warning

      added the new el enum value to the response property for the response status

    • warning

      added the new en-GB enum value to the response property for the response status

    • warning

      added the new en-US enum value to the response property for the response status

    • warning

      added the new es-419 enum value to the response property for the response status

    • warning

      added the new es-ES enum value to the response property for the response status

    • warning

      added the new et enum value to the response property for the response status

    • warning

      added the new fi enum value to the response property for the response status

    • warning

      added the new fr-CA enum value to the response property for the response status

    • warning

      added the new fr-FR enum value to the response property for the response status

    • warning

      added the new he enum value to the response property for the response status

    • warning

      added the new hu enum value to the response property for the response status

    • warning

      added the new id enum value to the response property for the response status

    • warning

      added the new lt enum value to the response property for the response status

    • warning

      added the new lv enum value to the response property for the response status

    • warning

      added the new nb enum value to the response property for the response status

    • warning

      added the new nl enum value to the response property for the response status

    • warning

      added the new pl enum value to the response property for the response status

    • warning

      added the new pt enum value to the response property for the response status

    • warning

      added the new pt-BR enum value to the response property for the response status

    • warning

      added the new pt-PT enum value to the response property for the response status

    • warning

      added the new ro enum value to the response property for the response status

    • warning

      added the new ru enum value to the response property for the response status

    • warning

      added the new sk enum value to the response property for the response status

    • warning

      added the new sl enum value to the response property for the response status

    • warning

      added the new sv enum value to the response property for the response status

    • warning

      added the new th enum value to the response property for the response status

    • warning

      added the new tr enum value to the response property for the response status

    • warning

      added the new uk enum value to the response property for the response status

    • warning

      added the new vi enum value to the response property for the response status

    • warning

      added the new zh-Hans enum value to the response property for the response status

    • warning

      added the new zh-Hant enum value to the response property for the response status

    • info

      added the new ar enum value to the request property

    • info

      added the new bg enum value to the request property

    • info

      added the new cs enum value to the request property

    • info

      added the new da enum value to the request property

    • info

      added the new de-CH enum value to the request property

    • info

      added the new de-DE enum value to the request property

    • info

      added the new el enum value to the request property

    • info

      added the new en-GB enum value to the request property

    • info

      added the new en-US enum value to the request property

    • info

      added the new es-419 enum value to the request property

    • info

      added the new es-ES enum value to the request property

    • info

      added the new et enum value to the request property

    • info

      added the new fi enum value to the request property

    • info

      added the new fr-CA enum value to the request property

    • info

      added the new fr-FR enum value to the request property

    • info

      added the new he enum value to the request property

    • info

      added the new hu enum value to the request property

    • info

      added the new id enum value to the request property

    • info

      added the new lt enum value to the request property

    • info

      added the new lv enum value to the request property

    • info

      added the new nb enum value to the request property

    • info

      added the new nl enum value to the request property

    • info

      added the new pl enum value to the request property

    • info

      added the new pt enum value to the request property

    • info

      added the new pt-BR enum value to the request property

    • info

      added the new pt-PT enum value to the request property

    • info

      added the new ro enum value to the request property

    • info

      added the new ru enum value to the request property

    • info

      added the new sk enum value to the request property

    • info

      added the new sl enum value to the request property

    • info

      added the new sv enum value to the request property

    • info

      added the new th enum value to the request property

    • info

      added the new tr enum value to the request property

    • info

      added the new uk enum value to the request property

    • info

      added the new vi enum value to the request property

    • info

      added the new zh-Hans enum value to the request property

    • info

      added the new zh-Hant enum value to the request property

    • info

      added the media type application/json for the response with the status

    • info

      added the media type application/json for the response with the status