- Configured rules: predefined options for formatting conventions, like time format, number formatting, and punctuation
- Custom instructions: your own natural-language instructions for requirements the predefined rules don’t cover
The Style Rules API is currently available only to Pro API subscribers.
Create a style rule list
SendPOST /v3/style_rules a name, the target language the rules apply to, and the rules themselves:
Example request
Example response
version field increments each time the list is modified, so you can track changes to your style rules. See the endpoint reference for all available configured rule categories and options, and the custom instructions guide for how to write instructions that work well.
Apply style rules to a translation
Pass the list’sstyle_id in a /v2/translate or /v2/document request. The target language of the request has to match the style rule list’s language:
Example request
model_type values are supported with style rules. Style rules apply to root languages, so a list with language: "en" works for EN-US and EN-GB targets alike; see How to Apply Customizations to Language Variants.
Update a style rule list
As with glossaries, the update methods have different scopes:PATCH /v3/style_rules/{style_id}updates the list’s namePUT /v3/style_rules/{style_id}/configured_rulesreplaces all configured rules; custom instructions are not affected
POST /v3/style_rules/{style_id}/custom_instructionsadds an instructionPUT .../custom_instructions/{instruction_id}replaces one (all fields required)DELETE .../custom_instructions/{instruction_id}removes one
GET /v3/style_rules (add detailed=true to include each list’s rules and instructions) or GET /v3/style_rules/{style_id}. Deleting a list with DELETE /v3/style_rules/{style_id} cannot be undone.
Limits
- Style rule lists support target languages
de,en,es,fr,it,ja,ko, andzh - There is no limit on the number of configured rules per list
- A list can hold up to 200 custom instructions (this cap may be adjusted per plan tier in the future); each instruction prompt is limited to 300 characters
- If you need more than 200 custom instructions, split your rules across multiple style rule lists for different content types