Style guides

Create a style guide

Creates a new style guide in your workspace.

Use POST /styleguides/rules afterward to add rules to a section.

post/styleguides

Request

  • Base URL: https://api.dittowords.com/v2
  • URL: https://api.dittowords.com/v2/styleguides
  • Auth: API key in header Authorization

Request body

namestring required

The name of the new style guide.

descriptionstring required

A description of the style guide's purpose.

enabledByDefaultboolean

Whether this style guide is enabled by default for all projects. Defaults to true.

variantIdstring

Developer ID of a variant to scope this style guide to — its rules then apply only to text in that variant. Currently, this is only supported for variants with a locale code. Omit for a style guide that should apply to all text.

Scoping a style guide to a variant is how it's associated with a locale, because a locale in Ditto is a variant's locale code. Use GET /v2/variants to find the variant whose locale code matches the locale you want, rather than inferring it from the variant's name.

Example request

{
  "name": "Acme Inc.",
  "description": "Voice and tone for Acme Inc. product text.",
  "sections": [
    {
      "sectionId": "foundations",
      "name": "Foundations",
      "kind": "rules"
    },
    {
      "sectionId": "word-list",
      "name": "Word List",
      "kind": "wordlist"
    }
  ]
}

Response

Returns the developer ID and name of the created style guide

idstring required

The Developer ID of the created style guide

namestring required

The name of the created style guide

Example response

{
  "id": "acme-inc",
  "name": "Acme Inc."
}

Changes

No recorded changes to this operation across all 1 revision of this API.