# A complete, coherent design choice from a brief alone (every field optional)

`POST /hosting/design-library/design` · Rivier · hosting

A complete, coherent design choice from a brief alone (every field optional): palette, type pairing, spacing and shape, sections, flow, closest template, and for apps shell, screens and component style; plus alternatives with a reason each. A brand kit (colours, fonts, voice) acts as constraints: the palette is built from the brand colours with every contrast correction reported, brand fonts without a web licence are replaced by the nearest open pairing. Deterministic and versioned (selectionVersion).

- Scope: hosting:write
- Mcp: rivier_design_library_design
- Graphql: Mutation.hostingLibraryDesign
- Sdk: hosting.library.design
- Cli: hosting library design

## Request body

`application/json`

```json
{
  "type": "object",
  "properties": {
    "text": {
      "type": "string",
      "maxLength": 1500
    },
    "surface": {
      "type": "string",
      "enum": [
        "website",
        "app",
        "both"
      ]
    },
    "siteType": {
      "type": "string",
      "maxLength": 40
    },
    "appType": {
      "type": "string",
      "enum": [
        "customer-portal",
        "guest-app",
        "member-area",
        "staff-dashboard",
        "booking-app",
        "shop-app",
        "internal-tool",
        "community-app"
      ]
    },
    "businessType": {
      "type": "string",
      "maxLength": 40
    },
    "purpose": {
      "type": "array",
      "items": {
        "type": "string",
        "maxLength": 30
      },
      "maxItems": 8
    },
    "mood": {
      "type": "array",
      "items": {
        "type": "string",
        "maxLength": 30
      },
      "maxItems": 8
    },
    "density": {
      "type": "string",
      "enum": [
        "airy",
        "balanced",
        "compact"
      ]
    },
    "languages": {
      "type": "array",
      "items": {
        "type": "string",
        "maxLength": 12
      },
      "maxItems": 12
    },
    "rtl": {
      "type": "boolean"
    },
    "a11y": {
      "type": "string",
      "enum": [
        "AA",
        "AAA"
      ]
    },
    "brand": {
      "type": "object",
      "properties": {
        "draft": {
          "type": "boolean"
        },
        "name": {
          "type": "string",
          "maxLength": 60
        },
        "colors": {
          "type": "array",
          "items": {
            "type": "string",
            "pattern": "^#[0-9a-fA-F]{6}$"
          },
          "minItems": 1,
          "maxItems": 6
        },
        "fonts": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "family": {
                "type": "string",
                "minLength": 1,
                "maxLength": 60
              },
              "role": {
                "type": "string",
                "enum": [
                  "heading",
                  "body",
                  "both"
                ]
              },
              "style": {
                "type": "string",
                "enum": [
                  "sans",
                  "serif",
                  "mono",
                  "display"
                ]
              },
              "webLicence": {
                "anyOf": [
                  {
                    "type": "boolean"
                  },
                  {
                    "type": "string",
                    "const": "unknown"
                  }
                ]
              }
            },
            "required": [
              "family",
              "webLicence"
            ],
            "additionalProperties": false
          },
          "maxItems": 4
        },
        "imagery": {
          "type": "string",
          "maxLength": 200
        },
        "voice": {
          "type": "array",
          "items": {
            "type": "string",
            "maxLength": 30
          },
          "maxItems": 8
        },
        "logoText": {
          "type": "string",
          "maxLength": 40
        }
      },
      "required": [
        "colors"
      ],
      "additionalProperties": false
    },
    "useStoredBrand": {
      "type": "boolean"
    },
    "dark": {
      "type": "boolean"
    }
  },
  "additionalProperties": false
}
```

## Responses

- `200`: Success
- `400`: The request was malformed
- `401`: No valid credential
- `403`: The credential lacks the scope, origin or address
- `429`: Over the key's rate limit; see Retry-After

## Example

```sh
curl -X POST 'https://api.rivier.ai/hosting/design-library/design' \
  -H 'Authorization: Bearer $KEY' \
  -H 'Content-Type: application/json' \
  -d '{
  "text": "string",
  "surface": "website",
  "siteType": "string",
  "appType": "customer-portal",
  "businessType": "string",
  "purpose": [
    "string"
  ],
  "mood": [
    "string"
  ],
  "density": "airy"
}'
```
